Using preset "Security Manager Key Distribution" data to define devices

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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:

   

CYBLE_GAP_SMP_KEY_DIST_T localKeys;

   

CyBle_GapGetDevSecurityKeyInfo(&localKeyFlags, &localKeys);

   

if((localKeyFlags & CYBLE_GAP_KEY_FLAG_LII) != 0u) //Local Signature Key
{

   

localKeys.midInfo[9] = <Byte that defines Client device type>; //Using midInfo[9] 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?

0 Likes
1 Solution
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

   

As Security Keys struct is part of BLE stack so it cannot be modified.

   

Thanks,

   

Hima

View solution in original post

0 Likes
2 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

   

As Security Keys struct is part of BLE stack so it cannot be modified.

   

Thanks,

   

Hima

0 Likes
Anonymous
Not applicable

OK.  That's what I kind of figured.  Thank you for the clarification.

0 Likes