<?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>Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35689/multilink-central---data-always-received-from-the-last-device</link><description>Hello, 
 I am having a custom nRF52832-based central device - it works fine when connecting a single nRF52832-based peripheral (the both are based on SDK 14). 
 Now I need to support two identical peripheral devices - I have increased NRF_SDH_BLE_CENTRAL_LINK_COUNT</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Apr 2019 11:12:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35689/multilink-central---data-always-received-from-the-last-device" /><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/181823?ContentTypeID=1</link><pubDate>Fri, 12 Apr 2019 11:12:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b075fd6a-064e-4c55-ba2c-74ba112d77d3</guid><dc:creator>dhia1994</dc:creator><description>&lt;p&gt;hi ! i need to know how do you receive data with multi_link_central ! she doesn&amp;#39;t work for me ! please help me&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/139481?ContentTypeID=1</link><pubDate>Tue, 10 Jul 2018 00:12:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73bbf540-08d9-4174-b865-d72e8c2e5ee9</guid><dc:creator>H&amp;#229;vard</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;&lt;span style="float:none;background-color:transparent;color:#11171a;font-family:&amp;#39;GT Eesti&amp;#39;, &amp;#39;Helvetica&amp;#39;, Arial, sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:21px;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;if the peripherals are enabled and the central device is turned on last - it does not initiate discovering the devices. To discover a peripheral, it needs a restart. Could you give hints how to deal with that?&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Could it be that you peripherals have stopped advertising? Or do they connect as expected, and then the central simply does nothing?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/139144?ContentTypeID=1</link><pubDate>Thu, 05 Jul 2018 15:39:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e43a50cd-69c6-42b6-8d2a-c0da1c156c4e</guid><dc:creator>kont40</dc:creator><description>&lt;p&gt;Hi H&amp;aring;vard,&lt;/p&gt;
&lt;p&gt;Thanks for the kind reply. I discovered by chance that changing MAX_CONNECTION_INTERVAL from 500 to 10, or even 7.5 has a great effect and with such values connection/disconnection of one peripheral does not influence the data flow from the other one, yet when the both are connected data from the both are received well. So I consider this problem solved. Now only one problem remains: if the peripherals are enabled and the central device is turned on last - it does not initiate discovering the devices. To discover a peripheral, it needs a restart. Could you give hints how to deal with that?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Kamen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/138776?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 12:46:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af725a3a-c949-4b47-9e75-d8902e0db70f</guid><dc:creator>H&amp;#229;vard</dc:creator><description>&lt;p&gt;Hi, sorry for the late reply.&lt;/p&gt;
&lt;p&gt;It might help me to look at the code. Since you are following the multilink example closely, I&amp;#39;m confident that we can figure this out together. :)&lt;/p&gt;
&lt;p&gt;So, if you connect to peripheral 1, and then to peripheral 2: peripheral 2 will &lt;em&gt;not&lt;/em&gt; work as expected.&lt;br /&gt;But if you reconnect peripheral 2, then the central will do service discovery on it, and peripheral 2 will work as expected. But peripheral 1 stops sending notifications. Correct?&lt;/p&gt;
&lt;p&gt;have you looked at the immediate alert service by the way? The multilink example treats data from the peripherals the same way, while the ble_app_ias + ble_app_ias_c keep track of how the alerts can actually be different on the different peripherals/clients.&lt;/p&gt;
&lt;p&gt;How many characteristics are in the services you made? Could we be hindered by this variable&amp;nbsp;BLE_DB_DISCOVERY_MAX_SRV ? (If so, it can simply be increased).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/138471?ContentTypeID=1</link><pubDate>Mon, 02 Jul 2018 09:26:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bab40be-f081-4984-87d7-497dfbf86ff2</guid><dc:creator>kont40</dc:creator><description>&lt;p&gt;ping.... any updates? NORDIC? @&lt;span class="user-name"&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/havard"&gt;H&amp;aring;vard&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/138144?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 13:24:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d63bdda-ed29-4e5b-ad10-2bbf2f279ada</guid><dc:creator>kont40</dc:creator><description>&lt;p&gt;@H&amp;aring;vard , If it will simplify the situation, I could share my central project source code; please, let me know what is best to do to discover the problem asap. Also, thanks for the kind attitude on solving the problem so far.&lt;a href="https://devzone.nordicsemi.com/members/havard"&gt; &lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/138019?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 07:38:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34e4a8cb-fb00-4c39-b433-4ef5088314d5</guid><dc:creator>kont40</dc:creator><description>&lt;p&gt;More facts on that story:&lt;/p&gt;
&lt;p&gt;- with one peripheral enabled, when just starting the central device, there are two sub-sequential on_primary_srv_discovery_rsp events for each servide, and the second call of on_primary_srv_discovery_rsp for the first service comes with p_srv_being_discovered-&amp;gt;srv_uuid.uuid being zero.&lt;br /&gt;After restarting the peripheral device on_primary_srv_discovery_rsp is called once for a service as expected. I am attaching the debug log below.&lt;br /&gt;&lt;br /&gt;- if the two peripheral devices are enabled at the same time, upon starting the central device only one of the devices gets discovered. To discover the second peripheral it should be restarted.&lt;br /&gt;&lt;br /&gt;I also wonder: &lt;br /&gt;- do we need to disable all notifications from the first device while the second one connects? Could they affect connection process somehow? Are there other factors that might have influence to be &lt;br /&gt;investigated?&lt;br /&gt;&lt;br /&gt;Apart from the definition of the two custom services, all the logic follows the ble_app_multilink_central example strictly, there should be a way to debug and detect the problems.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Debug log:&lt;/p&gt;
&lt;p&gt;Right after enabling the central device and with only one peripheral device enabled:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;start scanning...
extracted UUID = 43681, type = 1
Target UUID = 43697, type = 1
extracted UUID = 43697, type = 1
Target UUID = 43697, type = 1
discovery the device!
creating a connection...
Connection 0x0 established, starting DB discovery.Starting discovery of service with UUID 0xaaa1 on connection handle 0x0.
discovery NOT pending................ 
start scanning...
Peer on connection 0x0 requested an ATT MTU of 247 bytes.
Updating ATT MTU to 247 bytes (desired: 247) on connection 0x0.
MTU set to 244 
Peer on connection 0x0 requested a data length of 251 bytes.
Updating data length to 251 bytes on connection 0x0.
 data length updated to 251 on connection 0x0.
 max_rx_octets: 251
 max_tx_octets: 251
 max_rx_time: 2120
 max_tx_time: 2120
