<?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>how to autoconnect with the bonded smartphone</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56365/how-to-autoconnect-with-the-bonded-smartphone</link><description>hi ,,, nrf52832 , at first for bonding i will connect my device manually by scanning and after passing the data to flash , i will disconnect . in program i have set the timer , if it 20 mins , it should auto connect to the phone app (which is bonded previously</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Jan 2020 07:07:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56365/how-to-autoconnect-with-the-bonded-smartphone" /><item><title>RE: how to autoconnect with the bonded smartphone</title><link>https://devzone.nordicsemi.com/thread/229148?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2020 07:07:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7971446e-de47-4887-9627-3194b40f53c6</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;What error code are you getting?&lt;/p&gt;
&lt;p&gt;Not sure I would do all of this in the&amp;nbsp; timer handler. Try to only start adveertising. Then start to send data after the connection is established and notification has been enabled. Similar to what we do in most/all our examples. i.e. I look at one of the simper examples such as ble_app_uart.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to autoconnect with the bonded smartphone</title><link>https://devzone.nordicsemi.com/thread/228469?ContentTypeID=1</link><pubDate>Fri, 10 Jan 2020 05:58:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8403ddf-c05f-4283-ab9b-3bdc74263010</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;how to do that ? which one command is used to connect to peer device , for disconnect&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION); please have a look at below code , i am advertising after 20 minutes , after connect and i am getting fatal error&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void timer_sensor_event_handler(void)
{
    advertising_start();
    if(connected==true)
    {
nrf_gpio_pin_toggle(19);
ret_code_t err_code= ble_nus_data_send(&amp;amp;m_nus,&amp;quot;hello&amp;quot;,25,m_conn_handle);
nrf_delay_ms(10000);
    err_code = sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
}
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to autoconnect with the bonded smartphone</title><link>https://devzone.nordicsemi.com/thread/228341?ContentTypeID=1</link><pubDate>Thu, 09 Jan 2020 12:15:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7052cb85-5b2c-4f57-816a-f1a89c7ec0ae</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Not much you can do on the peripheral side. Just make sure you start advertising again after 20 minuttes. If this is a service that is natively supported by the peer (bonded smartphone) it would normally autoconnect. If it is not natively supported by the peer, your phone application will have to enable autoreconnect / background scanning.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>