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

Address Filter not working

I have an NRF52 DK, and an IM21 door sensor that advertises events. I am trying to pick up these events with the nRF52DK in the most robust way possible. I have used the scanning library to implement an address filter to identify the IM21 events by the IM21 adress. My implementation is screenshotted below and I have verified that the address and address type are correct.

This code is in the scan_init() function:

I am verfying that the sensor is found through this print statement below, which isn't printing:

I also picked up the packets that are being advertised with the NRF Sniffer. The packet advertised is highlighted in this image below:

I welcome any ideas regarding where I may have gone wrong or missed something of importance.

Thank you very much, 

Maria

  • Okay, thank you for the update. Please check out the find_peer_addr() function in nrf_ble_scan.c and make sure that the address you're searching for is corresponding in length to BLE_GAP_ADDR_LEN. Are you also sure that you haven't enabled or are using any other filters that might interfere with the ADDR_FILTER. Here's a list of the possible filters:

    /**@defgroup NRF_BLE_SCAN_FILTER_MODE Filter modes
     * @{ */
    #define NRF_BLE_SCAN_NAME_FILTER       (0x01) /**< Filters the device name. */
    #define NRF_BLE_SCAN_ADDR_FILTER       (0x02) /**< Filters the device address. */
    #define NRF_BLE_SCAN_UUID_FILTER       (0x04) /**< Filters the UUID. */
    #define NRF_BLE_SCAN_APPEARANCE_FILTER (0x08) /**< Filters the appearance. */
    #define NRF_BLE_SCAN_SHORT_NAME_FILTER (0x10) /**< Filters the device short name. */
    #define NRF_BLE_SCAN_ALL_FILTER        (0x1F) /**< Uses the combination of all filters. */
    /* @} */

  • Hello,

    Thank you for your reply - the value of BLE_GAP_ADDR_LEN is 6 which matches the length of the address I am searching for. 

    No other filters are enabled.

    Thanks,

    Maria

  • Hello,

    I have attached my code if it would help to take a look. I have adapted the ble_app_uart.c example from the ble_central examples folder.

    Thanks,

    Maria

  • Hi

    Okay, thank you for confirming. I'm running out of ideas. Would it be possible for you to upload the main.c files for the advertiser and scanning device so I can get a better look at the entirety of your project.

    Best regards,

    Simon

  • Hello,

    I got the help of a very skilled BLE engineer, and he was able to solve the issue. We dropped the address filter and implemented a short name filter instead. So we never got the address filter working, but we were able to pick up the sensor by implementing a short name filter instead.

    In ble_advdata.c, in the function ble_advdata_short_name_find() he changed line 731 from a less than sign to a less than or equal to sign. This solved the issue. I have attached a screenshot of the fixed function below.

    I am curious as to whether or not this is a bug with the sdk - I am using version 17.02. 

    Thank you,

    Maria

Related