I'm building a HID-centered application on both the peripheral and central side. The central end can be one of 3 devices, and the peripheral side has a HID service for each device, dependent on what type the client device is. I'm using LE Secure w/ Encryption + Bonding. What I want to do is, during bonding, have a scheme to define the device type the peripheral will be directly advertising to after initial bonding, that way it can be recalled when the peripheral is powered on and sorts through the bonded devices list. Unless there's a safer method, I was wondering if I could alter a part of the Security Keys struct on the client end, for example:
if((localKeyFlags & CYBLE_GAP_KEY_FLAG_LII) != 0u) //Local Signature Key
localKeys.midInfo = <Byte that defines Client device type>; //Using midInfo for this example
CyBle_GapSetSecurityKeys(localKeyFlags,&localKeys); //Set security keys to reflect device type
When the peripheral receives the Security Key info from the client, and/or retrieves the device from the bonded device list (CyBle_GapGetPeerDevSecurityKeyInfo), it can use this byte to find the client device type.
Is this a possibility?
Solved! Go to Solution.