BLE ANCS Example

Source code path: example/ble/ancs_dualcore

Supported Platforms

  • eh-lb55x

Overview

This example demonstrates how to trigger Apple ANCS (Apple Notification Center Service) protocol subscription and simple handling of corresponding events. ANCS is a messaging protocol provided by Apple that allows access to all messages received in the iOS device’s notification bar and control of some special messages.

Usage Instructions

  1. The example starts advertising upon boot with the name SIFLI_APP-xx-xx-xx-xx-xx-xx, where xx represents the Bluetooth address of the device. This can be obtained using the finsh command “nvds get_mac”.

  2. Use BLE software (LightBlue, nRF Connect, etc.) on iOS devices (iPhone or iPad) to connect to this device. Note that ANCS requires pairing to complete, so you must accept when the pairing dialog appears on the iOS device. 2) Higher iOS versions may also show a system notification sharing confirmation dialog in addition to the pairing dialog, which can also be toggled in the iOS Bluetooth settings for the corresponding device.

  3. When messages are received, this example will print them through HCPU logs.

    1. Related protocol reference: ANCS Official Documentation

Hardware Requirements

Before running this example, prepare:

Compilation and Flashing

Switch to the example project/lcpu/xx directory and run the scons command to compile:

> scons -j8

Switch to the example project/hcpu/xx directory and run the scons command to compile:

> scons -j8

Switch to the example project/hcpu/xx/build_xx directory and use JLink software commands to download the corresponding software:

loadbin project/hcpu/xx/build_xx/xx.bin addr
loadfile project/hcpu/xx/build_xx/xx.hex

For detailed compilation and download steps, please refer to the Quick Start Guide.

Expected Results

After the example starts:

  1. It can be connected and successfully paired by BLE software on iOS (such as LightBlue, nRF Connect).

  2. When iOS receives messages, the device displays related information through logs.

Troubleshooting

Reference Documentation

Update History

Version

Date

Release Notes

0.0.1

01/2025

Initial version