diff options
author | tonyfreeman <24860049+tonyfreeman@users.noreply.github.com> | 2021-09-21 12:34:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-21 12:34:16 +0300 |
commit | 69f54973cc5d6fea506e64912460333753efb05b (patch) | |
tree | e7505ee8c05446a205bd6f01ad60af3bc6aa4d6d /applications/nfc | |
parent | 9b0aa0d6dce38b0258409e1ba15133f01f6b2db5 (diff) |
Nfc: fix incorrect type castings. Global: fix printf usage, types casting, overall cleanup. Drivers: incorrect array index in cc1101 driver. (#713)
* fix 'function cannot return qualified void/bool type'
* Fix variable 'consumed' is used uninitialized
* Fix format string is not a string literal (potentially insecure)
* Fix conflicting types for 'menu_item_get_type'
* Fix implicit conversion from enumeration type 'NfcDeviceType' to different enumeration type 'rfalNfcDevType'
* Fix hal_gpio_init incorrect arguments order
* Fix nfc->dev.dev_name condition will always evaluate to 'true'
* Fix explicitly assigning value of variable to itself
* Fix furi_hal_bt_wait_startup counter overflow
* Fix implicit conversion from 'StorageStatus' to 'SDError'
* Remove #include <sys/param.h>
* Add FIXME
* Fix syntax
* Fixup for 'furi_hal_bt_wait_startup counter overflow'
* nfc: fix different nfc device types
* Drivers: fix incorrect offset in cc1101_read_fifo
* Remove obsolete comment
Co-authored-by: Tony Freeman <tonyfreeman@users.noreply.github.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
Diffstat (limited to 'applications/nfc')
31 files changed, 104 insertions, 90 deletions
diff --git a/applications/nfc/nfc_cli.c b/applications/nfc/nfc_cli.c index 0326048a..22325103 100755 --- a/applications/nfc/nfc_cli.c +++ b/applications/nfc/nfc_cli.c @@ -27,7 +27,7 @@ void nfc_cli_detect(Cli* cli, string_t args, void* context) { if(dev_cnt > 0) { printf("Found %d devices\r\n", dev_cnt); for(uint8_t i = 0; i < dev_cnt; i++) { - printf("%d found: %s ", i + 1, nfc_get_dev_type(dev_list[i].type)); + printf("%d found: %s ", i + 1, nfc_get_rfal_type(dev_list[i].type)); if(dev_list[i].type == RFAL_NFC_LISTEN_TYPE_NFCA) { printf("type: %s, ", nfc_get_nfca_type(dev_list[i].dev.nfca.type)); } diff --git a/applications/nfc/nfc_types.h b/applications/nfc/nfc_types.h index 46899b6d..6c37076a 100644 --- a/applications/nfc/nfc_types.h +++ b/applications/nfc/nfc_types.h @@ -6,19 +6,33 @@ #include <gui/view_dispatcher.h> #include "nfc_worker.h" -static inline const char* nfc_get_dev_type(rfalNfcDevType type) { +static inline const char* nfc_get_rfal_type(rfalNfcDevType type) { if(type == RFAL_NFC_LISTEN_TYPE_NFCA) { - return "NFC-A may be:"; + return "NFC-A"; } else if(type == RFAL_NFC_LISTEN_TYPE_NFCB) { - return "NFC-B may be:"; + return "NFC-B"; } else if(type == RFAL_NFC_LISTEN_TYPE_NFCF) { - return "NFC-F may be:"; + return "NFC-F"; } else if(type == RFAL_NFC_LISTEN_TYPE_NFCV) { - return "NFC-V may be:"; + return "NFC-V"; } else if(type == RFAL_NFC_LISTEN_TYPE_ST25TB) { - return "NFC-ST25TB may be:"; + return "NFC-ST25TB"; } else if(type == RFAL_NFC_LISTEN_TYPE_AP2P) { - return "NFC-AP2P may be:"; + return "NFC-AP2P"; + } else { + return "Unknown"; + } +} + +static inline const char* nfc_get_dev_type(NfcDeviceType type) { + if(type == NfcDeviceNfca) { + return "NFC-A may be:"; + } else if(type == NfcDeviceNfcb) { + return "NFC-B may be:"; + } else if(type == NfcDeviceNfcf) { + return "NFC-F may be:"; + } else if(type == NfcDeviceNfcv) { + return "NFC-V may be:"; } else { return "Unknown"; } diff --git a/applications/nfc/scenes/nfc_scene_card_menu.c b/applications/nfc/scenes/nfc_scene_card_menu.c index f58c212e..dbaefe4f 100755 --- a/applications/nfc/scenes/nfc_scene_card_menu.c +++ b/applications/nfc/scenes/nfc_scene_card_menu.c @@ -13,7 +13,7 @@ void nfc_scene_card_menu_submenu_callback(void* context, uint32_t index) { view_dispatcher_send_custom_event(nfc->view_dispatcher, index); } -const void nfc_scene_card_menu_on_enter(void* context) { +void nfc_scene_card_menu_on_enter(void* context) { Nfc* nfc = (Nfc*)context; Submenu* submenu = nfc->submenu; @@ -41,7 +41,7 @@ const void nfc_scene_card_menu_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); } -const bool nfc_scene_card_menu_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_card_menu_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -78,7 +78,7 @@ const bool nfc_scene_card_menu_on_event(void* context, SceneManagerEvent event) return false; } -const void nfc_scene_card_menu_on_exit(void* context) { +void nfc_scene_card_menu_on_exit(void* context) { Nfc* nfc = (Nfc*)context; submenu_clean(nfc->submenu); diff --git a/applications/nfc/scenes/nfc_scene_delete.c b/applications/nfc/scenes/nfc_scene_delete.c index 5c6fe254..993e1e37 100755 --- a/applications/nfc/scenes/nfc_scene_delete.c +++ b/applications/nfc/scenes/nfc_scene_delete.c @@ -66,7 +66,7 @@ void nfc_scene_delete_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget); } -const bool nfc_scene_delete_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_delete_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -85,7 +85,7 @@ const bool nfc_scene_delete_on_event(void* context, SceneManagerEvent event) { return false; } -const void nfc_scene_delete_on_exit(void* context) { +void nfc_scene_delete_on_exit(void* context) { Nfc* nfc = (Nfc*)context; widget_clear(nfc->widget); diff --git a/applications/nfc/scenes/nfc_scene_delete_success.c b/applications/nfc/scenes/nfc_scene_delete_success.c index 51328a0a..96e70693 100755 --- a/applications/nfc/scenes/nfc_scene_delete_success.c +++ b/applications/nfc/scenes/nfc_scene_delete_success.c @@ -7,7 +7,7 @@ void nfc_scene_delete_success_popup_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SAVE_SUCCESS_CUSTOM_EVENT); } -const void nfc_scene_delete_success_on_enter(void* context) { +void nfc_scene_delete_success_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -21,7 +21,7 @@ const void nfc_scene_delete_success_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup); } -const bool nfc_scene_delete_success_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_delete_success_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -33,7 +33,7 @@ const bool nfc_scene_delete_success_on_event(void* context, SceneManagerEvent ev return false; } -const void nfc_scene_delete_success_on_exit(void* context) { +void nfc_scene_delete_success_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clear view diff --git a/applications/nfc/scenes/nfc_scene_device_info.c b/applications/nfc/scenes/nfc_scene_device_info.c index 43082dcf..0b0067c0 100755 --- a/applications/nfc/scenes/nfc_scene_device_info.c +++ b/applications/nfc/scenes/nfc_scene_device_info.c @@ -127,7 +127,7 @@ void nfc_scene_device_info_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget); } -const bool nfc_scene_device_info_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_device_info_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = context; bool consumed = false; uint32_t state = scene_manager_get_scene_state(nfc->scene_manager, NfcSceneDeviceInfo); @@ -162,7 +162,7 @@ const bool nfc_scene_device_info_on_event(void* context, SceneManagerEvent event return consumed; } -const void nfc_scene_device_info_on_exit(void* context) { +void nfc_scene_device_info_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clear Custom Widget diff --git a/applications/nfc/scenes/nfc_scene_emulate_apdu_sequence.c b/applications/nfc/scenes/nfc_scene_emulate_apdu_sequence.c index 70288054..b08660b3 100644 --- a/applications/nfc/scenes/nfc_scene_emulate_apdu_sequence.c +++ b/applications/nfc/scenes/nfc_scene_emulate_apdu_sequence.c @@ -1,6 +1,6 @@ #include "../nfc_i.h" -const void nfc_scene_emulate_apdu_sequence_on_enter(void* context) { +void nfc_scene_emulate_apdu_sequence_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -14,7 +14,7 @@ const void nfc_scene_emulate_apdu_sequence_on_enter(void* context) { nfc_worker_start(nfc->worker, NfcWorkerStateEmulateApdu, &nfc->dev.dev_data, NULL, nfc); } -const bool nfc_scene_emulate_apdu_sequence_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_emulate_apdu_sequence_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeTick) { @@ -24,7 +24,7 @@ const bool nfc_scene_emulate_apdu_sequence_on_event(void* context, SceneManagerE return false; } -const void nfc_scene_emulate_apdu_sequence_on_exit(void* context) { +void nfc_scene_emulate_apdu_sequence_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Stop worker diff --git a/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c b/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c index d1d52bef..cba09437 100755 --- a/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c +++ b/applications/nfc/scenes/nfc_scene_emulate_mifare_ul.c @@ -9,7 +9,7 @@ void nfc_emulate_mifare_ul_worker_callback(void* context) { nfc->scene_manager, NfcSceneEmulateMifareUl, NFC_MF_UL_DATA_CHANGED); } -const void nfc_scene_emulate_mifare_ul_on_enter(void* context) { +void nfc_scene_emulate_mifare_ul_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -30,7 +30,7 @@ const void nfc_scene_emulate_mifare_ul_on_enter(void* context) { nfc); } -const bool nfc_scene_emulate_mifare_ul_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_emulate_mifare_ul_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; bool consumed = false; @@ -52,7 +52,7 @@ const bool nfc_scene_emulate_mifare_ul_on_event(void* context, SceneManagerEvent return consumed; } -const void nfc_scene_emulate_mifare_ul_on_exit(void* context) { +void nfc_scene_emulate_mifare_ul_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clear view diff --git a/applications/nfc/scenes/nfc_scene_emulate_uid.c b/applications/nfc/scenes/nfc_scene_emulate_uid.c index 3810bec4..ccd27de5 100755 --- a/applications/nfc/scenes/nfc_scene_emulate_uid.c +++ b/applications/nfc/scenes/nfc_scene_emulate_uid.c @@ -1,6 +1,6 @@ #include "../nfc_i.h" -const void nfc_scene_emulate_uid_on_enter(void* context) { +void nfc_scene_emulate_uid_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -35,7 +35,7 @@ const void nfc_scene_emulate_uid_on_enter(void* context) { nfc_worker_start(nfc->worker, NfcWorkerStateEmulate, &nfc->dev.dev_data, NULL, nfc); } -const bool nfc_scene_emulate_uid_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_emulate_uid_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeTick) { @@ -45,7 +45,7 @@ const bool nfc_scene_emulate_uid_on_event(void* context, SceneManagerEvent event return false; } -const void nfc_scene_emulate_uid_on_exit(void* context) { +void nfc_scene_emulate_uid_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Stop worker diff --git a/applications/nfc/scenes/nfc_scene_file_select.c b/applications/nfc/scenes/nfc_scene_file_select.c index e75872a3..67894fbf 100755 --- a/applications/nfc/scenes/nfc_scene_file_select.c +++ b/applications/nfc/scenes/nfc_scene_file_select.c @@ -1,6 +1,6 @@ #include "../nfc_i.h" -const void nfc_scene_file_select_on_enter(void* context) { +void nfc_scene_file_select_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Process file_select return if(nfc_file_select(&nfc->dev)) { @@ -10,9 +10,9 @@ const void nfc_scene_file_select_on_enter(void* context) { } } -const bool nfc_scene_file_select_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_file_select_on_event(void* context, SceneManagerEvent event) { return false; } -const void nfc_scene_file_select_on_exit(void* context) { +void nfc_scene_file_select_on_exit(void* context) { } diff --git a/applications/nfc/scenes/nfc_scene_mifare_ul_menu.c b/applications/nfc/scenes/nfc_scene_mifare_ul_menu.c index 70716618..5c31ab2c 100755 --- a/applications/nfc/scenes/nfc_scene_mifare_ul_menu.c +++ b/applications/nfc/scenes/nfc_scene_mifare_ul_menu.c @@ -11,7 +11,7 @@ void nfc_scene_mifare_ul_menu_submenu_callback(void* context, uint32_t index) { view_dispatcher_send_custom_event(nfc->view_dispatcher, index); } -const void nfc_scene_mifare_ul_menu_on_enter(void* context) { +void nfc_scene_mifare_ul_menu_on_enter(void* context) { Nfc* nfc = (Nfc*)context; Submenu* submenu = nfc->submenu; @@ -25,7 +25,7 @@ const void nfc_scene_mifare_ul_menu_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); } -const bool nfc_scene_mifare_ul_menu_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_mifare_ul_menu_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -49,7 +49,7 @@ const bool nfc_scene_mifare_ul_menu_on_event(void* context, SceneManagerEvent ev return false; } -const void nfc_scene_mifare_ul_menu_on_exit(void* context) { +void nfc_scene_mifare_ul_menu_on_exit(void* context) { Nfc* nfc = (Nfc*)context; submenu_clean(nfc->submenu); diff --git a/applications/nfc/scenes/nfc_scene_not_implemented.c b/applications/nfc/scenes/nfc_scene_not_implemented.c index f23bbe4a..3167f9c0 100644 --- a/applications/nfc/scenes/nfc_scene_not_implemented.c +++ b/applications/nfc/scenes/nfc_scene_not_implemented.c @@ -6,7 +6,7 @@ void nfc_scene_not_implemented_dialog_callback(DialogExResult result, void* cont view_dispatcher_send_custom_event(nfc->view_dispatcher, result); } -const void nfc_scene_not_implemented_on_enter(void* context) { +void nfc_scene_not_implemented_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // TODO Set data from worker @@ -19,7 +19,7 @@ const void nfc_scene_not_implemented_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); } -const bool nfc_scene_not_implemented_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_not_implemented_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -30,7 +30,7 @@ const bool nfc_scene_not_implemented_on_event(void* context, SceneManagerEvent e return false; } -const void nfc_scene_not_implemented_on_exit(void* context) { +void nfc_scene_not_implemented_on_exit(void* context) { Nfc* nfc = (Nfc*)context; DialogEx* dialog_ex = nfc->dialog_ex; diff --git a/applications/nfc/scenes/nfc_scene_read_card.c b/applications/nfc/scenes/nfc_scene_read_card.c index 4b32c36d..fda69b05 100755 --- a/applications/nfc/scenes/nfc_scene_read_card.c +++ b/applications/nfc/scenes/nfc_scene_read_card.c @@ -7,7 +7,7 @@ void nfc_read_card_worker_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_CARD_CUSTOM_EVENT); } -const void nfc_scene_read_card_on_enter(void* context) { +void nfc_scene_read_card_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -21,7 +21,7 @@ const void nfc_scene_read_card_on_enter(void* context) { nfc->worker, NfcWorkerStateDetect, &nfc->dev.dev_data, nfc_read_card_worker_callback, nfc); } -const bool nfc_scene_read_card_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_read_card_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -36,7 +36,7 @@ const bool nfc_scene_read_card_on_event(void* context, SceneManagerEvent event) return false; } -const void nfc_scene_read_card_on_exit(void* context) { +void nfc_scene_read_card_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Stop worker diff --git a/applications/nfc/scenes/nfc_scene_read_card_success.c b/applications/nfc/scenes/nfc_scene_read_card_success.c index 93223a70..b745eae3 100755 --- a/applications/nfc/scenes/nfc_scene_read_card_success.c +++ b/applications/nfc/scenes/nfc_scene_read_card_success.c @@ -63,7 +63,7 @@ void nfc_scene_read_card_success_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); } -const bool nfc_scene_read_card_success_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_read_card_success_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -77,7 +77,7 @@ const bool nfc_scene_read_card_success_on_event(void* context, SceneManagerEvent return false; } -const void nfc_scene_read_card_success_on_exit(void* context) { +void nfc_scene_read_card_success_on_exit(void* context) { Nfc* nfc = (Nfc*)context; DialogEx* dialog_ex = nfc->dialog_ex; diff --git a/applications/nfc/scenes/nfc_scene_read_emv_app.c b/applications/nfc/scenes/nfc_scene_read_emv_app.c index ae00431b..d0198791 100755 --- a/applications/nfc/scenes/nfc_scene_read_emv_app.c +++ b/applications/nfc/scenes/nfc_scene_read_emv_app.c @@ -7,7 +7,7 @@ void nfc_read_emv_app_worker_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_EMV_APP_CUSTOM_EVENT); } -const void nfc_scene_read_emv_app_on_enter(void* context) { +void nfc_scene_read_emv_app_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -25,7 +25,7 @@ const void nfc_scene_read_emv_app_on_enter(void* context) { nfc); } -const bool nfc_scene_read_emv_app_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_read_emv_app_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -40,7 +40,7 @@ const bool nfc_scene_read_emv_app_on_event(void* context, SceneManagerEvent even return false; } -const void nfc_scene_read_emv_app_on_exit(void* context) { +void nfc_scene_read_emv_app_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Stop worker diff --git a/applications/nfc/scenes/nfc_scene_read_emv_app_success.c b/applications/nfc/scenes/nfc_scene_read_emv_app_success.c index dc95bfe6..a3371086 100755 --- a/applications/nfc/scenes/nfc_scene_read_emv_app_success.c +++ b/applications/nfc/scenes/nfc_scene_read_emv_app_success.c @@ -45,7 +45,7 @@ void nfc_scene_read_emv_app_success_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); } -const bool nfc_scene_read_emv_app_success_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_read_emv_app_success_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -59,7 +59,7 @@ const bool nfc_scene_read_emv_app_success_on_event(void* context, SceneManagerEv return false; } -const void nfc_scene_read_emv_app_success_on_exit(void* context) { +void nfc_scene_read_emv_app_success_on_exit(void* context) { Nfc* nfc = (Nfc*)context; DialogEx* dialog_ex = nfc->dialog_ex; diff --git a/applications/nfc/scenes/nfc_scene_read_emv_data.c b/applications/nfc/scenes/nfc_scene_read_emv_data.c index 0aeb6fe0..44389e5a 100644 --- a/applications/nfc/scenes/nfc_scene_read_emv_data.c +++ b/applications/nfc/scenes/nfc_scene_read_emv_data.c @@ -7,7 +7,7 @@ void nfc_read_emv_data_worker_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_EMV_DATA_CUSTOM_EVENT); } -const void nfc_scene_read_emv_data_on_enter(void* context) { +void nfc_scene_read_emv_data_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -27,7 +27,7 @@ const void nfc_scene_read_emv_data_on_enter(void* context) { nfc); } -const bool nfc_scene_read_emv_data_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_read_emv_data_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -42,7 +42,7 @@ const bool nfc_scene_read_emv_data_on_event(void* context, SceneManagerEvent eve return false; } -const void nfc_scene_read_emv_data_on_exit(void* context) { +void nfc_scene_read_emv_data_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Stop worker diff --git a/applications/nfc/scenes/nfc_scene_read_emv_data_success.c b/applications/nfc/scenes/nfc_scene_read_emv_data_success.c index c0b61111..8a98f5ae 100755 --- a/applications/nfc/scenes/nfc_scene_read_emv_data_success.c +++ b/applications/nfc/scenes/nfc_scene_read_emv_data_success.c @@ -113,7 +113,7 @@ void nfc_scene_read_emv_data_success_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewWidget); } -const bool nfc_scene_read_emv_data_success_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_read_emv_data_success_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -132,7 +132,7 @@ const bool nfc_scene_read_emv_data_success_on_event(void* context, SceneManagerE return false; } -const void nfc_scene_read_emv_data_success_on_exit(void* context) { +void nfc_scene_read_emv_data_success_on_exit(void* context) { Nfc* nfc = (Nfc*)context; widget_clear(nfc->widget); diff --git a/applications/nfc/scenes/nfc_scene_read_mifare_ul.c b/applications/nfc/scenes/nfc_scene_read_mifare_ul.c index d1997d51..95e890b5 100755 --- a/applications/nfc/scenes/nfc_scene_read_mifare_ul.c +++ b/applications/nfc/scenes/nfc_scene_read_mifare_ul.c @@ -7,7 +7,7 @@ void nfc_read_mifare_ul_worker_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_READ_MIFARE_UL_CUSTOM_EVENT); } -const void nfc_scene_read_mifare_ul_on_enter(void* context) { +void nfc_scene_read_mifare_ul_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -25,7 +25,7 @@ const void nfc_scene_read_mifare_ul_on_enter(void* context) { nfc); } -const bool nfc_scene_read_mifare_ul_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_read_mifare_ul_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -40,7 +40,7 @@ const bool nfc_scene_read_mifare_ul_on_event(void* context, SceneManagerEvent ev return false; } -const void nfc_scene_read_mifare_ul_on_exit(void* context) { +void nfc_scene_read_mifare_ul_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Stop worker diff --git a/applications/nfc/scenes/nfc_scene_read_mifare_ul_success.c b/applications/nfc/scenes/nfc_scene_read_mifare_ul_success.c index c0a2a9f3..f1324dfa 100755 --- a/applications/nfc/scenes/nfc_scene_read_mifare_ul_success.c +++ b/applications/nfc/scenes/nfc_scene_read_mifare_ul_success.c @@ -20,7 +20,7 @@ void nfc_scene_read_mifare_ul_success_text_box_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, NFC_SCENE_READ_MF_UL_CUSTOM_EVENT); } -const void nfc_scene_read_mifare_ul_success_on_enter(void* context) { +void nfc_scene_read_mifare_ul_success_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Clear device name @@ -76,7 +76,7 @@ const void nfc_scene_read_mifare_ul_success_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); } -const bool nfc_scene_read_mifare_ul_success_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_read_mifare_ul_success_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -112,7 +112,7 @@ const bool nfc_scene_read_mifare_ul_success_on_event(void* context, SceneManager return false; } -const void nfc_scene_read_mifare_ul_success_on_exit(void* context) { +void nfc_scene_read_mifare_ul_success_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clean dialog diff --git a/applications/nfc/scenes/nfc_scene_restore_original.c b/applications/nfc/scenes/nfc_scene_restore_original.c index 3229d023..12481592 100644 --- a/applications/nfc/scenes/nfc_scene_restore_original.c +++ b/applications/nfc/scenes/nfc_scene_restore_original.c @@ -7,7 +7,7 @@ void nfc_scene_restore_original_popup_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_RESTORE_ORIGINAL_CUSTOM_EVENT); } -const void nfc_scene_restore_original_on_enter(void* context) { +void nfc_scene_restore_original_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -21,7 +21,7 @@ const void nfc_scene_restore_original_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup); } -const bool nfc_scene_restore_original_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_restore_original_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; bool consumed = false; @@ -33,7 +33,7 @@ const bool nfc_scene_restore_original_on_event(void* context, SceneManagerEvent return consumed; } -const void nfc_scene_restore_original_on_exit(void* context) { +void nfc_scene_restore_original_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clear view diff --git a/applications/nfc/scenes/nfc_scene_run_emv_app_confirm.c b/applications/nfc/scenes/nfc_scene_run_emv_app_confirm.c index 609ccfc5..7d12aa4b 100755 --- a/applications/nfc/scenes/nfc_scene_run_emv_app_confirm.c +++ b/applications/nfc/scenes/nfc_scene_run_emv_app_confirm.c @@ -28,7 +28,7 @@ void nfc_scene_run_emv_app_confirm_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewDialogEx); } -const bool nfc_scene_run_emv_app_confirm_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_run_emv_app_confirm_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -42,7 +42,7 @@ const bool nfc_scene_run_emv_app_confirm_on_event(void* context, SceneManagerEve return false; } -const void nfc_scene_run_emv_app_confirm_on_exit(void* context) { +void nfc_scene_run_emv_app_confirm_on_exit(void* context) { Nfc* nfc = (Nfc*)context; DialogEx* dialog_ex = nfc->dialog_ex; diff --git a/applications/nfc/scenes/nfc_scene_save_name.c b/applications/nfc/scenes/nfc_scene_save_name.c index ca239f68..dc0c48cd 100755 --- a/applications/nfc/scenes/nfc_scene_save_name.c +++ b/applications/nfc/scenes/nfc_scene_save_name.c @@ -9,7 +9,7 @@ void nfc_scene_save_name_text_input_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SAVE_NAME_CUSTOM_EVENT); } -const void nfc_scene_save_name_on_enter(void* context) { +void nfc_scene_save_name_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -32,12 +32,12 @@ const void nfc_scene_save_name_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewTextInput); } -const bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { if(event.event == SCENE_SAVE_NAME_CUSTOM_EVENT) { - if(nfc->dev.dev_name) { + if(strcmp(nfc->dev.dev_name, "")) { nfc_device_delete(&nfc->dev); } if(scene_manager_has_previous_scene(nfc->scene_manager, NfcSceneSetUid)) { @@ -56,7 +56,7 @@ const bool nfc_scene_save_name_on_event(void* context, SceneManagerEvent event) return false; } -const void nfc_scene_save_name_on_exit(void* context) { +void nfc_scene_save_name_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clear view diff --git a/applications/nfc/scenes/nfc_scene_save_success.c b/applications/nfc/scenes/nfc_scene_save_success.c index 058388b6..57b08b07 100755 --- a/applications/nfc/scenes/nfc_scene_save_success.c +++ b/applications/nfc/scenes/nfc_scene_save_success.c @@ -7,7 +7,7 @@ void nfc_scene_save_success_popup_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SAVE_SUCCESS_CUSTOM_EVENT); } -const void nfc_scene_save_success_on_enter(void* context) { +void nfc_scene_save_success_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -21,7 +21,7 @@ const void nfc_scene_save_success_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup); } -const bool nfc_scene_save_success_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_save_success_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; bool consumed = false; @@ -42,7 +42,7 @@ const bool nfc_scene_save_success_on_event(void* context, SceneManagerEvent even return consumed; } -const void nfc_scene_save_success_on_exit(void* context) { +void nfc_scene_save_success_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clear view diff --git a/applications/nfc/scenes/nfc_scene_saved_menu.c b/applications/nfc/scenes/nfc_scene_saved_menu.c index cd682783..a8e2ce7f 100755 --- a/applications/nfc/scenes/nfc_scene_saved_menu.c +++ b/applications/nfc/scenes/nfc_scene_saved_menu.c @@ -14,7 +14,7 @@ void nfc_scene_saved_menu_submenu_callback(void* context, uint32_t index) { view_dispatcher_send_custom_event(nfc->view_dispatcher, index); } -const void nfc_scene_saved_menu_on_enter(void* context) { +void nfc_scene_saved_menu_on_enter(void* context) { Nfc* nfc = (Nfc*)context; Submenu* submenu = nfc->submenu; @@ -42,7 +42,7 @@ const void nfc_scene_saved_menu_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); } -const bool nfc_scene_saved_menu_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_saved_menu_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; bool consumed = false; @@ -78,7 +78,7 @@ const bool nfc_scene_saved_menu_on_event(void* context, SceneManagerEvent event) return consumed; } -const void nfc_scene_saved_menu_on_exit(void* context) { +void nfc_scene_saved_menu_on_exit(void* context) { Nfc* nfc = (Nfc*)context; submenu_clean(nfc->submenu); diff --git a/applications/nfc/scenes/nfc_scene_scripts_menu.c b/applications/nfc/scenes/nfc_scene_scripts_menu.c index 327d32c6..c82c4564 100755 --- a/applications/nfc/scenes/nfc_scene_scripts_menu.c +++ b/applications/nfc/scenes/nfc_scene_scripts_menu.c @@ -11,7 +11,7 @@ void nfc_scene_scripts_menu_submenu_callback(void* context, uint32_t index) { view_dispatcher_send_custom_event(nfc->view_dispatcher, index); } -const void nfc_scene_scripts_menu_on_enter(void* context) { +void nfc_scene_scripts_menu_on_enter(void* context) { Nfc* nfc = (Nfc*)context; Submenu* submenu = nfc->submenu; @@ -32,7 +32,7 @@ const void nfc_scene_scripts_menu_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); } -const bool nfc_scene_scripts_menu_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_scripts_menu_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -52,7 +52,7 @@ const bool nfc_scene_scripts_menu_on_event(void* context, SceneManagerEvent even return false; } -const void nfc_scene_scripts_menu_on_exit(void* context) { +void nfc_scene_scripts_menu_on_exit(void* context) { Nfc* nfc = (Nfc*)context; submenu_clean(nfc->submenu); diff --git a/applications/nfc/scenes/nfc_scene_set_atqa.c b/applications/nfc/scenes/nfc_scene_set_atqa.c index 80ceea17..7936880c 100755 --- a/applications/nfc/scenes/nfc_scene_set_atqa.c +++ b/applications/nfc/scenes/nfc_scene_set_atqa.c @@ -8,7 +8,7 @@ void nfc_scene_set_atqa_byte_input_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SET_ATQA_CUSTOM_EVENT); } -const void nfc_scene_set_atqa_on_enter(void* context) { +void nfc_scene_set_atqa_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -24,7 +24,7 @@ const void nfc_scene_set_atqa_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput); } -const bool nfc_scene_set_atqa_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_set_atqa_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -36,7 +36,7 @@ const bool nfc_scene_set_atqa_on_event(void* context, SceneManagerEvent event) { return false; } -const void nfc_scene_set_atqa_on_exit(void* context) { +void nfc_scene_set_atqa_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clear view diff --git a/applications/nfc/scenes/nfc_scene_set_sak.c b/applications/nfc/scenes/nfc_scene_set_sak.c index 27646cc6..5df999d0 100755 --- a/applications/nfc/scenes/nfc_scene_set_sak.c +++ b/applications/nfc/scenes/nfc_scene_set_sak.c @@ -8,7 +8,7 @@ void nfc_scene_set_sak_byte_input_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SET_SAK_CUSTOM_EVENT); } -const void nfc_scene_set_sak_on_enter(void* context) { +void nfc_scene_set_sak_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -24,7 +24,7 @@ const void nfc_scene_set_sak_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput); } -const bool nfc_scene_set_sak_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_set_sak_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -36,7 +36,7 @@ const bool nfc_scene_set_sak_on_event(void* context, SceneManagerEvent event) { return false; } -const void nfc_scene_set_sak_on_exit(void* context) { +void nfc_scene_set_sak_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clear view diff --git a/applications/nfc/scenes/nfc_scene_set_type.c b/applications/nfc/scenes/nfc_scene_set_type.c index 9798b8f7..7574123f 100755 --- a/applications/nfc/scenes/nfc_scene_set_type.c +++ b/applications/nfc/scenes/nfc_scene_set_type.c @@ -11,7 +11,7 @@ void nfc_scene_set_type_submenu_callback(void* context, uint32_t index) { view_dispatcher_send_custom_event(nfc->view_dispatcher, index); } -const void nfc_scene_set_type_on_enter(void* context) { +void nfc_scene_set_type_on_enter(void* context) { Nfc* nfc = (Nfc*)context; Submenu* submenu = nfc->submenu; @@ -22,7 +22,7 @@ const void nfc_scene_set_type_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); } -const bool nfc_scene_set_type_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_set_type_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -41,7 +41,7 @@ const bool nfc_scene_set_type_on_event(void* context, SceneManagerEvent event) { return false; } -const void nfc_scene_set_type_on_exit(void* context) { +void nfc_scene_set_type_on_exit(void* context) { Nfc* nfc = (Nfc*)context; submenu_clean(nfc->submenu); diff --git a/applications/nfc/scenes/nfc_scene_set_uid.c b/applications/nfc/scenes/nfc_scene_set_uid.c index dd448a78..7ecfbf32 100755 --- a/applications/nfc/scenes/nfc_scene_set_uid.c +++ b/applications/nfc/scenes/nfc_scene_set_uid.c @@ -8,7 +8,7 @@ void nfc_scene_set_uid_byte_input_callback(void* context) { view_dispatcher_send_custom_event(nfc->view_dispatcher, SCENE_SET_UID_CUSTOM_EVENT); } -const void nfc_scene_set_uid_on_enter(void* context) { +void nfc_scene_set_uid_on_enter(void* context) { Nfc* nfc = (Nfc*)context; // Setup view @@ -25,7 +25,7 @@ const void nfc_scene_set_uid_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewByteInput); } -const bool nfc_scene_set_uid_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_set_uid_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; if(event.type == SceneManagerEventTypeCustom) { @@ -37,7 +37,7 @@ const bool nfc_scene_set_uid_on_event(void* context, SceneManagerEvent event) { return false; } -const void nfc_scene_set_uid_on_exit(void* context) { +void nfc_scene_set_uid_on_exit(void* context) { Nfc* nfc = (Nfc*)context; // Clear view diff --git a/applications/nfc/scenes/nfc_scene_start.c b/applications/nfc/scenes/nfc_scene_start.c index 3b560c07..cdf7dbe2 100755 --- a/applications/nfc/scenes/nfc_scene_start.c +++ b/applications/nfc/scenes/nfc_scene_start.c @@ -14,7 +14,7 @@ void nfc_scene_start_submenu_callback(void* context, uint32_t index) { view_dispatcher_send_custom_event(nfc->view_dispatcher, index); } -const void nfc_scene_start_on_enter(void* context) { +void nfc_scene_start_on_enter(void* context) { Nfc* nfc = (Nfc*)context; Submenu* submenu = nfc->submenu; @@ -38,7 +38,7 @@ const void nfc_scene_start_on_enter(void* context) { view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewMenu); } -const bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) { +bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) { Nfc* nfc = (Nfc*)context; bool consumed = false; @@ -70,7 +70,7 @@ const bool nfc_scene_start_on_event(void* context, SceneManagerEvent event) { return consumed; } -const void nfc_scene_start_on_exit(void* context) { +void nfc_scene_start_on_exit(void* context) { Nfc* nfc = (Nfc*)context; submenu_clean(nfc->submenu); |