Scan response not reported when scan-filter is enabled

Hi

We are using the NCS V2.6.99 for a sample project which scans for peripheral devices.

In this sample project, the scan filter (bt_scan_filter_add(BT_SCAN_FILTER_TYPE_UUID, &uuid);) is used so that only peripheral devices with the correct service UUID are reported. This works so far.

But when I enable active scanning, I don't get any scan response events of my peripheral devices which have the correct service UUID in their advertising data.

Is the reason that the UUID-filter is also applied to the scan response data?

Is it even possible to receive the scan response events from my peripheral devices when the scan filter is enabled, but I don't know the content of the scan-response?

Many thanks in advance.

Best regards, Remo

  • Hi

    What data are you expecting the peripherals to send in the scan response? I don't see why that wouldn't work if the UUID of the scanned peripherals match filter you've set.

    Maybe you can try sniffing the advertising process to find out what's happening on-air here, as an active scanner always should send out the scan requests and get responses from advertisers it has scanned. You can use a dedicated Bluetooth sniffer or an nRF52 DK with the nRF Sniffer firmware and Wireshark.

    Best regards,

    Simon

  • Hi

    The peripherals are for example advertising the following data:

    - Device 1:  ADV_DATA: "My service UUID", SCAN_RSP: "Complete device Name 1"
    - Device 2:  ADV_DATA: "My service UUID", SCAN_RSP: "Shortened device Name 2"
    - Device 3:  ADV_DATA: "My service UUID", SCAN_RSP: "Manufacturer data"

    Since every device has the service UUID in its advertising-data, I can filter for this UUID and get the advertising-data-report successfully. But since the scan-response can contain different tags, I cannot add a dedicated filter for the scan-response. Therefore, how can I get the scan responses of these devices?

    Best regards

    Remo

  • Hi Remo

    Okay, so after digging a bit, it seems like the advertisement report buffer is overwritten during parsing, so it won't recognize an advertisers scan response by default. In this case, my colleague Vidar describes how you can make the scanner "remember" the advertiser so that it will also catch the scan response even though it doesn't add the UUID that is filtered:  RE: How to access all advertisement data in scan filter match callback? 

    Best regards,

    Simon 

  • Hi Simon

    Thanks for the reply and the link to the other thread. I almost expected that it wouldn't be that easy.

    So, I think the solution for my case is the same as described in the link. I don't use the filtering option and use the callback scan_filter_no_match() to implement the filtering and collecting advertising- and scan-response-data for myself.

    Best regards

    Remo

Related