mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-24 13:43:38 +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:
|
case ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION:
|
||||||
printf("Re-encryption failed, disconnected\n");
|
printf("Re-encryption failed, disconnected\n");
|
||||||
break;
|
break;
|
||||||
case ERROR_CODE_AUTHENTICATION_FAILURE:
|
case ERROR_CODE_PIN_OR_KEY_MISSING:
|
||||||
printf("Re-encryption failed, authentication failure\n\n");
|
printf("Re-encryption failed, bonding information missing\n\n");
|
||||||
printf("Assuming remote lost bonding information\n");
|
printf("Assuming remote lost bonding information\n");
|
||||||
printf("Deleting local bonding information and start new pairing...\n");
|
printf("Deleting local bonding information and start new pairing...\n");
|
||||||
sm_event_reencryption_complete_get_address(packet, addr);
|
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;
|
hci_con_handle_t con_handle;
|
||||||
bd_addr_t addr;
|
bd_addr_t addr;
|
||||||
|
bd_addr_type_t addr_type;
|
||||||
uint8_t status;
|
uint8_t status;
|
||||||
|
|
||||||
switch (hci_event_packet_get_type(packet)) {
|
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:
|
case ERROR_CODE_REMOTE_USER_TERMINATED_CONNECTION:
|
||||||
printf("Re-encryption failed, disconnected\n");
|
printf("Re-encryption failed, disconnected\n");
|
||||||
break;
|
break;
|
||||||
case ERROR_CODE_AUTHENTICATION_FAILURE:
|
case ERROR_CODE_PIN_OR_KEY_MISSING:
|
||||||
printf("Re-encryption failed, authentication failure\n");
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user