<?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>why sometimes the nrf_ble_gatt_on_ble_evt function can&amp;#39;t trigger?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43745/why-sometimes-the-nrf_ble_gatt_on_ble_evt-function-can-t-trigger</link><description>I used the nrf52840 as the central device, use SDK15.0, scan then connect the peripheral toys. 
 sometimes i found the central can scanned some ble peripheral but can&amp;#39;t connected them. 
 I trace it found at this time the nrf_ble_gatt_on_ble_evt can&amp;#39;t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Feb 2019 09:01:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43745/why-sometimes-the-nrf_ble_gatt_on_ble_evt-function-can-t-trigger" /><item><title>RE: why sometimes the nrf_ble_gatt_on_ble_evt function can't trigger?</title><link>https://devzone.nordicsemi.com/thread/172961?ContentTypeID=1</link><pubDate>Tue, 26 Feb 2019 09:01:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9a476ef-5ad6-4d04-80fc-7add7330b288</guid><dc:creator>zk017</dc:creator><description>&lt;p&gt;Thank you very much! I have solved it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why sometimes the nrf_ble_gatt_on_ble_evt function can't trigger?</title><link>https://devzone.nordicsemi.com/thread/172643?ContentTypeID=1</link><pubDate>Sun, 24 Feb 2019 13:13:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dea809e-4348-436a-833e-c04d67498021</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;It seems like the error happens on the peripheral side, since&amp;nbsp;&lt;span&gt;sd_ble_gap_connect() returns&lt;/span&gt;&amp;nbsp;NRF_SUCCESS, which means that a connection procedure is successfully initiated by the central device.&lt;/p&gt;
&lt;p&gt;Are you able to access the source code of the peripherals or debug it? Do you have any information about the peripheral devices you are trying to connect to? Maybe there are some filtering or whitelisting that makes it reject the connection request sent from the central device.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why sometimes the nrf_ble_gatt_on_ble_evt function can't trigger?</title><link>https://devzone.nordicsemi.com/thread/172030?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 08:14:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4c85bef-759b-4f59-84e8-dddd28d03728</guid><dc:creator>zk017</dc:creator><description>&lt;p&gt;hi, Simon, thanks very much for your kindly reply!&lt;/p&gt;
&lt;p&gt;I trace the code function on_adv_report() and found&amp;nbsp; it can get advertise data, the sd_ble_gap_connect() return code is NRF_SUCCESS, but the next event BLE_GAP_EVT_CONNECTED havn&amp;#39;t occur in the&amp;nbsp;on_ble_evt() function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: why sometimes the nrf_ble_gatt_on_ble_evt function can't trigger?</title><link>https://devzone.nordicsemi.com/thread/171409?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 14:02:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44aea87d-376e-468b-9bda-1846fbfb6527</guid><dc:creator>Simon</dc:creator><description>&lt;p&gt;It would be nice with some more information. Which example in the SDK are you using? Some debug logging would also be helpful.&lt;/p&gt;
&lt;p&gt;You said that&amp;nbsp;&lt;em&gt;nrf_ble_gatt_on_ble_evt(..)&amp;nbsp;&lt;/em&gt;is&amp;nbsp;not called, and a reason for this may be that the devices never connects and a&amp;nbsp;BLE_GAP_EVT_CONNECTED event is never generated.&lt;/p&gt;
&lt;p&gt;In order to locate the problem you would have to look somewhere else. First you could try setting a break point inside the function&amp;nbsp;&lt;em&gt;nrf_ble_scan_on_adv_report(..)&amp;nbsp;&lt;/em&gt;to see if the device actually receives the advertising packets. If it does, then you could check if the function&amp;nbsp;&lt;em&gt;nrf_ble_scan_connect_with_target(..)&amp;nbsp;&lt;/em&gt;is called. Eventually, if everything is all good up until this point, check if&amp;nbsp;&lt;em&gt;sd_ble_gap_connect(..)&amp;nbsp;&lt;/em&gt;is called and if the value of the error code&amp;nbsp;is equal to&amp;nbsp;BLE_GAP_EVT_CONNECTED.&lt;/p&gt;
&lt;p&gt;I just realized that it may save you time to perform these step in the opposite order.&lt;/p&gt;
&lt;p&gt;When you have done this, and if you are still stuck, please ask and I will help you further.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>