<?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>BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82936/ble-automatic-connection-to-other-ble-device</link><description>Hello 
 I&amp;#39;m using multiple nRF52840-dk (SDK17.1.0, Windows, Segger, S140). 
 I&amp;#39;m trying to make BLE device(nRF52840-dk) that automatically connects to specific BLE device (nRF52840-dk) whenever it turns on without connecting to other devices. 
 Is there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Jan 2022 10:26:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82936/ble-automatic-connection-to-other-ble-device" /><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/346883?ContentTypeID=1</link><pubDate>Mon, 10 Jan 2022 10:26:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a4f5955-ca40-4ac5-ada7-e6c1c7f77230</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;It will do so by default. If it doesn&amp;#39;t have any devices in the whitelist, it will advertise without the whitelist, accepting any connections. When bonded, it will add the device in the whitelist. The next time it starts advertising scanning, it will use the whitelist unless you specify it to not do so, which means it will only connect to the device in the whitelist.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/346576?ContentTypeID=1</link><pubDate>Fri, 07 Jan 2022 01:21:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d9040de-cfcd-407d-a6a2-3ffcf5c45279</guid><dc:creator>June20</dc:creator><description>&lt;p&gt;Thanks for the info.&lt;/p&gt;
&lt;p&gt;Sorry for asking the same question again, what I really wanted ask was how to&amp;nbsp;make device have only one bonding (or have 1 whitelist) so that it will reject other connection attempt.&lt;/p&gt;
&lt;p&gt;What should I modify for central(nRF52840 DK) so that it will accept only one peripheral(nRF52833 DK)?&lt;/p&gt;
&lt;p&gt;Also to peripheral(nRF52833 DK) so that it will reject other centrals(nRF52840 DK) after bonding?&lt;/p&gt;
&lt;p&gt;Will&amp;nbsp; setting one whitelist do the trick? And how?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/346513?ContentTypeID=1</link><pubDate>Thu, 06 Jan 2022 14:14:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2b0f268-c263-4977-a438-4aec5ed8c6d4</guid><dc:creator>Edvin</dc:creator><description>[quote user="June20"]I came across Central_Link_Count and Peripheral_Link_Count in sdk_config.h[/quote]
&lt;p&gt;No, they refer to how many simultaneous connections youn can maintain (be connected to at once). It has nothing to do with bonding.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I remembered wrong. It is the peripheral (ble_app_hrs) example that requests the bonding in these two examples. But it should be perfectly fine to do so from the central as well. Just call&amp;nbsp;&lt;span&gt;pm_conn_secure() from the BLE_GAP_EVT_CONNECTED event in main.c.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;These examples show you how they will add the bonded device to their whitelist, so that the next time they advertise/scan, then they will only accept connections to eachother, unless you temporary disables the whitelist, or deletes the bonding information.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Edvin&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/346455?ContentTypeID=1</link><pubDate>Thu, 06 Jan 2022 12:14:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e17f1f4d-b3ae-4526-b466-4a45c292231d</guid><dc:creator>June20</dc:creator><description>&lt;p&gt;Hello! Sorry for taking so long, I finally ported HRS into nRF52833 and successfully connected with HRS_C.&lt;/p&gt;
&lt;p&gt;We&amp;#39;re trying to use bonding so that only one central(nRF52840 DK) and one peripheral(nRF52833 DK) connects to each other.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For example: we have many centrals (nRF52840 DK) and many peripherals (nRF5833 DK). Once Central_1 and Peripheral_1 is bonded, Central_1 cannot connect with Peripheral_2 or Central_2 cannot connect with Peripheral_1.&lt;/p&gt;
&lt;p&gt;What configuration should I touch/modify?&lt;/p&gt;
&lt;p&gt;I came across Central_Link_Count and Peripheral_Link_Count in sdk_config.h. Do they just mean how many central/peripheral they can connect/store or are there more? Should I put 1 each for both central and peripheral?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/346063?ContentTypeID=1</link><pubDate>Wed, 05 Jan 2022 08:54:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ec46248-ecda-4030-ae49-d5197074dd01</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes. The RAM start and size depends on your BLE setup (number of services/characteristics, number of connections, MTU size, etc.) so you may need to change this in the future as well. Just monitor the log to see what it should be set to.&amp;nbsp;&lt;/p&gt;
[quote user="June20"]My question is: is LESC necessary for bonding?[/quote]
&lt;p&gt;No. You can use e.g. Just works.If you like.&amp;nbsp;&lt;/p&gt;
[quote user="June20"]I came across cryptp CC310 in sdk_config.h and it says this crypto is only supported in nRF52840. Is CC310 necessary for LESC or bonding?[/quote]
&lt;p&gt;No, you should disable it in sdk_config if you are using the nRF52833. You can use&amp;nbsp;NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED instead of&amp;nbsp;NRF_CRYPTO_BACKEND_CC310_ENABLED.&lt;/p&gt;
[quote user="June20"]Is&amp;nbsp;PM_LESC_ENABLED and&amp;nbsp;NRF_BLE_LESC_ENABLED related?[/quote]
&lt;p&gt;I believe that NRF_BLE_LESC_ENABLED needs to be set if you want to set PM_LESC_ENABLED. I haven&amp;#39;t tested. Try to search for PM_LESC_ENABLED and NRF_BLE_LESC_ENABLED in the unmodified pca10056 example to see where it is used.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/346031?ContentTypeID=1</link><pubDate>Wed, 05 Jan 2022 07:43:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea13c45-576b-4949-872d-a9faf5a9ee28</guid><dc:creator>June20</dc:creator><description>&lt;p&gt;Thanks, I managed to build successfully built hrs example on nRF52833-DK. (Just in case for other readers, RAM_START is a little different, error message will tell you where it starts)&lt;/p&gt;
&lt;p&gt;Problem is that I got stuck at&amp;nbsp;peer_manager_init&amp;gt;pm_init&amp;gt;sm_init&amp;gt; nrf_ble_lesc_init&amp;gt;memset((void *) m_peer_keys, 0, sizeof(m_peer_keys));. (error does not display, I end up in HardFault_Handler.).&lt;/p&gt;
&lt;p&gt;One of our coworker managed to make it run, but eventually get into error during ble connection.(sorry for lack of error message, will try his code later)&lt;/p&gt;
&lt;p&gt;My question is: is LESC necessary for bonding?&lt;/p&gt;
&lt;p&gt;I came across cryptp CC310 in sdk_config.h and it says this crypto is only supported in nRF52840. Is CC310 necessary for LESC or bonding?&lt;/p&gt;
&lt;p&gt;Is&amp;nbsp;PM_LESC_ENABLED and&amp;nbsp;NRF_BLE_LESC_ENABLED related?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/345623?ContentTypeID=1</link><pubDate>Mon, 03 Jan 2022 10:37:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:16550808-1e8f-43fa-aad0-8edf9336a0f5</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;If it is stuck in 0x0A60, it is stuck in the hardfault handler. Probably related to some memory mapping or wrong device config.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I suggest that you start with a pca10100 project, and then add the peer manager like it is done in the ble_app_hrs_c example.&lt;/p&gt;
&lt;p&gt;If you really need to port the pca10056 to the pca10100, then open another pca10100 project, and make sure that the settings that you change look similar:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641205965229v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641206008888v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641206067204v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1641206189694v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I think those should cover it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/344702?ContentTypeID=1</link><pubDate>Wed, 22 Dec 2021 01:29:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caadc60f-f3c0-4c34-a58c-989664595488</guid><dc:creator>June20</dc:creator><description>&lt;p&gt;Any tutorial for porting? Based on your answer, SW or application shouldn&amp;#39;t be a issue.&lt;/p&gt;
&lt;p&gt;I tried modifying RAM and FLASH in SECTION PLACEMENT MACROS and change nRF52840 and pca10056 into nRF52833 and pca10100 in solution editor (&amp;lt;/&amp;gt;). Building seems ok but running part is kinda stuck at &amp;quot;unknown fuction at 0x00000A60&amp;quot;.&lt;/p&gt;
&lt;p&gt;Are there other things I should modify?&lt;/p&gt;
&lt;p&gt;Happy Holiday.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/344623?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 14:11:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a26aea7-bd56-42d1-a134-97828b45344c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Sorry, it doesn&amp;#39;t look like we have any other samples that does bonding as a central, and it doesn&amp;#39;t look like we have that sample for the nRF52833. It should be possible to port it yourself. Just copy the project folder pca10056, name it pca10100, and look at the settings in the project. You would typically want to change everything that says 52840 to 52833, and adjust the memory areas.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have time for that right now, because of low staffing due to the Christmas holidays, and I am leaving for holidays myself tomorrow.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Either try this approach, or you can start with an example that you imagine you would want to use in your final application, and implement the peer manager to that example, and perform the bonding like it is done in the ble_app_hrs_c example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;PS: We are very short staffed for the Christmas Holidays. I will go on vacation tomorrow, and I will be back in January.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/344524?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 09:28:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9fcea4b-6976-4999-979a-d5688ac0c641</guid><dc:creator>June20</dc:creator><description>&lt;p&gt;Thank you so much for the reply.&lt;/p&gt;
&lt;p&gt;Sorry for the change, I had to switch peripheral device into nRF52833-DK but I couldn&amp;#39;t find ble_app_hrs example for the device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are&amp;nbsp;there other example recommendation for&amp;nbsp; bonding and pairing with nRF52840-DK central and nRF52833-DK peripheral?&lt;/p&gt;
&lt;p&gt;Thank you in advance.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;PS I tried copy pasting ble_app_hrs example from nRF52840 S140 to other nRF52833 example. I could build it but couldn&amp;#39;t run it (got&amp;nbsp;hard fault error). hids keyboard and mouse seems great but I couldn&amp;#39;t find good central example to connect it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE automatic connection to other BLE device</title><link>https://devzone.nordicsemi.com/thread/344389?ContentTypeID=1</link><pubDate>Mon, 20 Dec 2021 13:53:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00db7611-43ca-4ef0-bb94-a17bb98b557e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;This is a bit up to your application. As you mentioned, the filters that are used can be used to search for particular devices. Either a specific UUID, an advertising name, or a BLE address.&lt;/p&gt;
&lt;p&gt;On the other side you have bonding (pairing = encryption, bonding = storing pairing data for later use). When you bond, you store bonding data for a particular device, so even if a similar device is nearby, it will only connect to the already bonded device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suggest that you look into the ble_app_hrs and ble_app_hrs_c examples if you are interrested in bonding. The data is stored by the peer manager in something called FDS (flash Data Storage), but it is not straight forward to see how it is done. The basic information that is stored is the address of the bonded device, and the keys that are used for encryption. This goes both ways, so if only one of the devices have the correct key, they will not be able to connect (security measure). The easiest way to bond two devices is to let them connect and bond like it is done in the ble_app_hrs_c example. Then they will look for one another the next time they are turned on.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On the other hand, if you don&amp;#39;t need the security of bonding, you can try to add a filter on the BLE address (this is unique on all devices), and only connect if the advertisement comes from the address that you are looking for.You can do this either by adding the address to a whitelist, like the hrs examples does, or by manually checking the advertising packet and connect if you see that it is coming from the correct device. You can add the&amp;nbsp;BLE_GAP_EVT_ADV_REPORT event to the ble_evt_handler() in main.c to experiment and see what the advertisement looks like. It will trigger whenever you are scanning an advertisement packet.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>