diff --git a/applications/nfc/scenes/nfc_scene_config.h b/applications/nfc/scenes/nfc_scene_config.h index 9a20de3b8..711281093 100644 --- a/applications/nfc/scenes/nfc_scene_config.h +++ b/applications/nfc/scenes/nfc_scene_config.h @@ -37,9 +37,9 @@ ADD_SCENE(nfc, emv_read_success, EmvReadSuccess) ADD_SCENE(nfc, emv_menu, EmvMenu) ADD_SCENE(nfc, passport_read, PassportReadSuccess) ADD_SCENE(nfc, passport_menu, PassportMenu) -ADD_SCENE(nfc, passport_bac, PassportBac) -//ADD_SCENE(nfc, passport_pace, PassportPace) +ADD_SCENE(nfc, passport_bac, PassportBac) //TODO: rename to Auth ADD_SCENE(nfc, passport_date, PassportDate) +ADD_SCENE(nfc, passport_pace_todo, PassportPaceTodo) ADD_SCENE(nfc, emulate_apdu_sequence, EmulateApduSequence) ADD_SCENE(nfc, device_info, DeviceInfo) ADD_SCENE(nfc, delete, Delete) diff --git a/applications/nfc/scenes/nfc_scene_passport_bac.c b/applications/nfc/scenes/nfc_scene_passport_bac.c index 379fea4f5..bc27a91f5 100644 --- a/applications/nfc/scenes/nfc_scene_passport_bac.c +++ b/applications/nfc/scenes/nfc_scene_passport_bac.c @@ -100,6 +100,9 @@ bool nfc_scene_passport_bac_on_event(void* context, SceneManagerEvent event) { consumed = true; break; case NfcScenePassportAuthSelectAuth: + if(nfc->dev->dev_data.mrtd_data.auth.method == MrtdAuthMethodPace) { + scene_manager_next_scene(nfc->scene_manager, NfcScenePassportPaceTodo); + } consumed = true; break; } diff --git a/applications/nfc/scenes/nfc_scene_passport_pace_todo.c b/applications/nfc/scenes/nfc_scene_passport_pace_todo.c new file mode 100644 index 000000000..92dfaed97 --- /dev/null +++ b/applications/nfc/scenes/nfc_scene_passport_pace_todo.c @@ -0,0 +1,40 @@ +#include "../nfc_i.h" + +void nfc_scene_passport_pace_todo_popup_callback(void* context) { + Nfc* nfc = context; + view_dispatcher_send_custom_event(nfc->view_dispatcher, NfcCustomEventViewExit); +} + +void nfc_scene_passport_pace_todo_on_enter(void* context) { + Nfc* nfc = context; + + // Setup view + Popup* popup = nfc->popup; + popup_set_icon(popup, 0, 2, &I_DolphinCommon_56x48); + popup_set_header(popup, "PACE not yet implemented", 0, 19, AlignLeft, AlignBottom); + popup_set_timeout(popup, 2000); + popup_set_context(popup, nfc); + popup_set_callback(popup, nfc_scene_passport_pace_todo_popup_callback); + popup_enable_timeout(popup); + view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup); +} + +bool nfc_scene_passport_pace_todo_on_event(void* context, SceneManagerEvent event) { + Nfc* nfc = context; + bool consumed = false; + + if(event.type == SceneManagerEventTypeCustom) { + if(event.event == NfcCustomEventViewExit) { + consumed = scene_manager_search_and_switch_to_previous_scene( + nfc->scene_manager, NfcScenePassportBac); + } + } + return consumed; +} + +void nfc_scene_passport_pace_todo_on_exit(void* context) { + Nfc* nfc = context; + + // Clear view + popup_reset(nfc->popup); +}