mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-01 19:13:44 +00:00
example: handle HCI_EVENT_ENCRYPTION_CHANGE_V2
This commit is contained in:
parent
8601e696a7
commit
2c50985d9c
@ -514,6 +514,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
sm_request_pairing(connection_handle);
|
||||
break;
|
||||
case HCI_EVENT_ENCRYPTION_CHANGE:
|
||||
case HCI_EVENT_ENCRYPTION_CHANGE_V2:
|
||||
if (connection_handle != hci_event_encryption_change_get_connection_handle(packet)) break;
|
||||
printf("Connection encrypted: %u\n", hci_event_encryption_change_get_encryption_enabled(packet));
|
||||
if (hci_event_encryption_change_get_encryption_enabled(packet) == 0){
|
||||
|
@ -427,6 +427,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
sm_request_pairing(connection_handle);
|
||||
break;
|
||||
case HCI_EVENT_ENCRYPTION_CHANGE:
|
||||
case HCI_EVENT_ENCRYPTION_CHANGE_V2:
|
||||
if (connection_handle != hci_event_encryption_change_get_connection_handle(packet)) break;
|
||||
printf("Connection encrypted: %u\n", hci_event_encryption_change_get_encryption_enabled(packet));
|
||||
if (hci_event_encryption_change_get_encryption_enabled(packet) == 0){
|
||||
|
@ -213,7 +213,8 @@ static void hci_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
|
||||
// general gatt client request to trigger mandatory authentication
|
||||
// gatt_client_discover_primary_services(&hci_packet_handler, con_handle);
|
||||
break;
|
||||
case HCI_EVENT_ENCRYPTION_CHANGE:
|
||||
case HCI_EVENT_ENCRYPTION_CHANGE:
|
||||
case HCI_EVENT_ENCRYPTION_CHANGE_V2:
|
||||
con_handle = hci_event_encryption_change_get_connection_handle(packet);
|
||||
printf("Connection encrypted: %u\n", hci_event_encryption_change_get_encryption_enabled(packet));
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user