This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Disable peripheral bonding with multiple devices

Other Parts Discussed in Thread: CC2541

Hi,

I'm developing a BLE peripheral device on the CC2541 (using the Keyfob demo project as a base).

I want the peripheral only to be bondable to a single device (i.e. 1 Smartphone) but be able to connect (unpaired) with multiple phones... The idea is to have some characteristics set to GATT_PERMIT_READ (readable by everybody) and some to GATT_PERMIT_ENCRYPT_READ (readable only bye the bonded device), thus only requiring pairing/bonding with the device when reading the encrypted characteristics.

Separating the characteristics permits works great, but now I want the peripheral to disregard new pairing/bonding requests when a previously bond exists... preventing non-bonded devices to read the encrypted characteristics.

To accomplish that I try to set GAP_BONDINGS_MAX = 1 and hope that would do it. However, it is still possible to pair/bond with a second device and read the encrypted characteristic

What have I missed? Do I have to disregard the second pair/bond request manually in the peripheral application?

// Thomas

  • Hello,

    If you have MITM protection and display only - then you can have a passcode (in manual or printed) which the phone has to enter.

    You might try checking address on connection event and then disabling gap pairing params there.

    Another option might be to specifically handle reads in the service read callback, and depending on address send back an error response.

    Switching whitelist on/off with gap pair settings might also work. 

    BR,

    -Greg