unleashed-firmware/applications/nfc/nfc_worker.h
gornekich 602c125ef5
[FL-1499] NFC App: save and load from SD card (#560)
* nfc: add save name and save success scenes
* applications: increase nfc app stack size to 4k
* nfc: move nfc device data to separate file
* nfc: add nfc device save to SD card
* nfc: add file select scene
* nfc: add saved key menu scene
* nfc: add manual SAK, ATQA, UID enter
* nfc: add manual enter
* nfc scenes: remove typedef in SubmenuIndex enu
* nfc_device: close file_worker after load data

Co-authored-by: あく <alleteam@gmail.com>
2021-07-02 16:44:10 +03:00

51 lines
1.1 KiB
C
Executable File

#pragma once
#include "nfc_device.h"
typedef struct {
union {
NfcDeviceData nfc_detect_data;
NfcEmvData nfc_emv_data;
NfcMifareUlData nfc_mifare_ul_data;
};
} NfcWorkerResult;
typedef struct NfcWorker NfcWorker;
typedef enum {
// Init states
NfcWorkerStateNone,
NfcWorkerStateBroken,
NfcWorkerStateReady,
// Main worker states
NfcWorkerStateDetect,
NfcWorkerStateEmulate,
NfcWorkerStateReadEMV,
NfcWorkerStateEmulateEMV,
NfcWorkerStateField,
NfcWorkerStateReadMfUltralight,
// Transition
NfcWorkerStateStop,
} NfcWorkerState;
typedef void (*NfcWorkerCallback)(void* context);
NfcWorker* nfc_worker_alloc();
NfcWorkerState nfc_worker_get_state(NfcWorker* nfc_worker);
ReturnCode nfc_worker_get_error(NfcWorker* nfc_worker);
void nfc_worker_set_emulation_params(NfcWorker* nfc_worker, NfcDeviceData* data);
void nfc_worker_free(NfcWorker* nfc_worker);
void nfc_worker_start(
NfcWorker* nfc_worker,
NfcWorkerState state,
NfcWorkerResult* result_dest,
NfcWorkerCallback callback,
void* context);
void nfc_worker_stop(NfcWorker* nfc_worker);