<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>One peripheral many centrals</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29801/one-peripheral-many-centrals</link><description>I am looking for a best solution to this scenario as in title: 
 
 
 I read in some posts (eg. this post ) that can use multiple ble service instances 
 
 
 also in this post mentioned multiple GATT server instances can be used. 
 
 
 My concern</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 01 Dec 2017 11:23:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29801/one-peripheral-many-centrals" /><item><title>RE: One peripheral many centrals</title><link>https://devzone.nordicsemi.com/thread/118268?ContentTypeID=1</link><pubDate>Fri, 01 Dec 2017 11:23:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67427fb9-eccd-497c-b971-2699373239df</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;It is referenced by using p_context. For example inside ble_bas_on_ble_evt():&lt;/p&gt;
&lt;p&gt;ble_bas_t * p_bas = (ble_bas_t *)p_context;&lt;/p&gt;
&lt;p&gt;Does this answer your question?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: One peripheral many centrals</title><link>https://devzone.nordicsemi.com/thread/118267?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2017 14:10:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d64c395-a029-4a79-b94f-eba63a474e46</guid><dc:creator>Roland</dc:creator><description>&lt;p&gt;thanks for the advice.  the state problem is what i am worried. but I will try on it.&lt;/p&gt;
&lt;p&gt;Since defined in SDK, is #define NRF_SDH_BLE_OBSERVERS   (  _name, _prio, _handler,_context, _cnt ) macro, actually implemented and supported? How should i refer to each instance of observers in code? Is there any example for guiding purpose?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: One peripheral many centrals</title><link>https://devzone.nordicsemi.com/thread/118266?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 18:49:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:806c0861-0895-4f8e-a45c-185f96746d76</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;It sounds like you don&amp;#39;t need one characteristic for each central, but it is difficult to say without more details. I guess as long as your procedures are stateless you should be good. I would give it a try first at least.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: One peripheral many centrals</title><link>https://devzone.nordicsemi.com/thread/118265?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 09:49:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c3c958b-6223-4a03-afb9-028b6a60e28c</guid><dc:creator>Roland</dc:creator><description>&lt;p&gt;these central devices connect to the peripheral at the same time. Each central device actually run the same copy of software, so their function and behavior are just the same, and the service/characteristic model defined are exactly the same. However, each central device may generate different data / status (for instance, they are operated by different users, or monitoring different area), which means different values/status for the same characteristic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: One peripheral many centrals</title><link>https://devzone.nordicsemi.com/thread/118264?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 09:42:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:866771d9-e8c5-4ba4-b837-738799c0df94</guid><dc:creator>Roland</dc:creator><description>&lt;p&gt;I find this macro has been listed in SDK14:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NRF_SDH_BLE_OBSERVERS	(	 	_name,
 	_prio,
 	_handler,
 	_context,
 	_cnt 
)		
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But i am not sure if nordic services library already adopt this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: One peripheral many centrals</title><link>https://devzone.nordicsemi.com/thread/118263?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 09:29:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d97f359d-6fdc-4c50-8d2a-d36426ec584e</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;When you say they have the same functions, but data exchanged is different, could you elaborate a bit? Will you only have one central device connected at the time?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: One peripheral many centrals</title><link>https://devzone.nordicsemi.com/thread/118270?ContentTypeID=1</link><pubDate>Tue, 28 Nov 2017 09:18:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c565ca8-255a-4698-84ed-76287354823f</guid><dc:creator>Roland</dc:creator><description>&lt;p&gt;Sry for the late reply as i am working on other threads before turning back to this one.&lt;/p&gt;
&lt;p&gt;Basically i have, say, 5 central devices that connect to the same peripheral device.  each device has exactly same functions, but data exchanged with the peripheral device are different. One choice i have is to defined 5 services for each of them, or another one is have 1 service for them all.
Having 5 services defined does not seem to be elegant or scalable solution. However having 1 for all will need to have multiple instance of characteristic/attribute values.&lt;/p&gt;
&lt;p&gt;I saw your answer in &lt;a href="https://devzone.nordicsemi.com/question/169736/multilink-peripheral-ble-services/"&gt;this post&lt;/a&gt; said can have multiple instance of services defined. I would like to try this solution but in that case, i am not sure how multiple attribute instances are handled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: One peripheral many centrals</title><link>https://devzone.nordicsemi.com/thread/118262?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 12:12:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60adb0d6-51b0-4bcd-afef-c64ff604f445</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I don&amp;#39;t quite understand what you want to do, but by spec you can only have one server on a Bluetooth device:&lt;/p&gt;
&lt;p&gt;There shall be only one instance of a server on each Bluetooth device; this implies that the attribute handles shall be identical for all supported bearers.&lt;/p&gt;
&lt;p&gt;See Vol. 3, Part F, Section 2 in the Bluetooth core v5.0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: One peripheral many centrals</title><link>https://devzone.nordicsemi.com/thread/118269?ContentTypeID=1</link><pubDate>Wed, 04 Oct 2017 12:55:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8834488-a115-4f84-9d2b-4fe4c32c7a38</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;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 &amp;quot;slots&amp;quot; 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 &amp;quot;in between&amp;quot; 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&amp;#39;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&amp;#39;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&amp;#39;s the world around us;)&lt;/p&gt;
&lt;p&gt;So finally to your question which doesn&amp;#39;t make sense technically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>