- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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ł
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MiBi_4539931 ,
I am sorry , forgot to update you.
I did the tests. So the stack is handling such a way that :
In case of LE Central role, BTM_PAIRED_DEVICE_LINK_KEYS_REQUEST_EVT will get trigger for the first connection itself, but however there won't be any stored keys though.
In LE Peripheral role, BTM_PAIRED_DEVICE_LINK_KEYS_REQUEST_EVT will get trigger on the second connection only.
Regards,
Anjana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MiBi_4539931 ,
Yes you are correct that BTM_PAIRED_DEVICE_LINK_KEYS_REQUEST_EVT will trigger if it reconnects to a pre bonded device.
It should not trigger on very first connection.
Let me test the demo sample code.
Regards,
Anjana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Anjana,
Any update?
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi AnjanaM_61. Have you chance to test that ?
Michał
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MiBi_4539931 ,
I am sorry , forgot to update you.
I did the tests. So the stack is handling such a way that :
In case of LE Central role, BTM_PAIRED_DEVICE_LINK_KEYS_REQUEST_EVT will get trigger for the first connection itself, but however there won't be any stored keys though.
In LE Peripheral role, BTM_PAIRED_DEVICE_LINK_KEYS_REQUEST_EVT will get trigger on the second connection only.
Regards,
Anjana