Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
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:
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.
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
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 2014Oh 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