4 Replies Latest reply on Apr 24, 2020 7:10 AM by AnjanaM_61

    Unexpected events from bt stack

    MiBi_4539931

      Hi,

       

      I am getting familiar with cypress pairing/bonding implementation. As case study I am observing hrs/hrc example. I already understand how the keys are stored. I know that if devices are bonded then after reconnection bt stack will try to restore keys from flash with BTM_PAIRED_DEVICE_LINK_KEYS_REQUEST_EVT event. But on the first connection I noticed something strange. Before even log about connection being up ("hrc_connection_up") is printed I can see that BTM_PAIRED_DEVICE_LINK_KEYS_REQUEST_EVT  event is received twice. I don't understand why bt stack is trying to retrive keys even before encryption is started? Is it specific to this example or is it standard behaviour with cypress chips? Please the logs:

       

      hrc_interrupt_handler, app timer :13
       Button pressed
      hrc_interrupt_handler, app timer :13
       Button released  with in 2 seconds. hrc_management_cback:22
      Scan State Change: 1
      wiced_bt_ble_scan: 8100
       Found Device : 5a 04 55 0a 32 42
      Scan completed:
      hrc_management_cback:22
      Scan State Change: 0
      scan off status 0
      hrc_management_cback:19
      Key retrieval failure
      hrc_management_cback:19
      Key retrieval failure
      wiced_bt_gatt_le_connect status 1
       14
      hrc_connection_up
      

       

      I will be thankful for any help in understanding this.

       

      Michał