<?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>Unexpected packet in beacon scanner.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/11084/unexpected-packet-in-beacon-scanner</link><description>Hi. 
 I&amp;#39;m currently receiving advertisement packet from beacon scanner app. (nrf51822)
(ble_peripheral/experimental_ble_app_multiactivity_beacon/hrs_scanner) 
 I tried to receive advertise packet with only specified UUID. 
 To do that I checked UUID</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Jan 2016 04:21:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/11084/unexpected-packet-in-beacon-scanner" /><item><title>RE: Unexpected packet in beacon scanner.</title><link>https://devzone.nordicsemi.com/thread/41480?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2016 04:21:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6751d036-3858-4c18-9fe6-9ee9bfe2eb09</guid><dc:creator>cl</dc:creator><description>&lt;p&gt;You&amp;#39;re right. After inserting memset() code, strange packet is no longer detected in scanner! So it seems like it&amp;#39;s just problem of scanner not clearing default value of evt struct. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected packet in beacon scanner.</title><link>https://devzone.nordicsemi.com/thread/41477?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 11:38:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb8c91af-4307-4fad-be14-47683b89e71d</guid><dc:creator>cl</dc:creator><description>&lt;p&gt;For the first comment, other devices are not advertising with custom UUID. Only one beacon (that I set) is advertising with custom UUID. But, scanner get packets as if other devices is advertising not that beacon. For the second comment, I&amp;#39;ll try tomorrow and report. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected packet in beacon scanner.</title><link>https://devzone.nordicsemi.com/thread/41476?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 10:29:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e5c38ac-86bf-4231-906f-e1b19cd48260</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;On line 238 of scanner_beacon.c, try changing&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_scan_beacon_evt_t evt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_scan_beacon_evt_t evt;
memset(&amp;amp;evt, 0, sizeof(evt))
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected packet in beacon scanner.</title><link>https://devzone.nordicsemi.com/thread/41475?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 10:20:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96063672-95cf-428a-b54b-67062219aab1</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;So other devices are advertising beacon packets with the custom UUID you created? It might seem that the uuid field is not deleted between each scan result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected packet in beacon scanner.</title><link>https://devzone.nordicsemi.com/thread/41479?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 04:56:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:881cd598-6c79-4e6f-a3ad-f2f02d6a4d31</guid><dc:creator>cl</dc:creator><description>&lt;p&gt;I checked out one of the address in the strange packet.
and setup nrf sniffer to see if the device with that address is really advertising with specified UUID.
But, in the sniffer, there&amp;#39;s no packet with specified UUID.
In summary, it seems like those strange packet is not actually come from other ble device.
but these packets comes in scanner with address of ble devices.
I&amp;#39;m now confusing why these packet is scanned in scanner.
For your reference, this is uuid_cmp() function.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static uint8_t uuid_cmp(const unsigned char *strA, const unsigned char *strB, unsigned int size) {
int i = 0;

int ret = 0;


for(i = 0; i&amp;lt;size;i++) {
	if(strA[i] == strB[i])
		ret++;
}
return (ret == size);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected packet in beacon scanner.</title><link>https://devzone.nordicsemi.com/thread/41478?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2016 02:19:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2651768f-ed92-413b-9267-d759b7359868</guid><dc:creator>cl</dc:creator><description>&lt;p&gt;Thank you for your kind answer.
Scanning without advertising is working nicely.
But, for the problem of unexpected packet still not understanding.
First of all, uuid_cmp() function is working correctly.
(I checked the uuid value using debugger and it is not NULL.)
But there&amp;#39;s something strange I found out.
These unexpected packets comes in scanner only when there&amp;#39;s a beacon who is advertising for custom UUID.
If I turn off a beacon which is advertising with specified UUID, unexpected packet doesn&amp;#39;t apear in a scanner.
So, my thinking is something like collision is happening when a beacon advertise.
Any idea for this situation?
Thanks.
+) One more thing, all these unexpected packet has the same major, minor value but just have different addr(which is not fake, but an address of real ble device).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unexpected packet in beacon scanner.</title><link>https://devzone.nordicsemi.com/thread/41474?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2016 13:01:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe27dd63-0991-42ee-871c-499800e18c27</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;When scanning, you will get advertising packets from all devices around you. It is up to you to filter the advertisement packets (Like you are doing in beacon_evt_handler). It does not make any sense that the other advertisement packets have the same uuid. Are you sure of this? Maybe there is a bug in uuid_cmp? For example if the uuid is NULL?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Is there some sort of broadcasting
feature in ble or beacon?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes. Broadcasting and advertising is basically the same thing. Non-connectible advertising is often called broadcasting. This is how a BLE beacon broadcasts its packets. A BLE beacon is simply a device advertising a specific packet with the &amp;quot;non-connectible&amp;quot; flag set. You cannot filter it out, as it is what you are scanning for.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Is it possible to setup beacon scanner
without advertising?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Yes. In main(), the line&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;starts the advertising.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>