<?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>For 128bit UUID filter p_adv_report-&amp;gt;data.p_data is updated differently for different tags.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62625/for-128bit-uuid-filter-p_adv_report--data-p_data-is-updated-differently-for-different-tags</link><description>I have two beacons which are UUID filtered successfully. 
 I am trying to fetch major but this cannot be done just by putting an offset to p_adv_report-&amp;gt;data.p_data. I noticed that for different tags the p_data does not always point to start of the frame</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 17 Jun 2020 10:28:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62625/for-128bit-uuid-filter-p_adv_report--data-p_data-is-updated-differently-for-different-tags" /><item><title>RE: For 128bit UUID filter p_adv_report-&gt;data.p_data is updated differently for different tags.</title><link>https://devzone.nordicsemi.com/thread/255474?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 10:28:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21785127-ac9b-47e1-b9ce-5089c75defc7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I have used the ble_app_beacon example, and the attached ble_app_uart_c to print the advertisements:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-77cf51a8728e4c819c7e15fd054d2d47/ble_5F00_app_5F00_uart_5F00_c_5F00_scan_5F00_addr.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_uart_5F00_c_5F00_scan_5F00_addr.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Please note line 407 in main.c.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For 128bit UUID filter p_adv_report-&gt;data.p_data is updated differently for different tags.</title><link>https://devzone.nordicsemi.com/thread/255427?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 08:27:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96891703-3a93-4e45-b438-2901989ebb37</guid><dc:creator>Embedded_Engineer</dc:creator><description>&lt;p&gt;1. From the call stack we see that nrf_ble_scan_on_ble_adv_report()&amp;nbsp; is called (which is from case&amp;nbsp;BLE_GAP_EVT_ADV_REPORT in nrf_ble_scan_on_ble_evt(), so yes we are viewing the memory within the said case.&lt;/p&gt;
&lt;p&gt;2. Yes all the optimization are disabled ( -O0 )&lt;/p&gt;
&lt;p&gt;3. The frame can created using the raw data shown above. If its possible for you then please do so using ble_peripheral\ble_app_beacon . Otherwise I will create a project exhibiting this and share with you later.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For 128bit UUID filter p_adv_report-&gt;data.p_data is updated differently for different tags.</title><link>https://devzone.nordicsemi.com/thread/255412?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 07:26:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6041ba49-ee4b-4336-b047-96b274ac9a9a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I have never seen that it doesn&amp;#39;t before. Are you sure your breakpoint is in a&amp;nbsp;BLE_GAP_EVT_ADV_REPORT event, and not in another type of event? Also, make sure to turn off optimization in your project if you want to monitor the RAM during runtime.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you have a project that I can recreate this with, it would be interesting to see.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For 128bit UUID filter p_adv_report-&gt;data.p_data is updated differently for different tags.</title><link>https://devzone.nordicsemi.com/thread/255380?ContentTypeID=1</link><pubDate>Wed, 17 Jun 2020 04:53:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5773179-186d-4a51-8732-b79af2163d6b</guid><dc:creator>Embedded_Engineer</dc:creator><description>&lt;p&gt;[quote userid="26071" url="~/f/nordic-q-a/62625/for-128bit-uuid-filter-p_adv_report--data-p_data-is-updated-differently-for-different-tags/255313"][/quote]&lt;/p&gt;
&lt;p&gt;In the advertisement report event, data.p_data[0] will always point to the first byte of the advertising data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Perhaps you can try to print out the data in the advertising packet using something like this to see the content of the packets:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your reply. This is exactly my concern that the data.p_data[0] is not pointing to the start byte of the frame for the second beacon. I think viewing the memory in debugger is more useful than printing the same.I understand the BLE advertising packets and have explained them too in the table I shared earlier.&lt;/p&gt;
&lt;p&gt;Here is the complete frame received using nrf Android App.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/memory-C.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Please have a look at memory pointed by data.p_data (0x200040DC).&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/memoryView.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I still need help to find out why first byte of frame is not the first byte pointed by data.p_data. Please have a look at the images (Note: UUID is deliberately hidden).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: For 128bit UUID filter p_adv_report-&gt;data.p_data is updated differently for different tags.</title><link>https://devzone.nordicsemi.com/thread/255313?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 14:48:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ca0a7d4-beab-4e72-a0aa-1e98c080cecf</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;In the advertisement report event, data.p_data[0] will always point to the first byte of the advertising data.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Perhaps you can try to print out the data in the advertising packet using something like this to see the content of the packets:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;            NRF_LOG_INFO(&amp;quot;addr: %02x:%02x:%02x:%02x:%02x:%02x&amp;quot;, p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.peer_addr.addr[0],
                                                                p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.peer_addr.addr[1],
                                                                p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.peer_addr.addr[2],
                                                                p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.peer_addr.addr[3],
                                                                p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.peer_addr.addr[4],
                                                                p_ble_evt-&amp;gt;evt.gap_evt.params.adv_report.peer_addr.addr[5]);
            NRF_LOG_RAW_INFO(&amp;quot;adv_data: &amp;quot;);
            for (uint16_t i = 0; i&amp;lt;p_adv_report-&amp;gt;data.len; i++)
            {
                NRF_LOG_RAW_INFO(&amp;quot;%02x:&amp;quot;, p_adv_report-&amp;gt;data.p_data[i]);
            }
            NRF_LOG_RAW_INFO(&amp;quot;\r\n&amp;quot;);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That being said, different manufacturers will build up their advertising packet differently. You should iterate through the different flags.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Scanning the ble_app_beacon example should give something like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;adv_data: 02:01:04:1A:FF:59:00:02:15:01:12:23:34:45:56:67:78:89:9A:AB:BC:CD:DE:EF:F0:01:02:03:04:C3&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;If you study how BLE advertising packets are put together you can see that first there is the 02, which means the length of this section, the type is 01, which is the flags, and the 0x04 is the &amp;quot;payload&amp;quot; of the flags. The next section is 0x1A (26) long, type is 0xFF, which is manufacturer specific data, and the remaining 25 bytes is the payload:&lt;/p&gt;
&lt;p&gt;59:00:02:15:01:12:23:34:45:56:67:78:89:9A:AB:BC:CD:DE:EF:F0:01:02:03:04:C3&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>