<?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>Scan response on SDK15.3</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89753/scan-response-on-sdk15-3</link><description>Hi, I&amp;#39;m working with nRF52832 and S132 v6.1.1 on SDK15.3.0. I&amp;#39;m using two nRF52832: one is scanning (active scanning) and one is advertising, and I want to exchange data between them using the scan request/scan response mechanism. 
 Using your nRF Sniffer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Jul 2022 13:45:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89753/scan-response-on-sdk15-3" /><item><title>RE: Scan response on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/376241?ContentTypeID=1</link><pubDate>Fri, 08 Jul 2022 13:45:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c6f6c9d-a624-480a-a38e-37100abd63e2</guid><dc:creator>Lorenzo</dc:creator><description>&lt;p&gt;Hi, yes I can confirm it is my central device doing active scanning and sending the scan requests. The LED should be seen because it&amp;#39;s a long blink and if I put it outside that &amp;quot;if&amp;quot; I can see it &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Of course the next step is to print out all the received packets over UART as you suggest.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll keep you updated as soon I as I can do this test.&lt;/p&gt;
&lt;p&gt;Thank you very much for the moment!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan response on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/376194?ContentTypeID=1</link><pubDate>Fri, 08 Jul 2022 11:57:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cded6660-f391-4b84-8f5c-8f6a1456353d</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Gino"]Putting a led blink&amp;nbsp;within&amp;nbsp;the &amp;quot;&lt;code&gt;if (p_adv_report-&amp;gt;type.scan_response)&lt;/code&gt;&lt;span&gt;&amp;quot; is showing that no scan response packets are arriving,&amp;nbsp;despite the fact that I&amp;#39;m seeing them with WireShark.&lt;/span&gt;[/quote]
&lt;p&gt;Is your central doing active scanning, or could it be that you see these scan responses in the trace because some other central does active scanning? If you central does it, perhaps you just don&amp;#39;t see the LED blink because of the frequency? What if you check with a logic analyzer, or perhaps better just log a line over UART or RTT instead of&amp;nbsp;blinking a LED?&lt;/p&gt;
&lt;p&gt;If you still have problems, perhaps you can share your central/observer code here so that we can have a look?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan response on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/376059?ContentTypeID=1</link><pubDate>Thu, 07 Jul 2022 15:30:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:52a7e412-3619-430e-bb05-1bcd7ac5f686</guid><dc:creator>Lorenzo</dc:creator><description>&lt;p&gt;Thank you Einar, it&amp;#39;s much more clear to me now!&lt;br /&gt;What&amp;#39;s not clear is why I still can&amp;#39;t receive scan response packets on the scanner. &lt;br /&gt;Putting a led blink&amp;nbsp;within&amp;nbsp;the &amp;quot;&lt;code&gt;if (p_adv_report-&amp;gt;type.scan_response)&lt;/code&gt;&lt;span&gt;&amp;quot; is showing that no scan response packets are arriving,&amp;nbsp;despite the fact that I&amp;#39;m seeing them with WireShark.&lt;br /&gt;Any idea of what could cause this? Meanwhile I&amp;#39;ll try to investigate further and come back to this forum.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Scan response on SDK15.3</title><link>https://devzone.nordicsemi.com/thread/375990?ContentTypeID=1</link><pubDate>Thu, 07 Jul 2022 11:33:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fd1ccf5-d4e6-4160-95ad-8dc3acc6d9b6</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Lorenzo,&lt;/p&gt;
[quote user=""]Finally, on the advertising device side, I&amp;#39;d like to ask if what I&amp;#39;m currently doing everytime I&amp;#39;m starting the advertising activity:[/quote][quote user=""]Is it necessary to always &amp;quot;zero&amp;quot; one of the two packets, or does the softdevice take care of which packet to send in which condition (basically if upon a scan request or not).[/quote]
&lt;p&gt;No, if one of them had to be all zeros there would be no point in the scan response packets. An advertiser always needs to send advertisement packets (if not, it is not advertising). And if there is not enough room in the advertisement packets, it can also optionally send a scan response packet if the scanner sends a scan request. This must be sent in a short window right after the advertising event, so it is not possible to get just the scan response packets an no advertising packets. This is how Bluetooth LE works.&lt;/p&gt;
&lt;p&gt;With regards to implementation, for a peripheral device you must always provide a advertising packet to advertise, and you can optionally also provide a scan response packet. If you do, the stack will automatically send the scan response packet if it gets a scan request.&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;My understanding is that I should find the scan response data within the&amp;nbsp;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;p_adv_report-&amp;gt;data.p_data&lt;/span&gt; buffer, which is just the same where regular advertising packets data is temporarily stored. Is it correct? Because I can&amp;#39;t seem to find the scan response data I&amp;#39;m looking for.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:&amp;#39;courier new&amp;#39;, courier;"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Also, how should I recognize scan response packets from regular advertising packets? I&amp;#39;ve come up with this but I&amp;#39;m not quite sure that&amp;#39;s the correct way:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;[/quote]
&lt;p&gt;For the scanner, a scan response packet and advertising packet are handled in exactly the same way. The only way to distinguish between them is to look at the type field. This are using bitfields, so just to like this: &amp;quot;&lt;code&gt;if (p_adv_report-&amp;gt;type.scan_response)&lt;/code&gt;&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>