<?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>Bluetooth doesn&amp;#39;t reconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34120/bluetooth-doesn-t-reconnect</link><description>Hi, 
 I have modified nrf5-ble-mpu-data-ready-interrupts from nrf5-mpu-examples, the example works as expected. I have modified it a lot. 
 Now when I try to reconnect, it doesn&amp;#39;t connect and connecting icon appears on screen. I have tested on both Android</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 13 May 2018 11:38:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34120/bluetooth-doesn-t-reconnect" /><item><title>RE: Bluetooth doesn't reconnect</title><link>https://devzone.nordicsemi.com/thread/131767?ContentTypeID=1</link><pubDate>Sun, 13 May 2018 11:38:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f77c71fd-1e1e-4922-a0ae-1e7a8364a03e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;That error code can mean many things, I suggest that you search for &amp;quot;Error 133 (0x85): GATT ERROR&amp;quot; on google to see if any apply to you. If you want me to&amp;nbsp;look into this in more details I suggest you create a &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Sniffer"&gt;nRF sniffer&lt;/a&gt;&amp;nbsp;for a scenario that fails and one that works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth doesn't reconnect</title><link>https://devzone.nordicsemi.com/thread/131495?ContentTypeID=1</link><pubDate>Wed, 09 May 2018 11:54:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:186092cb-369b-4c05-abc5-f0c604c23906</guid><dc:creator>techteam1</dc:creator><description>&lt;p&gt;Thank you. I will look for it.&lt;/p&gt;
&lt;p&gt;In nRF Connect app it shows &amp;quot;Error 133 (0x85): GATT ERROR&amp;quot;&lt;/p&gt;
&lt;p&gt;It doesn&amp;#39;t advertise after disconnection. I even tried&amp;nbsp;&lt;span&gt;&amp;nbsp;closing the mobile application and tried scanning again, it didn&amp;#39;t show up.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Below is my&amp;nbsp;&lt;strong&gt;ble_evt_handler&lt;/strong&gt; function.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_evt_handler(ble_evt_t * p_ble_evt, void * p_context )//const * p_ble_evt, void * p_context)
{
    ret_code_t err_code = NRF_SUCCESS;

    switch (p_ble_evt-&amp;gt;header.evt_id)
    {
        case BLE_GAP_EVT_DISCONNECTED:
				
				NRF_LOG_INFO(&amp;quot;Disconnected.&amp;quot;);
				// LED indication will be changed when advertising starts.
			 //NRF_LOG_INFO(&amp;quot;Disconnected, reason 0x%x.&amp;quot;,p_gap_evt-&amp;gt;params.disconnected.reason);
							SEGGER_RTT_printf(0,&amp;quot;Disconnected\n&amp;quot;);
				
            break;

        case BLE_GAP_EVT_CONNECTED:
            NRF_LOG_INFO(&amp;quot;Connected.&amp;quot;);
				SEGGER_RTT_printf(0,&amp;quot;Connected..\n&amp;quot;);
            err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
            APP_ERROR_CHECK(err_code);
            m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
            break;

#ifndef S140
        case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            NRF_LOG_DEBUG(&amp;quot;PHY update request.&amp;quot;);
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_AUTO,
                .tx_phys = BLE_GAP_PHY_AUTO,
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
            APP_ERROR_CHECK(err_code);
        } break;
#endif

        case BLE_GATTC_EVT_TIMEOUT:
            // Disconnect on GATT Client timeout event.
            NRF_LOG_DEBUG(&amp;quot;GATT Client Timeout.&amp;quot;);
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_GATTS_EVT_TIMEOUT:
            // Disconnect on GATT Server timeout event.
            NRF_LOG_DEBUG(&amp;quot;GATT Server Timeout.&amp;quot;);
            err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,
                                             BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_EVT_USER_MEM_REQUEST:
            err_code = sd_ble_user_mem_reply(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle, NULL);
            APP_ERROR_CHECK(err_code);
            break;

        case BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST:
        {
            ble_gatts_evt_rw_authorize_request_t  req;
            ble_gatts_rw_authorize_reply_params_t auth_reply;

            req = p_ble_evt-&amp;gt;evt.gatts_evt.params.authorize_request;

            if (req.type != BLE_GATTS_AUTHORIZE_TYPE_INVALID)
            {
                if ((req.request.write.op == BLE_GATTS_OP_PREP_WRITE_REQ)     ||
                    (req.request.write.op == BLE_GATTS_OP_EXEC_WRITE_REQ_NOW) ||
                    (req.request.write.op == BLE_GATTS_OP_EXEC_WRITE_REQ_CANCEL))
                {
                    if (req.type == BLE_GATTS_AUTHORIZE_TYPE_WRITE)
                    {
                        auth_reply.type = BLE_GATTS_AUTHORIZE_TYPE_WRITE;
                    }
                    else
                    {
                        auth_reply.type = BLE_GATTS_AUTHORIZE_TYPE_READ;
                    }
                    auth_reply.params.write.gatt_status = APP_FEATURE_NOT_SUPPORTED;
                    err_code = sd_ble_gatts_rw_authorize_reply(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,
                                                               &amp;amp;auth_reply);
                    APP_ERROR_CHECK(err_code);
                }
            }
        } break; // BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST

        default:
            // No implementation needed.
            break;
    }
    
    ble_mpu_on_ble_evt(&amp;amp;m_mpu, p_ble_evt);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth doesn't reconnect</title><link>https://devzone.nordicsemi.com/thread/131378?ContentTypeID=1</link><pubDate>Tue, 08 May 2018 14:18:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0936288-ba86-4418-9727-bd0c5d3a3da1</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;It may be many things that occur here, but you should make sure that&amp;nbsp;after you disconnect, then the periheral will start advertising again. You should also check if you have any asserts in your application,&amp;nbsp;an assert will typically trigger&amp;nbsp;app_error_handler(),&amp;nbsp;thereby you&amp;nbsp;should be able to see where it asserts and based on the error code be able to fix the issue. Logging all the BLE events to for instance UART may also be good idea, for instance to see if there is any events that are not handled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>