How to limit server to bonding with just one client? | Cypress Semiconductor
How to limit server to bonding with just one client?
On the BLE 4.2 component Configure dialog I have the following set on the GAP Security page:
Security mode: Mode 1; Security level: Unauthenticated pairing with encryption; I/O capabilities: No Input No Output; Bonding requirement: Bonding.
I want to set Maximum bonded devices: 1, but for some reason that setting is fixed at 4 and grayed out. The data sheet says this setting is enabled only when Bonding is enabled, and that it is not available in "the BLE v3.10" (sic). So it should be available, but it is not!
I also tried to do it in code: use CyBle_GapGetBondedDevicesList to get the count of bound devices with a view to declining the bond request if it is > 0. This works fine, except I cannot work out how to decline the request! CYBLE_EVT_GAP_AUTH_REQ gets triggered in my event handler, but even if I set the 'authErr' code in eventParam the pairing still completes and I have two devices in the bonded list. If this did prevent bonding, I'm not sure that would work anyway since CYBLE_EVT_GAP_AUTH_REQ seems to get triggered when a device already in the bonded list gets re-connected as well.
What I am trying to achieve is to set a bonding between one client and one server without requiring a passkey etc. To bond a server to a new client, you have to delete the existing bonding record in the server, requiring physical access, but it looks like the only way to achieve that is to bond with three additional devices and then lock them away in a drawer so the fixed size bond list is full!
Can anyone give me a way forward on this?