nRF51 SDK - S110 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Experimental: Apple Notification Center Service (ANCS) Client Application

The ANCS Client Application is an example that implements the Apple Notification Center Service using the hardware delivered in the nRF51 Development Kit.

For detailed information about the Apple Notification Center Service, visit Apple's Developer pages.

The application will accept many kinds of iOS generated notifications and print them to the nRF6350 Display module. When the application receives a notification, it will send a Get Notification Attributes command to the iOS device, requesting the attributes of a specific iOS notification. For this application, the Get Notification Attribute command will always request the attributes:

  • NotificationAttributeIDTitle
  • NotificationAttributeIDMessage

If a response, in form of a Title and Message, is returned from the iOS device to this Get Notification Attribute command, the response will be printed on the UART.

Note
This application is not power optimized!
The application will stop advertising after 3 minutes and go to system-off mode. Push the button 1 restart advertising.

Setup

The name of the example is experimental_ble_app_ancs_s110_pca10028. If you are not using the Keil Pack Installer, you can find the source code and project file of the example in the following folder: <InstallFolder>\Nordic\nrf51\examples\ble_peripheral\experimental_ble_app_ancs

Button assignments:

  • Button 1: Wake up from system-off and restart advertising.
  • Button 2: Wake up, erase all bonds, and restart advertising; send iOS notification message contents on UART.

Testing

Test the ANCS Client Application with the nRF Toolbox app, which is available on both iOS (Apple Store) and Android (Google Play).

You can also test the application with the Master Control Panel by performing the following steps:

  1. Start a COM listener like PUTTY and connect to the used COM port with the following UART settings:
    • Baud rate: 38.400
    • 8 data bits
    • 1 stop bit
    • No parity
    • HW flow control: RTS/CTS
  2. Compile and program the application. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
  3. In the Master Control Panel, create the Apple Notification Center Service (ANCS) server by doing the following steps:
    • Click File -> Server Setup. In the window that opened up, click File -> Load setup.
    • In the resulting window, navigate to ble_app_ancs folder and load the file named ANCS_central.bin.
    • It is important to keep the 'Server Setup' window opened.
  4. Select the device from Master Control Panel (the device will be advertising as 'ANCC'), then connect, bond and perform service discovery.
  5. Observe that the BSP_INDICATE_CONNECTED state is indicated.
  6. Observe that the server is started.
  7. Upon bonding, verify in the 'Server Setup', that the Client Characteristic Configuration descriptor (CCCD) for 0x120D and 0xC6E9 are set to 0001.
  8. Set the value of characteristic 0x120D to 00-01-06-02-01-02-03-04 in the 'Server Setup', and press 'update'.
  9. Verify that the UART has received "Email\\n Added 01020304".
  10. Verify in the 'Server Setup', that the Client Characteristic Configuration descriptor (CCCD) for 0xD8F3 is updated to 00-01-06-03-04-01-20-00-03-20-00.
  11. The response on 0xD8F3 is a Get Notification Attribute command, requesting the Title and Message for the Email notification.
  12. Respond in the 'Server Setup', by setting the Client Characteristic Configuration descriptor (CCCD) for 0xC6E9 to 00-01-02-03-04-01-03-00-6E-52-46-03-03-00-34-32-32.
  13. Press Button 2 and verify that the UART console connected to the device shows "nRF422".
  14. Disconnect from the Master Control Panel and observe that the BSP_INDICATE_ADVERTISING state is indicated.
  15. Wait until the application goes to system-off (BSP_INDICATE_IDLE).
  16. Press button 0 and connect to the Master Control Panel. Observe that the BSP_INDICATE_CONNECTED state is indicated.
  17. Disconnect from the Master Control Panel.