<?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>Reading Raw Adv Packet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49289/reading-raw-adv-packet</link><description>Hello, 
 
 How can i put out the received Adv Data on the UART? Currently I get for every advertise packet the BLE_GAP_EVT_ADV_REPORT in my ble_stack_handler. Then i wanted to print out the data on my VirtualPort with printf((char*)p_gap_evt-&amp;gt;params.adv_report</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Oct 2019 16:43:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49289/reading-raw-adv-packet" /><item><title>RE: Reading Raw Adv Packet</title><link>https://devzone.nordicsemi.com/thread/217605?ContentTypeID=1</link><pubDate>Wed, 30 Oct 2019 16:43:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f9fdd24-4feb-43fa-8fc6-83d1cc3b5f81</guid><dc:creator>Brian</dc:creator><description>&lt;p&gt;Hi Lecram,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m happy to hear you fixed your code. I am working on a similar project and am trying to send beacon data over UART to an esp8266 module, everything looks correct and I am not sure what&amp;#39;s going wrong. Would you be willing to help and share your main.c source code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading Raw Adv Packet</title><link>https://devzone.nordicsemi.com/thread/196220?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 09:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01f8ebdf-51b1-47d0-b745-5fbce16503ea</guid><dc:creator>Lecram</dc:creator><description>&lt;p&gt;I am ashamed. Thank you very much. Im able to print out the 31 Bytes. Im so happy :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading Raw Adv Packet</title><link>https://devzone.nordicsemi.com/thread/196206?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 09:23:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:679d7ebf-4aca-429a-896c-e66939ad5f2b</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;But arrays &amp;amp; pointers are &lt;em&gt;almost&lt;/em&gt; the same thing in &amp;#39;C&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://c-faq.com/aryptr/"&gt;http://c-faq.com/aryptr/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The index operator [] can be applied to a pointer:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint8_t* my_pointer;

my_pointer = &amp;amp;some_data;    // set the pointer to point to something

printf( &amp;quot;1st byte (offset 0) is %d&amp;quot;, my_pointer[0] );
printf( &amp;quot;2nd byte (offset 1) is %d&amp;quot;, my_pointer[1] );
printf( &amp;quot;3rd byte (offset 2) is %d&amp;quot;, my_pointer[2] );
  :
  :
printf( &amp;quot;nth byte (offset n-1) is %d&amp;quot;, my_pointer[n-1] );
  
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;which is equivalent to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint8_t* my_pointer;

my_pointer = &amp;amp;some_data;    // set the pointer to point to something

printf( &amp;quot;1st byte (offset 0) is %d&amp;quot;, *my_pointer   );
printf( &amp;quot;2nd byte (offset 1) is %d&amp;quot;, *my_pointer+1 );
printf( &amp;quot;3rd byte (offset 2) is %d&amp;quot;, *my_pointer+2 );
  :
  :
printf( &amp;quot;nth byte (offset n-1) is %d&amp;quot;, *my_pointer+(n-1) );
  
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Or:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint8_t* my_pointer;

my_pointer = &amp;amp;some_data;    // set the pointer to point to something

printf( &amp;quot;1st byte (offset 0) is %d&amp;quot;, *my_pointer++ );
printf( &amp;quot;2nd byte (offset 1) is %d&amp;quot;, *my_pointer++ );
printf( &amp;quot;3rd byte (offset 2) is %d&amp;quot;, *my_pointer++ );
  :
  :&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Again, this is all standard &amp;#39;C&amp;#39; - nothing specific to Nordic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading Raw Adv Packet</title><link>https://devzone.nordicsemi.com/thread/196174?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 08:38:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d578f6b-2c33-462e-8d7b-e4c54527365a</guid><dc:creator>Lecram</dc:creator><description>&lt;p&gt;Thank you for your Answer but&amp;nbsp;&lt;span&gt;p_gap_evt-&amp;gt;params.adv_report.data.p_data isnt a Array. Its a uint8_t* type. So im little bit confused. Also watched about the value in the debugger and i get something like &amp;quot;0x2000355c&amp;quot;. This istn even close 31 Bytes. And my p_gap_evt-&amp;gt;params.adv_report.data.len has the Value &amp;quot;0x001f&amp;quot;, which is in dec 31&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading Raw Adv Packet</title><link>https://devzone.nordicsemi.com/thread/196167?ContentTypeID=1</link><pubDate>Wed, 03 Jul 2019 08:30:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb2a3cbe-f853-4846-b4dc-ee69a168294f</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Surely, this is a pure &amp;#39;C&amp;#39; question - nothing specifically to do with Nordic?&lt;/p&gt;
[quote userid="81031" url="~/f/nordic-q-a/49289/reading-raw-adv-packet"]How can i print out the raw 31 Byte received advertising packet? Do i need a for-loop to print out every byte?&amp;nbsp;[/quote]
&lt;p&gt;Of course - if you need to print 31 individual values, the obvious way to do that will be in a loop.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>