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

One peripheral many centrals

I am looking for a best solution to this scenario as in title:

  1. I read in some posts (eg. this post) that can use multiple ble service instances

  2. also in this post mentioned multiple GATT server instances can be used.

My concern mainly focus on that different centrals will have different data stream and status values, so these instances can not share same copy of values or status.

Also i checked the ble services implementation in SDK14, does not see much related to multi-instances ready. The multi-peripheral example does not give much detail on how multiple instances of services should be handled.

So the questions are:

  1. what are the best way to go, multiple service instances or multiple GATT servers?

  2. are there any examples for guide purpose?

Thank you.

Parents
  • I believe you are mixing terms and layers. Firstly there are Master And Slave roles on the lowest Logical Link layer. They are asymmetric and always peer to peer (as everything in Bluetooth) so you need o have right mix to establish the connection and you need to have right number of "slots" if you want to establish multiple links form single HW/SW stack (device). In BLE this is usually paired with the highest layer called Generic Access Profile (GAP) which simply says what roles each device plays and when. Master is called Central on GAP while Slave is called Peripheral. Anyway all this is (and I do agree it might be confusing at the beginning) logically independent with what is happening "in between" meaning on top of LL and bellow APP. That is called (G)ATT (ATTribute Protocol and Generic ATTribute protocol - technically two layers but no one is really picky about the boarder line because in 99% of cases it's GATT you see from the top), it has also asymmetric roles (called Server and Client) and you again need to have matching roles to make the data exchange happen but it's independent on LL (which runs bellow) and you can have both Client or Server on top of each Central and Peripheral. And you can have even both on top of any link established! (now it starts to be complex but that's the world around us;)

    So finally to your question which doesn't make sense technically:

    • If you want to have multiple connections (links) from one device and you need them all be GAP Peripheral then you need to have BLE stack which supports this (optional) feature from BT SIG Core spec v4.2 (before only one GAP Peripheral role was specified for each device/stack instance). This is nRF52832 chip and S132 V5 (or S140 for nRF52840 once it will be available in production version). However on top of each of these links you need to make sure that you instantiate/initiate proper GATT Client or Server API in Nordic Soft Device (stack). Note that current limit of Nordic stack is 20 concurrent links (if RAM allows you to fulfill all functionality on top of each of them in APP layer = your application FW). You might also go with some open source stacks like Zephyr, they should support this use case as well.
    • If you just need to support certain GATT role then you can manage it (if you control both sides of the link so you can have matching asymmetric configuration;) on top of GAP Central link and up to 8 such Master links are supported by Nordic (and other stacks) already on nRF51.
Reply
  • I believe you are mixing terms and layers. Firstly there are Master And Slave roles on the lowest Logical Link layer. They are asymmetric and always peer to peer (as everything in Bluetooth) so you need o have right mix to establish the connection and you need to have right number of "slots" if you want to establish multiple links form single HW/SW stack (device). In BLE this is usually paired with the highest layer called Generic Access Profile (GAP) which simply says what roles each device plays and when. Master is called Central on GAP while Slave is called Peripheral. Anyway all this is (and I do agree it might be confusing at the beginning) logically independent with what is happening "in between" meaning on top of LL and bellow APP. That is called (G)ATT (ATTribute Protocol and Generic ATTribute protocol - technically two layers but no one is really picky about the boarder line because in 99% of cases it's GATT you see from the top), it has also asymmetric roles (called Server and Client) and you again need to have matching roles to make the data exchange happen but it's independent on LL (which runs bellow) and you can have both Client or Server on top of each Central and Peripheral. And you can have even both on top of any link established! (now it starts to be complex but that's the world around us;)

    So finally to your question which doesn't make sense technically:

    • If you want to have multiple connections (links) from one device and you need them all be GAP Peripheral then you need to have BLE stack which supports this (optional) feature from BT SIG Core spec v4.2 (before only one GAP Peripheral role was specified for each device/stack instance). This is nRF52832 chip and S132 V5 (or S140 for nRF52840 once it will be available in production version). However on top of each of these links you need to make sure that you instantiate/initiate proper GATT Client or Server API in Nordic Soft Device (stack). Note that current limit of Nordic stack is 20 concurrent links (if RAM allows you to fulfill all functionality on top of each of them in APP layer = your application FW). You might also go with some open source stacks like Zephyr, they should support this use case as well.
    • If you just need to support certain GATT role then you can manage it (if you control both sides of the link so you can have matching asymmetric configuration;) on top of GAP Central link and up to 8 such Master links are supported by Nordic (and other stacks) already on nRF51.
Children
No Data
Related