9 years, 10 months ago.

BLE central role

Just want to ask, is mbed BLE sdk support BLE central role? As iOS ANCS, we have to switch central role. Thanks.

Question relating to:

The nRF51822-mKIT is a low cost ARM mbed enabled development board for Bluetooth® Smart designs with the nRF51822 SoC. The kit gives access to all GPIO pins via pin headers …

Hi Gordon

If you are confusing about ANCS central, peripheral and gatt server, client, please read Chris's blog here: http://blog.punchthrough.com/post/63658238857/the-apple-notification-center-service-or-wtf-is

You can access ANCS with either Central or Peripheral role, but you always need gatt client in both case. You do not have to switch between Central and Peripheral role (gap master/slave) in most case, but you might need to switch GATT server and client role, and that should be automatic. Switching GAP Central and Peripheral is required when your platform is Central-GATT Peripheral only or Peripheral-GATT Server only. As you see, you need to switch role from Peripheral to Central, but that was only to access GATT Peripheral. nRF51822, Peripheral mode support both GATT Server and Client, so basically you don't have to switch role from Peripheral to Central. Unless you need GAP Central for other purposes.

As long as i know, currently Central (S120) is not supported on mbed yet. Peripheral is supported, but only gatt server API are currently exposed. I think you can access the lower API (gatt client) thought. Currently I'm also working on this but I have no timeline. (I have successfully porting the nRF56310's ANCS demo to nRF51822-EK, which next step to do it on nRF51822-mKit/mbed)

ref. https://mbed.org/questions/3207/GATT-Client-Support/

posted by devsar devsar 16 May 2014

Oh by the way,

GAP role switching must be supported on both side of the devices, not only on one side of it. For ex. if your device is Peripheral and want to change role to Central, your peripheral device is sending a message (packet) to Central to ask/request for that. Central can accept or deny this request.

I already experimenting this on iPhone (iOS7), and the result is it denying the request. So even if mbed ble api support GAP role switching someday, I don't think you can do that with iPhone.

posted by devsar devsar 16 May 2014

2 Answers

9 years, 10 months ago.

ANCS doesn't require you to switch to a central role (to the best of my knowledge), only that your Bluetooth LE stack can act as a GATT client as well as as a server. S110 can, and there are ANCS examples for S110 from Nordic, however I haven't seen an implementation of the GATT client in the mbed BLE API yet (I may have missed it).

S120 isn't supported by the mbed BLE API, to the best of my knowledge.

Accepted Answer

I don't know ANCS and is not that much familiar with the mbed api. You can use the S120, but then you probably have to bypass the mbed API.

In regards to GATT client and server, that is supported by the S110.

posted by Glenn Klausen 15 May 2014

Thank you for your answer and let me understand ANCS. Really great, i confused for while.

posted by Gordon Luk 15 May 2014
9 years, 10 months ago.

Yes, you can use the S120 softdevice, which is an 8 link central. http://www.nordicsemi.com/eng/Products/Bluetooth-R-low-energy/nRF51822

Thank for your answer. But we need role switching from peripheral to central role. Not just one role only. Is that support at this moment?

posted by Gordon Luk 15 May 2014

Seems like an odd configuration. Could you elaborate little about what you are trying to achieve?

posted by Glenn Klausen 15 May 2014