2021-08-03 17:24:20 +00:00
|
|
|
#include "../nfc_i.h"
|
2022-06-13 01:08:28 +00:00
|
|
|
#include "furi/common_defines.h"
|
2021-08-03 17:24:20 +00:00
|
|
|
|
2021-09-21 09:34:16 +00:00
|
|
|
void nfc_scene_emulate_apdu_sequence_on_enter(void* context) {
|
2022-04-19 15:23:58 +00:00
|
|
|
Nfc* nfc = context;
|
2021-08-03 17:24:20 +00:00
|
|
|
|
|
|
|
// Setup view
|
|
|
|
Popup* popup = nfc->popup;
|
|
|
|
popup_set_header(popup, "Run APDU reader", 64, 31, AlignCenter, AlignTop);
|
|
|
|
|
|
|
|
// Setup and start worker
|
|
|
|
view_dispatcher_switch_to_view(nfc->view_dispatcher, NfcViewPopup);
|
2021-11-08 21:55:06 +00:00
|
|
|
nfc_worker_start(nfc->worker, NfcWorkerStateEmulateApdu, &nfc->dev->dev_data, NULL, nfc);
|
2022-06-13 01:08:28 +00:00
|
|
|
|
|
|
|
nfc_blink_start(nfc);
|
2021-08-03 17:24:20 +00:00
|
|
|
}
|
|
|
|
|
2021-09-21 09:34:16 +00:00
|
|
|
bool nfc_scene_emulate_apdu_sequence_on_event(void* context, SceneManagerEvent event) {
|
2022-06-13 01:08:28 +00:00
|
|
|
UNUSED(context);
|
|
|
|
UNUSED(event);
|
2022-04-19 15:23:58 +00:00
|
|
|
bool consumed = false;
|
|
|
|
return consumed;
|
2021-08-03 17:24:20 +00:00
|
|
|
}
|
|
|
|
|
2021-09-21 09:34:16 +00:00
|
|
|
void nfc_scene_emulate_apdu_sequence_on_exit(void* context) {
|
2022-04-19 15:23:58 +00:00
|
|
|
Nfc* nfc = context;
|
2021-08-03 17:24:20 +00:00
|
|
|
|
|
|
|
// Stop worker
|
|
|
|
nfc_worker_stop(nfc->worker);
|
|
|
|
// Clear view
|
2022-04-19 15:23:58 +00:00
|
|
|
popup_reset(nfc->popup);
|
2022-06-13 01:08:28 +00:00
|
|
|
|
|
|
|
nfc_blink_stop(nfc);
|
2021-08-03 17:24:20 +00:00
|
|
|
}
|