<?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>NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/114501/ncs-multiple-connection-and-save-bond-information</link><description>If there have a peripheral sample support for multiple central? 
 How NCS realize saving bonding information and distinguish different devices that bond with my board? 
 Whether NCS have a manager method like peer_id and I can get conn_handle by it? </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Sep 2024 08:06:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/114501/ncs-multiple-connection-and-save-bond-information" /><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501851?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2024 08:06:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9467b0b8-a4b3-44fd-b689-471b782c93db</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I suggest you look at the &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/zephyr/services/settings/index.html"&gt;Settings subsystem&lt;/a&gt; for storing persistent data. The &lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.7.0/page/zephyr/samples/subsys/settings/README.html#settings"&gt;Settings API sample&lt;/a&gt;&amp;nbsp;demonstrate how it is used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501813?ContentTypeID=1</link><pubDate>Tue, 10 Sep 2024 00:34:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28f1e165-7764-45e9-8dac-725ded3d6c75</guid><dc:creator>Chaoyue Ying</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I think I understand about address.&lt;/p&gt;
&lt;p&gt;Now I want know how to use flash to save some extra information that in relation to the autosaved bond information,which document I can reference.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501697?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2024 11:00:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d50ad87d-7d74-4d5b-a918-c91cb7ee3002</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Chaoyue Ying"]If it mean that board connect with bonded device using the public address so that I can realize whether a device bonded by the address type?[/quote]
&lt;p&gt;Not per se. But the Bluteooth host will resolve the address basedon the IRK that was transfered during bonding and the random resolvlable address that is used when connecting. And from that will know which peer device it is, and always use the public address for the APIs. You can see this if you wait and re-connect with the phone that the public address you see on the nRF for that device will be the same. And if you use a sniffer you will see that the adress used on air is the random resolvable address.&lt;/p&gt;
[quote user="Chaoyue Ying"]If it is random,it mean the device is new bonding?[/quote]
&lt;p&gt;Not nesesarily. It could be that the peer always us a non-resolvable random address, for instance.&amp;nbsp;There is no specific API for thecking if a bond exists (though it &lt;a href="https://github.com/zephyrproject-rtos/zephyr/issues/10060#issuecomment-423937197"&gt;has been discussed&lt;/a&gt;).&amp;nbsp; But it is possible to iterate through all bonds with&amp;nbsp;bt_foreach_bond().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501626?ContentTypeID=1</link><pubDate>Mon, 09 Sep 2024 01:16:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa820be1-4d01-4fc4-b7f3-db54571bdb98</guid><dc:creator>Chaoyue Ying</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I test about address and find as follow.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/450118.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;If it mean that board connect with bonded device using the public address so that I can realize whether a device bonded by the address type?If it is random,it mean the device is new bonding?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501490?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 08:34:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:544ebe97-8720-4a42-bc5d-77a2ac26a941</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;After bonding (when the IRK) is exchanged, the API&amp;#39;s will always give you the same address even if the random resolvable address on air changes.&amp;nbsp;(There are helper functions you can use to check address type if needed, bt_addr_le_is_rpa(), andbt_addr_le_is_identity()).&lt;/p&gt;
&lt;p&gt;You can see this if you experiment with an example that log the addresses, like the Bluetooth peripheral UART sample. This address you can save and it will always be a &amp;quot;handle&amp;quot; to that devices (until the bond is deleted). I suggest you experiment a bit with that to see, as there are no other APIs for this but it is also not needed, but it may be unfamiliar as it is handled differently here than in the old nRF5 SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501481?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 07:49:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6079e60-df9e-4961-a886-188d4d4f628c</guid><dc:creator>Chaoyue Ying</dc:creator><description>&lt;p&gt;Hi，&lt;/p&gt;
&lt;p&gt;I know how it work by you explain.But it still a question of the detail to operation.&lt;/p&gt;
&lt;p&gt;In my understanding,I can save the address that using now and it can be used in next time that the connection have been&amp;nbsp;established.&lt;/p&gt;
&lt;p&gt;But there should be some functions to change or resolute because it will return false that compare the two address directly.&lt;/p&gt;
&lt;p&gt;If it as I said above,which functions need I used?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501475?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 07:35:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c8cec56f-1241-494e-bbcd-774d2741abfa</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you bond with the device, the BLE stack will do the identity resolution so you can use the address as a handle to the bonded device even though that is not the address that is currently used by the device (as it changes regularily based on it&amp;#39;s IRK). The result is that the address that is used in pairing/bonding related Zephyr API&amp;#39;s serve the same purpose as the peer ID in the nRF5 SDK, and you can use it the same way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501466?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 07:02:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e764f8e-216a-463b-9769-709cdff6d6b9</guid><dc:creator>Chaoyue Ying</dc:creator><description>&lt;p&gt;Hi,&lt;span class="yd-translate-container"&gt;&lt;span&gt; &lt;/span&gt;&lt;span class="yd-wrapper-inline yd-highlight"&gt; 你好,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I still can not understand how the address to use in application with NCS.&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;我仍然不能理解如何在NCS应用程序中使用地址。&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To be specific,when I using nRF5 SDK, I will get peer_id by pm_peer_id_get() and check a whether device is a special user.The special list is saved in flash by FDS so that don&amp;#39;t be afraid to lose power.&lt;/p&gt;
&lt;p&gt;But if NCS application still get a random resolvable address from connected phone,that means every connection with a same phone have different address.&lt;/p&gt;
&lt;p&gt;So that every time reget power,application will restart and the special flag of the connection will lose and maybe never recover.&lt;/p&gt;
&lt;p&gt;So I need to know if something or some way that can deal with it.&lt;/p&gt;
&lt;p&gt;&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="yd-translate-container"&gt;&lt;span class="yd-wrapper-block yd-highlight"&gt;具体来说，当我使用nRF5 SDK时，我将通过pm_peer_id_get()获取peer_id，并检查设备是否为特殊设备&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501465?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 06:44:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ec5796a-5c87-4b1a-be56-459eb05f548d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Chaoyue Ying"]Does it mean that when application support bonded to mutiple device,it will use address to do any things like send data by gatt and so on?[/quote]
&lt;p&gt;No,&amp;nbsp;for any connection related events of APIs you have the&amp;nbsp;connection object (bt_conn) which you use. This is similar to the conn_handle in the nRF5 SD&lt;/p&gt;
[quote user="Chaoyue Ying"]And by this way,peripheral how to identify mobile phone?Because my application with nRF SDK17 get the mobile phone address is a&amp;nbsp;variational random address.Therefore I used peer_id to identify everyone phone that connect with my application that developed with nRF SDK17.[/quote]
&lt;p&gt;This is handled automatically by the Bluetooth stack. If the device device use privacy and the IRK was shared during bonding (which is normal and a requierment in ordre to resolve it), the stack will resolve the random resolvable addresses automatically. Unlike in the nRF5 SDK and SoftDevice, this is not visible outside of the stack.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501437?ContentTypeID=1</link><pubDate>Fri, 06 Sep 2024 00:55:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b4dc022-6b76-4c1c-bafb-3248c4fdec24</guid><dc:creator>Chaoyue Ying</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Does it mean that when application support bonded to mutiple device,it will use address to do any things like send data by gatt and so on?&lt;/p&gt;
&lt;p&gt;And by this way,peripheral how to identify mobile phone?Because my application with nRF SDK17 get the mobile phone address is a&amp;nbsp;variational random address.Therefore I used peer_id to identify everyone phone that connect with my application that developed with nRF SDK17.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NCS multiple connection and save bond information</title><link>https://devzone.nordicsemi.com/thread/501363?ContentTypeID=1</link><pubDate>Thu, 05 Sep 2024 12:21:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d5d0eca-b8a2-4a11-88b1-5eb84c467c52</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]If there have a peripheral sample support for multiple central?[/quote]
&lt;p&gt;There are samples that support being bonded to multiple device (that is just a matter of settng&amp;nbsp;CONFIG_BT_MAX_PAIRED to a high enough number for your requierments. I am not aware of a sammple that demonstrate multiple simultanious connections in the peripheral role. It is possible, though.&lt;/p&gt;
[quote user=""]How NCS realize saving bonding information and&amp;nbsp;distinguish different devices that bond with my board?[/quote]
&lt;p&gt;Bonds are stored in the internal flash with the settings page. You can iterate through bonds using &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/connectivity/bluetooth/api/gap.html#c.bt_foreach_bond"&gt;bt_foreach_bond()&lt;/a&gt;, this gives you the address of the bond which is how you refer to it.&lt;/p&gt;
[quote user=""]Whether NCS have a manager method like peer_id and I can get conn_handle by it?[/quote]
&lt;p&gt;No, it is a bit different. You iterate through the list and identify the peer by address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>