This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Service is advertised, but not provided.

Hi Nordic!

I am building a Bluetooth application that uses Alert and Notification Service. We are using Evaluation board PCA10001, our code is based on the example app from board 6310.

The Central role is on iOS app. I can disover the peripheral and if I look at advertising data I see that service with correct UUID (1811) is being advertised. The service is, however, not discovered in later phase, which as I found out means that it is "not provided".

Attached is the source code for the application.

Here is a question I asked on StackOverflow, which lead to finding out that the iOS code is fine.

stackoverflow.com/.../ios-corebluetooth-services-never-discovered-but-are-visible-in-advertisingdata

ble_app_alert_notification.zip

  • The Alert Notification implementation that is in the SDK is a client implementation of the service, not a server implementation. If you take a look at the Alert Notification Profile document, you can see that the server is the device containing the alarms, while the client is accessing them. Section 2.4 also says:

    The Alert Notification Server shall implement the GAP central role and may implement the GAP Peripheral role. The Alert Notification Client shall implement the GAP Peripheral role and may implement the GAP Central role.

    Since the S110 is a Peripheral device, it therefore must implement the Client role, and this is what the SDK example shows. The services for which you are a client does not show up in your own GATT table, and hence you can't see that the connected Peripheral is a Alert Notification Client when you connect to it from your iOS app.

  • Thank you Ole! Can you advise how to connect to the Alert Notification Service in this case?

  • What do you mean by that? As I said, the SDK example implements an ANS Client, and as such, there will not be anything in the Peripheral's GATT table. Instead, it will try to register for alarms in the Central's ANS Server implementation if it's there, as indicated by the LED activity on the board.

  • Thank you. Just to make sure I understand. Can you please confirm that the following is correct?

    The iOS needs to implement Central role and Connect to Peripheral (nrf51822). iOS also needs to implement Peripheral role and the ANS Server (similar to ServerManager in NordicSemiDemo iOS app) with Characteristics that match the ANS protocol (e.g. Service with UUID 1811, Alert Notification Control Point with UUID 2A44 etc.). iOS Peripheral needs to Advertise those Services and Characteristics and detect if there is a subscriber for any of them, then dispatch alarms.

    Sorry for being somewhat slow, but it looks like ANS is the least demoed of all BLE Profiles. You mentioned ANS Server, I was studying ANS Profile specification and it only says about ANS Server that "The Alert Notification Server Profile role shall have one instance of the Alert Notification service." I deduced, that it means I write full ANS Service implementation on iOS side, which seemed like mirroring the work already done on nrf51822 side.

  • Yes, you'll have to implement the ANS Server on the iOS side. However, this doesn't actually make the iOS device into a GAP Peripheral, even though iOS API's make it seem like this. Take a look at this question for a description of the different roles: https://devzone.nordicsemi.com/index.php/what-is-a-client-and-server-in-ble#reply-233

    You are also correct that this in some sense mirrors the work done on the nRF51822 side, in that you have to implement a Server on iOS for the Client on the nRF51822 to access.

Related