diff options
author | gornekich <n.gorbadey@gmail.com> | 2021-09-02 12:28:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-02 12:28:40 +0300 |
commit | 4b7d9b79a98253d199d92cf6375e86eedfec365e (patch) | |
tree | b1e005ab60ef512ed48e83cb5fbdb809f0cf14a5 /applications/nfc | |
parent | ae08c88bd6642bba88385c0396b58c977fdbb46a (diff) |
[FL-1748] NFC, iButton edit fix (#680)
* nfc: fix edit UID without confirmation
* ibutton: fix key edit
* nfc: fix nfc uid edition
* nfc: fix structure type name
Diffstat (limited to 'applications/nfc')
-rwxr-xr-x | applications/nfc/nfc_i.h | 1 | ||||
-rwxr-xr-x | applications/nfc/scenes/nfc_scene_save_name.c | 3 | ||||
-rwxr-xr-x | applications/nfc/scenes/nfc_scene_set_uid.c | 5 |
3 files changed, 7 insertions, 2 deletions
diff --git a/applications/nfc/nfc_i.h b/applications/nfc/nfc_i.h index 54b68231..53fd6689 100755 --- a/applications/nfc/nfc_i.h +++ b/applications/nfc/nfc_i.h @@ -35,6 +35,7 @@ struct Nfc { NotificationApp* notifications; SceneManager* scene_manager; NfcDevice dev; + NfcDeviceCommonData dev_edit_data; char text_store[NFC_TEXT_STORE_SIZE + 1]; string_t text_box_store; diff --git a/applications/nfc/scenes/nfc_scene_save_name.c b/applications/nfc/scenes/nfc_scene_save_name.c index 4a0041b2..ca239f68 100755 --- a/applications/nfc/scenes/nfc_scene_save_name.c +++ b/applications/nfc/scenes/nfc_scene_save_name.c @@ -40,6 +40,9 @@ const bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event) if(nfc->dev.dev_name) { nfc_device_delete(&nfc->dev); } + if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetUid)) { + nfc->dev.dev_data.nfc_data = nfc->dev_edit_data; + } memcpy(&nfc->dev.dev_name, nfc->text_store, strlen(nfc->text_store)); if(nfc_device_save(&nfc->dev, nfc->text_store)) { scene_manager_next_scene(nfc->scene_manager, NfcSceneSaveSuccess); diff --git a/applications/nfc/scenes/nfc_scene_set_uid.c b/applications/nfc/scenes/nfc_scene_set_uid.c index 6e1a8d7c..dd448a78 100755 --- a/applications/nfc/scenes/nfc_scene_set_uid.c +++ b/applications/nfc/scenes/nfc_scene_set_uid.c @@ -14,13 +14,14 @@ const void nfc_scene_set_uid_on_enter(void* context) { // Setup view ByteInput* byte_input = nfc->byte_input; byte_input_set_header_text(byte_input, "Enter uid in hex"); + nfc->dev_edit_data = nfc->dev.dev_data.nfc_data; byte_input_set_result_callback( byte_input, nfc_scene_set_uid_byte_input_callback, NULL, nfc, - nfc->dev.dev_data.nfc_data.uid, - nfc->dev.dev_data.nfc_data.uid_len); + nfc->dev_edit_data.uid, + nfc->dev_edit_data.uid_len); view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput); } |