PDU updated to 251 bytes
Found service UUID 0xaaa1, con handle 0
Found service UUID 0x0, con handle 0
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
PHY update request to central.PHY update request to central success
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
Discovery of service with UUID 0xaaa1 completed with success on connection handle 0x0.
Starting discovery of service with UUID 0xaab1 on connection handle 0x0.
Discovery of service with UUID 0xaaa1 completed with success on connection handle 0x0.
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
_custom_service_two_ service has been discovered
_custom_service_two_ service discovered on conn_handle 0x0
Enable _custom_service_two_ service notifications... ccd handle: 18, con handle: 0
 SD Read/Write API returns NRF_ERROR_BUSY. This message sending will be attempted again.. 17
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
_custom_service_two_ service has been discovered
_custom_service_two_ service discovered on conn_handle 0x0
Enable _custom_service_two_ service notifications... ccd handle: 18, con handle: 0
 SD Read/Write API returns NRF_ERROR_BUSY. This message sending will be attempted again.. 17
Starting discovery of service with UUID 0xaab1 on connection handle 0x0.
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
Found service UUID 0xaab1, con handle 0
Found service UUID 0xaab1, con handle 0
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
PHY update accepted. PHY set to 2 Mbps.
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
Discovery of service with UUID 0xaab1 completed with success on connection handle 0x0.
Discovery of service with UUID 0xaab1 completed with success on connection handle 0x0.
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
_custom_service_one_ service has been discovered!
_custom_service_one_ service discovered on p__custom_service_one__c-&amp;gt;conn_handle 0, p__custom_service_one__c_evt-&amp;gt;conn_handle 0
Enable _custom_service_one_ service notifications... ccd handle: 24, con handle: 0
 SD Read/Write API returns Success.
 SD Read/Write API returns Success.
 SD Read/Write API returns NRF_ERROR_BUSY. This message sending will be attempted again.. 17
 SD Read/Write API returns Success.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;After restarting the peripheral device:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;extracted UUID = 43681, type = 1
Target UUID = 43697, type = 1
extracted UUID = 43697, type = 1
Target UUID = 43697, type = 1
discovery the device!
creating a connection...
Connection 0x0 established, starting DB discovery.Starting discovery of service with UUID 0xaaa1 on connection handle 0x0.
discovery NOT pending................ 
start scanning...
Peer on connection 0x0 requested an ATT MTU of 247 bytes.
Updating ATT MTU to 247 bytes (desired: 247) on connection 0x0.
MTU set to 244 
Peer on connection 0x0 requested a data length of 251 bytes.
Updating data length to 251 bytes on connection 0x0.
 data length updated to 251 on connection 0x0.
 max_rx_octets: 251
 max_tx_octets: 251
 max_rx_time: 2120
 max_tx_time: 2120
PDU updated to 251 bytes
Found service UUID 0xaaa1, con handle 0
PHY update request to central.PHY update request to central success
Discovery of service with UUID 0xaaa1 completed with success on connection handle 0x0.
Starting discovery of service with UUID 0xaab1 on connection handle 0x0.
Found service UUID 0xaab1, con handle 0
PHY update accepted. PHY set to 2 Mbps.
Discovery of service with UUID 0xaab1 completed with success on connection handle 0x0.
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
_custom_service_two_ service has been discovered
_custom_service_two_ service discovered on conn_handle 0x0
Enable _custom_service_two_ service notifications... ccd handle: 18, con handle: 0
 SD Read/Write API returns Success.
