Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to add manufacturer specific data filter inside the nrf_ble_scan module ?

Hi,

I want to add manufacturer specific data filter in nrf_ble_scan module.

I have gone through the nRF SDK. But  the manufacturer specific data filter related fields are missing.

Kindly guide me how to configure the filter for manufacturer specific data in nrf_ble_scan module.

 

Regards,

Vashi

  • Hi Vashi

    Please check out this case where an example on how to add a manufacturer specific scan filter with the nrf_ble_scan_filter_set() function. See the Multirole LESC example for more details.

    Best regards,

    Simon

  • Hi Simonr,

    I have gone through the code which you shared. I found that following filters are available in the file nrf_ble_scan.h

    Here the Manufacture specific data filter is missing.

    typedef enum
    {
    SCAN_NAME_FILTER, /**< Filter for names. */
    SCAN_SHORT_NAME_FILTER, /**< Filter for short names. */
    SCAN_ADDR_FILTER, /**< Filter for addresses. */
    SCAN_UUID_FILTER, /**< Filter for UUIDs. */
    SCAN_APPEARANCE_FILTER, /**< Filter for appearances. */
    } nrf_ble_scan_filter_type_t;

    Below function is used to set filter type:

    ret_code_t nrf_ble_scan_filter_set(nrf_ble_scan_t * const p_scan_ctx,
    nrf_ble_scan_filter_type_t type,
    void const * p_data)

    Suppose if i want to enable "Manufacture specific data filter"

    Related flag is not defined in the enum ------> "nrf_ble_scan_filter_type_t"

    Please guide me how to enable this flag ???

    Regards,

    Vashi

  • Hi Vashi

    As mentioned in the case I linked to, you will have to use the SCAN_UUID_FILTER to scan for manufacturer specific data, as the manufacturer data also has a specific UUID you can use to scan for. You will need to know this UUID though, and put both the UUID and the manufacturer specific data into your advertising packet.

    Best regards,

    Simon

Related