<?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>Viewing contents of advertising packet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/81745/viewing-contents-of-advertising-packet</link><description>Hi everyone, 
 Is there a way of being able to view the contents of the advertising packets (advertising and scan response) without using a bluetooth sniffer? Is it possible to print the contents of the packet locally though the NRF_LOG before it is sent</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Nov 2021 14:24:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/81745/viewing-contents-of-advertising-packet" /><item><title>RE: Viewing contents of advertising packet</title><link>https://devzone.nordicsemi.com/thread/339261?ContentTypeID=1</link><pubDate>Tue, 16 Nov 2021 14:24:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62062197-216b-44eb-9c6c-5849098b141f</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Most of the examples run a static configuration of the advertising payload (and scan response payload as well if you are using scan response).&amp;nbsp;In the nRF5 SDK you use the advertising module. You can read the advertising raw data after running ble_advertising_init:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init);
APP_ERROR_CHECK(err_code);



// Write the raw adv and scan response data to local variables

uint8_t *adv_data_ptr = m_advertising.adv_data.adv_data.p_data;
uint16_t adv_data_len = m_advertising.adv_data.adv_data.len;
uint8_t *sr_data_ptr = m_advertising.adv_data.scan_rsp_data.p_data;
uint16_t sr_data_len = m_advertising.adv_data.scan_rsp_data.len;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>