<?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>fatal error in the BLE observers</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80985/fatal-error-in-the-ble-observers</link><description>Hello, new-to-this platform dev here! 
 I am implementing BLE bonding on my nRF52840 DK, which uses the S140 Softdevice. The DK is a peripheral and I&amp;#39;m using version 17.1 of the SDK. I adapted most of the peer_manager/whitelist code from the ble_peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Oct 2021 13:12:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80985/fatal-error-in-the-ble-observers" /><item><title>RE: fatal error in the BLE observers</title><link>https://devzone.nordicsemi.com/thread/335758?ContentTypeID=1</link><pubDate>Mon, 25 Oct 2021 13:12:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bee5d14-90b0-4758-9d5b-847a320f01ec</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello null handle,&lt;br /&gt;&lt;br /&gt;I am glad to hear that you were able to resolve the issue yourself so quickly. Thank you for sharing your solution here with us along with the discussion you found useful, so that other forum goers may see it in the future! :)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;For the record, it is very helpful to make sure that you have DEBUG defined in your preprocessor defines, like shown in the included image, in order to have the logger output a detailed error message whenever a non-NRF_SUCCESS error is passed to an APP_ERROR_CHECK. This makes the debugging of failed sd_ and nrfx_ function calls much easier.&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4478.enabling_5F00_debug_5F00_SES.PNG" /&gt;&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open another ticket if you should encounter any issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fatal error in the BLE observers</title><link>https://devzone.nordicsemi.com/thread/335602?ContentTypeID=1</link><pubDate>Mon, 25 Oct 2021 00:58:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2d4e6a8-4ac8-4fdb-8956-6d73051de6ef</guid><dc:creator>null handle</dc:creator><description>&lt;blockquote&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;I am implementing BLE bonding on my nRF52840 DK, which uses the S140 Softdevice. The DK is a peripheral and I&amp;#39;m using version 17.1 of the SDK. I adapted most of the peer_manager/whitelist code from the ble_peripheral hci keyboard sample. However, I&amp;#39;d like to implement some special logic to allow only the first device to be bonded with my nRF52840 to talk to it, and to reject pairing/bonding attempts from other devices.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;So I made this waaaaay more complicated than it needed to be. I would up implementing this feature by:&lt;/span&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;In my advertising_init, setting init.&lt;span class="pl-smi"&gt;config&lt;/span&gt;.&lt;span class="pl-smi"&gt;ble_adv_whitelist_enabled&lt;/span&gt;&amp;nbsp;to true&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;In my peer_manager event handler, I handled the&amp;nbsp;PM_EVT_PEER_DATA_UPDATE_SUCCEEDED event to add the new peer to my whitelist.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="font-size:inherit;"&gt;In my advertising event handler, handled the&amp;nbsp;BLE_ADV_EVT_WHITELIST_REQUEST event to send a&amp;nbsp;ble_advertising_whitelist_reply().&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;This works because the advertising module disregards the whitelist when the whitelist is empty. This allows the first central device to make the connection, pair/bond, and get added to the peer list. This trips&amp;nbsp;PM_EVT_PEER_DATA_UPDATE_SUCCEEDED and gets the new peer added to the whitelist. Now that the whitelist is nonempty, when advertising resumes it will get used, preventing other central devices from connecting. Using my reset button will clear my bond and whitelist data and put advertising back into its initial state.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;I found this discussion useful:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/73467/whitelist-set-but-not-automatically-restarted"&gt;devzone.nordicsemi.com/.../whitelist-set-but-not-automatically-restarted&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: fatal error in the BLE observers</title><link>https://devzone.nordicsemi.com/thread/335573?ContentTypeID=1</link><pubDate>Sat, 23 Oct 2021 19:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43ba5937-0513-402a-95de-b1a27a68fa57</guid><dc:creator>null handle</dc:creator><description>&lt;p&gt;I seem to have gotten rid of my APP_ERROR. But I am still having problems detecting when I&amp;#39;ve already entered a central device to the whitelist at the BLE connected event message level.&lt;/p&gt;
&lt;p&gt;I take the address in&amp;nbsp;p_ble_evt-&amp;gt;evt.gap_evt.params.connected.peer_addr and check it against the contents of the whitelist_addrs returned by pm_whitelist_get(). My central device sends the same peer_addr every time, but that&amp;#39;s not what I see in the whitelist.&lt;/p&gt;
&lt;p&gt;I set the whitelist with the results of a call to pm_peer_id_list()&amp;nbsp; in the PM_EVT_PEER_DATA_UPDATE_SUCCEEDED event. The peer_id is a unsigned 16-bit number.&lt;/p&gt;
&lt;p&gt;How can I take a ble_gap_add_t and map it to whatever is in the whitelist?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>