<?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>DFU in nRF Toolbox on iOS won&amp;#39;t reconnect if in non-encrypted connection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11018/dfu-in-nrf-toolbox-on-ios-won-t-reconnect-if-in-non-encrypted-connection</link><description>Hi, 
 I am trying to update some code to the last SDK and softdevice. When I trying to perform a DFU update using the iOS app nRF Toolbox on my iPad the device will not reconnect after entering the bootloader mode, although I can see that it is advertising</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Jan 2016 12:55:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11018/dfu-in-nrf-toolbox-on-ios-won-t-reconnect-if-in-non-encrypted-connection" /><item><title>RE: DFU in nRF Toolbox on iOS won't reconnect if in non-encrypted connection</title><link>https://devzone.nordicsemi.com/thread/41213?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2016 12:55:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfabf537-e450-4315-90e0-976d626902bd</guid><dc:creator>Ignacio Lopez</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;I am using a non-encrypted connection. No bonding information is shared. The device enters the bootloader mode correctly and starts advertising as &amp;#39;DFUTarg&amp;#39;, but the nRF Toolbox will not reconnect. I can see the device on the MCP advertising as in the image attached.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2313.MCP.png" alt="DFUTarg on MCP" /&gt;&lt;/p&gt;
&lt;p&gt;The bootloader code will advertise as Connectable undirected and LE General Discoverable Mode if there is no bonding information (m_ble_peer_data_valid is false). I consider this is correct, the problem is that the app nRF Toolbox under DFU will not reconnect to the device, so it is needed to select the device again (this time around selected as &amp;#39;DFUTarg&amp;#39;). Please have a close look at this last step.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void advertising_start(void)
{
    if (!m_is_advertising)
    { 
       uint32_t err_code;

        // Initialize advertising parameters (used when starting advertising).
        memset(&amp;amp;m_adv_params, 0, sizeof(m_adv_params));

        if (m_ble_peer_data_valid)
        {
						SEGGER_RTT_WriteString(0, &amp;quot;Peer Valid Data\n&amp;quot;);
            ble_gap_irk_t empty_irk = {{0}};

            if (memcmp(m_ble_peer_data.irk.irk, empty_irk.irk, sizeof(empty_irk.irk)) == 0)
            {
                advertising_init(BLE_GAP_ADV_FLAGS_LE_ONLY_LIMITED_DISC_MODE);
                m_adv_params.type        = BLE_GAP_ADV_TYPE_ADV_DIRECT_IND;
                m_adv_params.p_peer_addr = &amp;amp;m_ble_peer_data.addr;
                m_adv_params.fp          = BLE_GAP_ADV_FP_ANY;
                m_adv_params.interval    = 0;
                m_adv_params.timeout     = 0;
            }
            else
            {
                ble_gap_irk_t  * p_irk[1];
                ble_gap_addr_t * p_addr[1];

                p_irk[0]  = &amp;amp;m_ble_peer_data.irk;
                p_addr[0] = &amp;amp;m_ble_peer_data.addr;

                ble_gap_whitelist_t whitelist;
                whitelist.addr_count = 1;
                whitelist.pp_addrs   = p_addr;
                whitelist.irk_count  = 1;
                whitelist.pp_irks    = p_irk;

                advertising_init(BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED);
                m_adv_params.type        = BLE_GAP_ADV_TYPE_ADV_IND;
                m_adv_params.fp          = BLE_GAP_ADV_FP_FILTER_CONNREQ;
                m_adv_params.p_whitelist = &amp;amp;whitelist;
                m_adv_params.interval    = APP_ADV_INTERVAL;
                m_adv_params.timeout     = APP_ADV_TIMEOUT_IN_SECONDS;
            }
        }
        else
        {
						SEGGER_RTT_WriteString(0, &amp;quot;No Peer Valid Data\n&amp;quot;);
            advertising_init(BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE);
            m_adv_params.type        = BLE_GAP_ADV_TYPE_ADV_IND;
            m_adv_params.p_peer_addr = NULL;
            m_adv_params.fp          = BLE_GAP_ADV_FP_ANY;
            m_adv_params.interval    = APP_ADV_INTERVAL;
            m_adv_params.timeout     = APP_ADV_TIMEOUT_IN_SECONDS;
        }

        err_code = sd_ble_gap_adv_start(&amp;amp;m_adv_params);
        APP_ERROR_CHECK(err_code);

        nrf_gpio_pin_clear(ADVERTISING_LED_PIN_NO);
				
				SEGGER_RTT_WriteString(0, &amp;quot;Start Advertising\n&amp;quot;);

        m_is_advertising = true;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU in nRF Toolbox on iOS won't reconnect if in non-encrypted connection</title><link>https://devzone.nordicsemi.com/thread/41214?ContentTypeID=1</link><pubDate>Tue, 29 Dec 2015 12:46:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:334d5c06-4f4f-4c61-96b1-6a086bff6459</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Are you using device manager and sharing bonding information with the bootloader, i.e. have added dfu_app_handler.c to your application? If so the bootloader must use  directed advertising or whitelist advertising in order to reconnect.&lt;/p&gt;
&lt;p&gt;If bonding information is not shared, then directed advertising must be used, please refer &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v9.0.0/bledfu_appbonding.html"&gt;this&lt;/a&gt;Infocenter page.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>