This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unexpected packet in beacon scanner.

Hi.

I'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 in p_evt handler function as follows.

beacon_evt_handler(ble_scan_beacon_evt_t * p_evt) {
   if(uuid_cmp(p_evt->rcv_adv_packet.adv_data.uuid.uuid128, specified_UUID, UUID_LENGTH) {
      ....
   }
}

I compared "p_evt->rcv_adv_packet.adv_data.uuid.uuid128" value with specified UUID. (for ex. 0x00112233445566778899aabbccddeeff)

And I set up another nrf51822 board as a beacon advertising with specified UUID.

So, there're 1 beacon scanner & 1 beacon configured for a certain UUID.

I guessed that beacon scanner would get advertisement packet of UUID(0x001122...) only from that beacon.

But, not like my expectation, other advertisement packets comes into beacon scanner.

I mean, other beacon(that are configured to have different UUID) advertisement packets.

That packets has unexpected value but with specified UUID.(0x001122...)

I don't understand how other beacon's advertisement packet has custom UUID.

I checked out address value of these strange packets.

and I found that owners of these packet are other devices. ( other beacon scanner, ble device - not iBeacon device, etc)

But, there's no clue how they have same UUID that I specified as custom. (0x001122...)

Is there some sort of broadcasting feature in ble or beacon? (If it is, then, how can I filter out that?)

And one more question for setting up beacon scanner.

Is it possible to setup beacon scanner without advertising?

When I stop advertising in beacon scanner it dies.

I just want to receive advertisement of other beacons. not advertising.

Thanks in advance.

Parents
  • Hello.

    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?

    Is there some sort of broadcasting feature in ble or beacon?

    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 "non-connectible" flag set. You cannot filter it out, as it is what you are scanning for.

    Is it possible to setup beacon scanner without advertising?

    Yes. In main(), the line

    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    

    starts the advertising.

  • You're right. After inserting memset() code, strange packet is no longer detected in scanner! So it seems like it's just problem of scanner not clearing default value of evt struct. Thanks!

Reply Children
No Data
Related