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

Search a specific BLE peripheral device

Hello,

we have developed a custom BLE peripheral device. All peripheral devices have the same name. If we want to indetify a specific peripheral device with a smartphone APP, we use the manufacturer data during advertising to set a Flag, if the user press a button on the pheripheral device. After the smartphone find the specific peripheral device we perform a bonding and in addition the smartphone save the MAC Address from the periheral device, to ensure that the Smartphone only try to connect to this device. After the bonding is performed the peripheral allows only devices from the whitelist. Is this the right way to indentify a specific peripheral device and ensure that the smartphone always reconnect to the same device?

Parents
  • Hello Frederic,

    Why so complicated when you have "unique" MAC (Advertising) address of the peripheral device from the beginning (advertising, active scanning, target of connection)? Even BLE stack on handset side is using it for "db" of known devices (e.g. when you disable "Service Changed" characteristic on peripheral side then phones will use short service discovery just based on 6-byte MAC address and GATT handles from BLE peripheral stack will be "cached").

    If you are worried about "uniqueness" of the MAC across your device base then you can either check it during manufacturing process (because then I assume your solution is based on that value and thus you read/log it at some point) or you can easily assign your unique 43-bit number, write it to the flash (e.g. to UICR region) and use as Adv. Address during every boot of the device. But even Nordic does guarantee neither 100% uniqueness nor randomness of the 8-byte Device Address (which I personally completely understand) I'd bet you will never see two equal MAC addresses in the field.

    Cheers Jan

  • My bad, I missed that you are interested into that initial phase of recognition of your devices from other BLE peripherals. There are 3 standard ways how to do it:

    • By specific name AD in ADV_IND or SCAN_RSP (this is the way if you must rely on 3rd party central apps or generic OS capabilities).
    • By advertising your specific 128-bit UUID in ADV_IND or SCAN_RSP (which you anyway must do if you are having such service and want to follow BLE specifications).
    • By putting manufacturer specific data AD in ADV_IND or SCAN_RSP and put some special string there (or consider joining BT SIG and reserving your specific code, then you might put just that).

    Cheers Jan

Reply
  • My bad, I missed that you are interested into that initial phase of recognition of your devices from other BLE peripherals. There are 3 standard ways how to do it:

    • By specific name AD in ADV_IND or SCAN_RSP (this is the way if you must rely on 3rd party central apps or generic OS capabilities).
    • By advertising your specific 128-bit UUID in ADV_IND or SCAN_RSP (which you anyway must do if you are having such service and want to follow BLE specifications).
    • By putting manufacturer specific data AD in ADV_IND or SCAN_RSP and put some special string there (or consider joining BT SIG and reserving your specific code, then you might put just that).

    Cheers Jan

Children
No Data
Related