mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-22 07:21:06 +00:00
sm_pairing examples: handle ERROR_CODE_PIN_OR_KEY_MISSING
This commit is contained in:
parent
6bc3aba4a0
commit
bd37f2bf6e
@ -317,8 +317,8 @@ static void sm_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *pa
|
||||
case ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION:
|
||||
printf("Re-encryption failed, disconnected\n");
|
||||
break;
|
||||
case ERROR_CODE_AUTHENTICATION_FAILURE:
|
||||
printf("Re-encryption failed, authentication failure\n\n");
|
||||
case ERROR_CODE_PIN_OR_KEY_MISSING:
|
||||
printf("Re-encryption failed, bonding information missing\n\n");
|
||||
printf("Assuming remote lost bonding information\n");
|
||||
printf("Deleting local bonding information and start new pairing...\n");
|
||||
sm_event_reencryption_complete_get_address(packet, addr);
|
||||
|
@ -180,6 +180,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
|
||||
hci_con_handle_t con_handle;
|
||||
bd_addr_t addr;
|
||||
bd_addr_type_t addr_type;
|
||||
uint8_t status;
|
||||
|
||||
switch (hci_event_packet_get_type(packet)) {
|
||||
@ -265,8 +266,13 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
|
||||
case ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION:
|
||||
printf("Re-encryption failed, disconnected\n");
|
||||
break;
|
||||
case ERROR_CODE_AUTHENTICATION_FAILURE:
|
||||
printf("Re-encryption failed, authentication failure\n");
|
||||
case ERROR_CODE_PIN_OR_KEY_MISSING:
|
||||
printf("Re-encryption failed, bonding information missing\n\n");
|
||||
printf("Assuming remote lost bonding information\n");
|
||||
printf("Deleting local bonding information to allow for new pairing...\n");
|
||||
sm_event_reencryption_complete_get_address(packet, addr);
|
||||
addr_type = sm_event_reencryption_started_get_addr_type(packet);
|
||||
gap_delete_bonding(addr_type, addr);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user