mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-15 22:20:59 +00:00
sm_pairing_central: print encryption state
This commit is contained in:
parent
e5779dd230
commit
6c42608ae7
@ -102,7 +102,7 @@ static void sm_pairing_central_setup(void){
|
||||
|
||||
// LE Legacy Pairing, Just Works
|
||||
sm_set_io_capabilities(IO_CAPABILITY_DISPLAY_YES_NO);
|
||||
sm_set_authentication_requirements(0);
|
||||
sm_set_authentication_requirements(SM_AUTHREQ_NO_BONDING);
|
||||
|
||||
// LE Legacy Pairing, Passkey entry initiator enter, responder (us) displays
|
||||
// sm_set_io_capabilities(IO_CAPABILITY_DISPLAY_ONLY);
|
||||
@ -179,7 +179,6 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
case SM_EVENT_PASSKEY_DISPLAY_NUMBER:
|
||||
printf("Display Passkey: %"PRIu32"\n", sm_event_passkey_display_number_get_passkey(packet));
|
||||
break;
|
||||
|
||||
case HCI_EVENT_LE_META:
|
||||
// wait for connection complete
|
||||
if (hci_event_le_meta_get_subevent_code(packet) != HCI_SUBEVENT_LE_CONNECTION_COMPLETE) break;
|
||||
@ -187,6 +186,10 @@ static void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packe
|
||||
// start pairing
|
||||
sm_request_pairing(con_handle);
|
||||
break;
|
||||
case HCI_EVENT_ENCRYPTION_CHANGE:
|
||||
con_handle = hci_event_encryption_change_get_connection_handle(packet);
|
||||
printf("Connection encrypted: %u\n", hci_event_encryption_change_get_encryption_enabled(packet));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user