mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-06-13 19:43:34 -07:00
MRTD popup "PACE todo"
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user