<?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>nRF52840 BLE Central - Not receiving some advertising packets</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69021/nrf52840-ble-central---not-receiving-some-advertising-packets</link><description>A few things to preface: 
 Hardware: nRF52840 Development Kit (PCA10056 - 2.0.1 - 2020.11) 
 Nordic SDK: nRF5_SDK_17.0.0_9d13099 
 Central example project I am using: nRF5_SDK_17.0.0_9d13099\examples\ble_central\ble_app_uart_c\pca10056\s140 
 Ble peripheral</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Dec 2020 00:04:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69021/nrf52840-ble-central---not-receiving-some-advertising-packets" /><item><title>RE: nRF52840 BLE Central - Not receiving some advertising packets</title><link>https://devzone.nordicsemi.com/thread/283679?ContentTypeID=1</link><pubDate>Tue, 08 Dec 2020 00:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c63f2005-b995-4966-97b2-5cc66bc0428a</guid><dc:creator>droberson</dc:creator><description>&lt;p&gt;Found the issue. One of our low-level BLE stack manager classes wasn&amp;#39;t saving off the data at pointer pBleEvt-&amp;gt;&lt;span&gt;evt.gap_evt.params.adv_report.&lt;/span&gt;&lt;b&gt;data&lt;/b&gt; and was just saving the pointer. So the data at the pointer was getting overwritten by the next packet before the application could process it.&lt;/p&gt;
&lt;p&gt;Thanks for your help in my understanding of advertising events!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Central - Not receiving some advertising packets</title><link>https://devzone.nordicsemi.com/thread/283295?ContentTypeID=1</link><pubDate>Fri, 04 Dec 2020 11:28:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b4c0f18-775a-47ae-8432-9e2ed7b603dc</guid><dc:creator>Edvin</dc:creator><description>[quote user="droberson"]1. How can I determine if an advertising packet received was due to a scan request / response?[/quote]
&lt;p&gt;&amp;nbsp;Try adding this to your BLE_GAP_EVT_ADV_REPORT:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;				case BLE_GAP_EVT_ADV_REPORT:
				    adv_type = p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.type;
				    NRF_LOG_INFO(&amp;quot;received sr:%d&amp;quot;, adv_type.scan_response);
			      break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It will print &amp;quot;received sr:1&amp;quot; if the adv report is a scan response, and &amp;quot;received sr:0&amp;quot; if it is not a scan response.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="droberson"]2. Any ideas as to why I would be seeing the ServiceData packets so infrequently (up to 2 minutes apart) within the firmware when compared to the Wireshark captures where they appear every 2 seconds consistently?[/quote]
&lt;p&gt;&amp;nbsp;Do you use the radio for anything else? E.g. connections, advertising, etc? What is the advertising interval on the peripheral? What is your scan interval and scan window on your central? Does it advertise as well? Are you in any connections? If so, what are the connection parameters?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Central - Not receiving some advertising packets</title><link>https://devzone.nordicsemi.com/thread/283190?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2020 17:11:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32825237-036c-4a97-a0d5-214e92c3bc3c</guid><dc:creator>droberson</dc:creator><description>&lt;p&gt;Hey Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for your response. I have a few updates so you don&amp;#39;t waste time investigating something I figured out:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Updates:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I now receive the expected ServiceData advertisement packet, it&amp;#39;s just very infrequent. Sometimes 2 minutes between receiving these packets. I had to set my scan interval == scan window to eventually see these.&lt;/p&gt;
&lt;p&gt;These are the two packets I am seeing in the&amp;nbsp;BLE_GAP_EVT_ADV_REPORT event for the BLE peripheral device I am interested in.&lt;/p&gt;
&lt;p&gt;1. Local Name (Device ID)&lt;/p&gt;
&lt;p&gt;15 09 38 38 39 31 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 -&amp;nbsp;BLE_GAP_AD_TYPE_COMPLETE_LOCAL_NAME&lt;br /&gt;02 0A 00 -&amp;nbsp;BLE_GAP_AD_TYPE_TX_POWER_LEVEL&lt;/p&gt;
&lt;p&gt;2. ServiceData&lt;/p&gt;
&lt;p&gt;02 01 06 - BLE_GAP_AD_TYPE_FLAGS&lt;br /&gt;03 02 FF 18 - BLE_GAP_AD_TYPE_16BIT_SERVICE_UUID_MORE_AVAILABLE&lt;br /&gt;0F 16 FF 18 85 01 00 93 15 64 0D B1 03 FC 20 F6 - BLE_GAP_AD_TYPE_SERVICE_DATA&lt;br /&gt;04 FF 0C 01 03 - BLE_GAP_AD_TYPE_MANUFACTURER_SPECIFIC_DATA&lt;br /&gt;03 34 FC 00 - CRC?&lt;/p&gt;
&lt;p&gt;I am starting to think the ServiceData is being received in the scan response, but I am not sure.&lt;/p&gt;
&lt;p&gt;Regarding your questions:&lt;/p&gt;
&lt;p&gt;Q: &amp;quot;&lt;span&gt;Have you tried to just print the entire advertisement in the advertising report?&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you mean just the advertising data or the entire&amp;nbsp;ble_gap_evt_adv_report_t structure? I have compared the advertising data as detailed in my parsing comments above.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Q: &amp;quot;Do you see the data that you are looking for? I am not sure whether the issue is that the advertising data is not present in the packet that you are checking, or whether there is something wrong with the way you parce the advertising packet.&lt;/span&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;It appears to me that the LOCAL NAME and SERVIC DATA advertising packets are coming in at different times with ServiceData being infrequent and inconsistent. I am suspecting that the ServiceData is sent by the peripheral device when it receives a scan request but this is just a guess at this point.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Questions:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1. How can I determine if an advertising packet received was due to a scan request / response?&lt;/p&gt;
&lt;p&gt;2. Any ideas as to why I would be seeing the ServiceData packets so infrequently (up to 2 minutes apart) within the firmware when compared to the Wireshark captures where they appear every 2 seconds consistently?&lt;/p&gt;
&lt;p&gt;I will do some more investigations&amp;nbsp;based on your response. I am still learning the advertising packet structure and what data is reported and when.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 BLE Central - Not receiving some advertising packets</title><link>https://devzone.nordicsemi.com/thread/283180?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2020 16:41:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b73a01fa-c4b4-4b49-a429-0eef904b85d6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1: Let me get back to that.&lt;/p&gt;
&lt;p&gt;2: The 60 bytes refers to the entire frame received by wireshark, which includes the serial data from the sniffer (advertising address and more). The advertising data is maximum 31 bytes. The nRF Sniffer does not combine the advertisement and scan response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;3: -&lt;/p&gt;
&lt;p&gt;4: it doesn&amp;#39;t do that.&lt;/p&gt;
&lt;p&gt;5: not necessarily, but every received scan response will result in it&amp;#39;s own advertising report.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Have you tried to just print the entire advertisement in the advertising report? Do you see the data that you are looking for? I am not sure whether the issue is that the advertising data is not present in the packet that you are checking, or whether there is something wrong with the way you parce the advertising packet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>