From 0ddb14614643bf8e26e7c2625f19254e4c5e2c39 Mon Sep 17 00:00:00 2001 From: MMX <10697207+xMasterX@users.noreply.github.com> Date: Thu, 1 Feb 2024 05:49:09 +0300 Subject: [PATCH 1/2] Add Clearing of detected protocols list in nfc_scene_start --- applications/main/nfc/scenes/nfc_scene_start.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/main/nfc/scenes/nfc_scene_start.c b/applications/main/nfc/scenes/nfc_scene_start.c index c923226fc7e..63ed8373edd 100644 --- a/applications/main/nfc/scenes/nfc_scene_start.c +++ b/applications/main/nfc/scenes/nfc_scene_start.c @@ -24,6 +24,9 @@ void nfc_scene_start_on_enter(void* context) { furi_string_reset(nfc->file_name); nfc_device_clear(nfc->nfc_device); iso14443_3a_reset(nfc->iso14443_3a_edit_data); + // Clear detected protocols list + memset(nfc->protocols_detected, NfcProtocolIso14443_3a, NfcProtocolNum); + nfc_app_reset_detected_protocols(nfc); submenu_add_item(submenu, "Read", SubmenuIndexRead, nfc_scene_start_submenu_callback, nfc); submenu_add_item( From ad6d82652aeaf6b67cb0fe96d10003f94dc757fb Mon Sep 17 00:00:00 2001 From: MMX <10697207+xMasterX@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:29:37 +0300 Subject: [PATCH 2/2] Apply patch --- .../main/nfc/helpers/protocol_support/nfc_protocol_support.c | 3 +-- applications/main/nfc/scenes/nfc_scene_start.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c b/applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c index c87ee613f56..da75142ba05 100644 --- a/applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c +++ b/applications/main/nfc/helpers/protocol_support/nfc_protocol_support.c @@ -521,8 +521,7 @@ static bool scene_manager_has_previous_scene(instance->scene_manager, NfcSceneSetType) ? DolphinDeedNfcAddSave : DolphinDeedNfcSave); - const NfcProtocol protocol = - instance->protocols_detected[instance->protocols_detected_selected_idx]; + const NfcProtocol protocol = nfc_device_get_protocol(instance->nfc_device); consumed = nfc_protocol_support[protocol]->scene_save_name.on_event( instance, event.event); } else { diff --git a/applications/main/nfc/scenes/nfc_scene_start.c b/applications/main/nfc/scenes/nfc_scene_start.c index 63ed8373edd..e8774b4aa5a 100644 --- a/applications/main/nfc/scenes/nfc_scene_start.c +++ b/applications/main/nfc/scenes/nfc_scene_start.c @@ -24,8 +24,7 @@ void nfc_scene_start_on_enter(void* context) { furi_string_reset(nfc->file_name); nfc_device_clear(nfc->nfc_device); iso14443_3a_reset(nfc->iso14443_3a_edit_data); - // Clear detected protocols list - memset(nfc->protocols_detected, NfcProtocolIso14443_3a, NfcProtocolNum); + // Reset detected protocols list nfc_app_reset_detected_protocols(nfc); submenu_add_item(submenu, "Read", SubmenuIndexRead, nfc_scene_start_submenu_callback, nfc);