Address filter with various peripherals

I use the nrf5340.

I want to filter 8 devices with different addresses.

When scan_filter_match() recognizes one of the addresses, can you quickly identify which of the addresses entered (1 to 8)?

I saw that 'filter_match->addr.addr' reports the recognized address: should I make a comparison with all my 8 addresses?

Thank you

Parents
  • Hello,

    It should be possible to add multiple address filters by increasing the CONFIG_BT_SCAN_ADDRESS_CNT setting. You can add CONFIG_BT_SCAN_ADDRESS_CNT=8 to your project configuration file to support 8 address filters. However, filtering on a static address will not work if you are connected to privacy-enabled Central devices that use a periodically changing private address. Are these other devices implemented by you, and do you support bonding in your application?

    Best regards,

    Vidar

  • Sorry, I didn't explain myself well.
    I have activated the filtering of 8 Peripherals, each with a different static and personalized address. These 8 addresses are inserted into the Central filter with "bt_scan_filter_add(BT_SCAN_FILTER_TYPE_ADDR, myaddr)". When the Central scans and detects one of these Peripherals, it correctly executes "scan_filter_match()", but to find out which of the 8 Peripherals has been detected, I have to compare "filter_match->addr.addr" again with the 8 addresses: which the firmware has already done (I believe in "scan.c").
    I wanted to know if I can avoid the 2nd compare by testing an index generated by the library.
    Thank you

  • Thanks for the clarification. The scanner module does not make any attempt to index the different devices, unfortunately. You can either check the address in this callback, or in the connected callback. 

Reply Children
Related