Automatically accepts PIN verif when GapPairingNone was selected, but the remote host refused the non-auth pairing and switched to numeric comparaison ethod (pin verif yes or no)

This commit is contained in:
yocvito
2023-01-30 21:32:55 +01:00
parent 9fa8843025
commit cf89c9db89

View File

@@ -77,6 +77,9 @@ static void bt_pin_code_hide(Bt* bt) {
static bool bt_pin_code_verify_event_handler(Bt* bt, uint32_t pin) { static bool bt_pin_code_verify_event_handler(Bt* bt, uint32_t pin) {
furi_assert(bt); furi_assert(bt);
if (bt_get_profile_pairing_method(bt) == GapPairingNone)
return true;
notification_message(bt->notification, &sequence_display_backlight_on); notification_message(bt->notification, &sequence_display_backlight_on);
FuriString* pin_str; FuriString* pin_str;
dialog_message_set_icon(bt->dialog_message, XTREME_ASSETS()->I_BLE_Pairing_128x64, 0, 0); dialog_message_set_icon(bt->dialog_message, XTREME_ASSETS()->I_BLE_Pairing_128x64, 0, 0);
@@ -86,6 +89,7 @@ static bool bt_pin_code_verify_event_handler(Bt* bt, uint32_t pin) {
dialog_message_set_buttons(bt->dialog_message, "Cancel", "OK", NULL); dialog_message_set_buttons(bt->dialog_message, "Cancel", "OK", NULL);
DialogMessageButton button = dialog_message_show(bt->dialogs, bt->dialog_message); DialogMessageButton button = dialog_message_show(bt->dialogs, bt->dialog_message);
furi_string_free(pin_str); furi_string_free(pin_str);
return button == DialogMessageButtonCenter; return button == DialogMessageButtonCenter;
} }