call to ble_lbs_on_db_disc_evt for instance 0 and link 0x0!
_custom_service_one_ service has been discovered!
_custom_service_one_ service discovered on p__custom_service_one__c-&amp;gt;conn_handle 0, p__custom_service_one__c_evt-&amp;gt;conn_handle 0
Enable _custom_service_one_ service notifications... ccd handle: 24, con handle: 0
 SD Read/Write API returns NRF_ERROR_BUSY. This message sending will be attempted again.. 17
 SD Read/Write API returns Success. &lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/137950?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 15:04:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42e1586b-3a4e-4089-8e79-58156d12b0ff</guid><dc:creator>kont40</dc:creator><description>&lt;p&gt;These seem to be fine, yet, the problem persists: the data reception from the first device will terminate upon creating the connection with the second one... A bit out of ideas what to try more... An observation that might be a hint: there are two custom services implemented. If the discovery of one of them is skipped (by placing an early return statement into ble_servive_c_on_db_disc_evt ) the behavior of the discovered second service is as expected and its transmission does not get interrupted upon connection/disconnection of the second device... &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/137796?ContentTypeID=1</link><pubDate>Wed, 27 Jun 2018 07:26:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3b2569f-ca5a-4e00-af65-85daf0b0877c</guid><dc:creator>H&amp;#229;vard</dc:creator><description>&lt;p&gt;Similar to this thread that you linked to (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/29790/multiperipheral-uart-example"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/29790/multiperipheral-uart-example&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Could you check if both uart instance structs are filled correctly?&lt;/p&gt;
&lt;p&gt;m_ble_nus_c.handles.nus_tx_cccd_handle,&amp;nbsp;nus_tx_handle, nus_rx_handle = ? (for both instances)&lt;/p&gt;
&lt;p&gt;The handles are assigned using&amp;nbsp;ble_nus_c_handles_assign when you get&amp;nbsp;BLE_NUS_C_EVT_DISCOVERY_COMPLETE.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/137613?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 08:28:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6603625f-df00-475d-a150-62e95b2597e6</guid><dc:creator>kont40</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thanks for reply.&lt;/p&gt;
&lt;p&gt;Sorry, I missed to mention the total link count, I have updated it too initially. The config looks like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;o&amp;gt; NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. 
#ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 0
#endif

// &amp;lt;o&amp;gt; NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. 
#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 2
#endif

// &amp;lt;o&amp;gt; NRF_SDH_BLE_TOTAL_LINK_COUNT - Maximum number of total concurrent connections using the default configuration. 
#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
#define NRF_SDH_BLE_TOTAL_LINK_COUNT 2
#endif
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As to whether both devices are simultaneously connected - I believe so as upon disconnection of each one I am getting debug message as expected, and connection handler numbers seem to be maintained correctly, e.g.:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Upon diconnetion of one of them:
LBS central link 0x1 disconnected (reason: 0x8)

Upon disconnection of the other one:
LBS central link 0x0 disconnected (reason: 0x8)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also, in some example, i.e. one here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://gitlab.utu.fi/tujupan/DTEK8081_source_codes/blob/master/examples/ble_peripheral/experimental/ble_app_gatts_c/main.c"&gt;gitlab.utu.fi/.../main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I see the function&amp;nbsp; nrf_ble_gatts_c_handles_assign being used before ble_db_discovery_start - I am not sure, do I need this for proper handling of peripheral connection handlers? In other examples I don&amp;#39;t see such a function used, so a bit confused on that.&lt;/p&gt;
&lt;p&gt;Your further help to resolving the matter will be appreciated, I could provide any additional information needed.&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;P.S. As I see here &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.0.0%2Fservice_gatts_c.html"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v14.0.0%2Fservice_gatts_c.html&amp;nbsp;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;nrf_ble_gatts_c_handles_assign&amp;nbsp; is only needed in case the server could change the supported services dynamically, which is not my case. So it turns out&amp;nbsp;nrf_ble_gatts_c_handles_assign&amp;nbsp; is not related to my problem, and effort to resolving it continues...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any suggestions on how to debug to finding the problem?&lt;/p&gt;
&lt;p&gt;Also, now I am programming the both peripheral devices with identical firmware, could this be a problem, should they have e.g. different UUIDs?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multilink central - data always received from the last device</title><link>https://devzone.nordicsemi.com/thread/137589?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 07:46:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff19a764-007b-4249-91c3-8f2556aca299</guid><dc:creator>H&amp;#229;vard</dc:creator><description>&lt;p&gt;Hello Kont40,&lt;/p&gt;
&lt;p&gt;Are you sure both devices are connected at the same time?&lt;/p&gt;
&lt;p&gt;There is&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;but also&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;NRF_SDH_BLE_TOTAL_LINK_COUNT - Maximum number of total concurrent connections using the default configuration.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>