nrf52840 ble Filtering MAC Addresses

The code shown below filters the duplicate MAC addresses, but I found in the previous development process that many Bluetooth devices only display the MAC address, not the name.  If I mask this filtering code, I can scan a lot of devices that I couldn't scan before.  However, there is a problem with this operation: there are many duplicate MAC addresses or device names in the scan list.  Please tell me how I can filter the duplicate MAC addresses to only one without using the code in the figure below.  

examples\ble_central_and_peripheral\experimental\ble_app_interactive\pca10056\s140

Parents
  • Hi,

    I am not sure I understand the question here.

    Referring to the ble_app_interactive example in SDK 17.1.0, the implementation is so that it lists all devices, with or without device name, but filters out so that there are no duplicates. That sounds like what you want, is it not? If so, you can use the code as is. What you have done in the screenshot is to comment out the code snippet which prevents duplicate addresses, which is also what you describe that you want.

    I assume I have misunderstood something, but not sure what. Perhaps you can explain more?

  • hi,

    In other words, now if I don't comment out that code, I'm not going to be able to scan for the device name in the serial port, I'm only going to be able to scan for the MAC address, and if I comment out that code I'm going to be able to see the device name.  I would like to ask you if there is any other way to scan and display the device name in the serial port besides the case where the device name appears in the comment code  

Reply
  • hi,

    In other words, now if I don't comment out that code, I'm not going to be able to scan for the device name in the serial port, I'm only going to be able to scan for the MAC address, and if I comment out that code I'm going to be able to see the device name.  I would like to ask you if there is any other way to scan and display the device name in the serial port besides the case where the device name appears in the comment code  

Children
Related