<?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 Connection strategy</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/100356/ble-connection-strategy</link><description>Hello. 
 I have a device (peripheral) with no input / no output capabilities that I want to connect to from a iOS device (central). Still I want the highest security I can get. So Just-works in LE Secure connection mode seems secure enough. But to increase</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 13 Jun 2023 14:03:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/100356/ble-connection-strategy" /><item><title>RE: BLE Connection strategy</title><link>https://devzone.nordicsemi.com/thread/430795?ContentTypeID=1</link><pubDate>Tue, 13 Jun 2023 14:03:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08595a95-9943-440e-96b1-e076cc3a3aa0</guid><dc:creator>mcan</dc:creator><description>&lt;p&gt;Ahh, (for reference), my mistake were that I hadn&amp;#39;t configured the&amp;nbsp;CONFIG_BT_PRIVACY flag.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Connection strategy</title><link>https://devzone.nordicsemi.com/thread/429058?ContentTypeID=1</link><pubDate>Fri, 02 Jun 2023 16:14:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12a27e6c-e00a-4ca8-a74b-d9f5f254b460</guid><dc:creator>mcan</dc:creator><description>&lt;p&gt;Thanks! This seems to work quite nice!&lt;/p&gt;
&lt;p&gt;One thing that doesn&amp;#39;t seem to work though, the iOS device has privacy, and after address change the peripheral doesn&amp;#39;t seem to recognize the device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Connection strategy</title><link>https://devzone.nordicsemi.com/thread/428984?ContentTypeID=1</link><pubDate>Fri, 02 Jun 2023 11:35:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04c4bcb4-b828-4e5f-9f77-ce28f80b116f</guid><dc:creator>SwRa</dc:creator><description>&lt;p&gt;Hi Markus,&lt;/p&gt;
&lt;p&gt;I think this would be something that you could consider:&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/bluetooth/peripheral_accept_list"&gt;https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/bluetooth/peripheral_accept_list&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Swathy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Connection strategy</title><link>https://devzone.nordicsemi.com/thread/428817?ContentTypeID=1</link><pubDate>Thu, 01 Jun 2023 16:22:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79192536-eab0-4d57-9741-0af2cc4e353e</guid><dc:creator>mcan</dc:creator><description>&lt;p&gt;So my first attempt was to just turn on and off the advertisement, but as I said I need to be able to reconnect without any user input.&lt;br /&gt;Button press + 2 min: advertising.&lt;br /&gt;Other: advertising off.&lt;/p&gt;
&lt;p&gt;Next attempt was to try make the peripheral &amp;quot;invisible&amp;quot; by using non-discoverable, limited-discoverable etc. That didn&amp;#39;t work because iOS didn&amp;#39;t care about that and showed the peripheral whatever discoverable mode it had.&lt;br /&gt;Button press + 2 min: advertising limited- (or general-) discoverable&lt;br /&gt;Other: advertising non-discoverable&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;m trying directed connectable instead.&lt;br /&gt;Button press + 2 min: advertising general discoverable, connectable. (on connection save currently connected device)&lt;br /&gt;Other: advertising, directed connectable (last saved current device)&lt;br /&gt;Result: I&amp;#39;m not sure if this works because I get a -5 (I/O error) when trying to start the advertising (something like this):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;err = bt_le_ext_adv_create(BT_LE_ADV_CONN_DIR_LOW_DUTY(bt_conn_get_dst(current_conn)), NULL, &amp;amp;adv_set);
if (err) {
    LOG_ERR(&amp;quot;Create extended advertising set_id failed (err %d).&amp;quot;, err);
    return err;
}
err = bt_le_ext_adv_set_data(adv_set, ad_non_discoverable, ARRAY_SIZE(ad_non_discoverable), sd, ARRAY_SIZE(sd));
if (err) { // &amp;lt;&amp;lt;&amp;lt;--- This is where it fails
    LOG_ERR(&amp;quot;Failed to set advertising data (%d).&amp;quot;, err);
    return err;
}
err = bt_le_ext_adv_start(adv_set, NULL);
if (err) {
    LOG_ERR(&amp;quot;Extended advertising failed to start (err %d).&amp;quot;, err);
    return err;
}
LOG_INF(&amp;quot;Directed advertising successfully started&amp;quot;);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Took inspiration from these two threads (that pointed out that I need to use the extended API):&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/95751/how-to-use-directed-advertising-high-duty-cycle-in-zephyr-development"&gt;How to use Directed advertising (high duty cycle) in Zephyr development?&lt;/a&gt;&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/84756/directed-advertising-not-seen-by-the-addressed-device"&gt;Directed Advertising not seen by the addressed device&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Worst part is that I&amp;#39;m not even sure that if I get the working, I&amp;#39;m not sure this is a viable solution for my problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>