<?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>Devices not in whitelist receiving connected event before being rejected</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/97264/devices-not-in-whitelist-receiving-connected-event-before-being-rejected</link><description>nRF Connect SDK Version: 2.0.2 
 Network core image: hci_rpmsg 
 I have an nRF5340 device acting as a peripheral. When I initialize advertising with the BT_LE_ADV_OPT_FILTER_CONN flag set and a single address in the filter accept list, a second nRF5340</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 05 Mar 2023 03:41:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/97264/devices-not-in-whitelist-receiving-connected-event-before-being-rejected" /><item><title>RE: Devices not in whitelist receiving connected event before being rejected</title><link>https://devzone.nordicsemi.com/thread/413375?ContentTypeID=1</link><pubDate>Sun, 05 Mar 2023 03:41:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:328db34f-d566-4488-b318-acde357a3552</guid><dc:creator>Emil Lenngren</dc:creator><description>&lt;p&gt;I assume you&amp;#39;re using legacy advertising (ADV_IND from the peripheral, CONNECT_IND from the central). In this case, there is no acknowledgement from the peripheral that it has accepted a connection. Instead, per the specification, the central shall exit the initiating state and enter the connected state as soon as it has sent the CONNECT_IND packet. The connection will instead time out after six missed connection events with the error code &amp;quot;0x3e connection failed to be established&amp;quot;. Note that this error code doesn&amp;#39;t necessarily mean the connection was rejected; if the CONNECT_IND is lost in the air, e.g. due to a simultaneous SCAN_REQ from another central, the same error will happen.&lt;/p&gt;
&lt;p&gt;This issue has in some sense been &amp;quot;fixed&amp;quot; in Bluetooth 5.0 with the new extended advertising, which uses the sequence ADV_EXT_IND, AUX_ADV_IND, AUX_CONNECT_REQ, AUX_CONNECT_RSP. Here, the AUX_CONNECT_REQ is sent by the central and the other packets by the peripheral. The last packet gives the peripheral a chance to accept and acknowledge the connection. First when it&amp;#39;s acknowledged, the central will report the connection as complete to its host. This way &amp;quot;connect disconnect loops&amp;quot; can be avoided, but the host running on the central will not be notified when a connection has been rejected.&lt;/p&gt;
&lt;p&gt;So when you start advertising, make sure you use the new extended advertising feature. Note that this of course requires support from the central, so no BT 4 centrals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Devices not in whitelist receiving connected event before being rejected</title><link>https://devzone.nordicsemi.com/thread/413287?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2023 14:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8081bbe-f9af-4bb6-b310-4d7eedc530f9</guid><dc:creator>rberekson</dc:creator><description>&lt;p&gt;Einar,&lt;/p&gt;
&lt;p&gt;Thank you for the clarification. This is the behavior I am seeing, so I can figure out how to work with this for my use case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Devices not in whitelist receiving connected event before being rejected</title><link>https://devzone.nordicsemi.com/thread/413283?ContentTypeID=1</link><pubDate>Fri, 03 Mar 2023 14:16:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af39b39e-1275-4b83-9f48-e02587221c33</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, this is&amp;nbsp;expected behavior. There is no way to rejected a connection attempt in Bluetooth, so when a central that is not in the whitelist attempts to connect, the peripheral simply ignores it. And moreover, from the central perspective, the connection has started when the connection indication is sent. However, there is a short timeout before the first packet has been acknowledged by the peer, so you will get a disconnect with reason&amp;nbsp;0x3E, which means that the connection failed to be established.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>