2 Replies Latest reply on Dec 30, 2016 8:43 AM by dturney_1462731

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

    dturney_1462731

      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?