mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-22 10:43:11 +00:00
490447bbd4
* NFC: gen4 gtu detect in magic app * NFC: more support for GTU card * NFC: Fix Gen1 in Magic * Allow double UIDs for MFClassic on GTU cards * NFC: Small magic app tweaks * nfc magic: notify card event on wiping * nfc magic: fix power consumption * nfc magic: disable i2c writing and fix wipe loop * NfcMagic: correct formatting in printf * NfcMagic: correct formatting in printf, proper version * nfc_magic: rework card found notification and gen4 wiping Co-authored-by: あく <alleteam@gmail.com>
42 lines
1 KiB
C
42 lines
1 KiB
C
#pragma once
|
|
|
|
#include <lib/nfc/nfc_device.h>
|
|
#include "nfc_magic.h"
|
|
|
|
typedef struct NfcMagicWorker NfcMagicWorker;
|
|
|
|
typedef enum {
|
|
NfcMagicWorkerStateReady,
|
|
|
|
NfcMagicWorkerStateCheck,
|
|
NfcMagicWorkerStateWrite,
|
|
NfcMagicWorkerStateRekey,
|
|
NfcMagicWorkerStateWipe,
|
|
|
|
NfcMagicWorkerStateStop,
|
|
} NfcMagicWorkerState;
|
|
|
|
typedef enum {
|
|
NfcMagicWorkerEventSuccess,
|
|
NfcMagicWorkerEventFail,
|
|
NfcMagicWorkerEventCardDetected,
|
|
NfcMagicWorkerEventNoCardDetected,
|
|
NfcMagicWorkerEventWrongCard,
|
|
} NfcMagicWorkerEvent;
|
|
|
|
typedef bool (*NfcMagicWorkerCallback)(NfcMagicWorkerEvent event, void* context);
|
|
|
|
NfcMagicWorker* nfc_magic_worker_alloc();
|
|
|
|
void nfc_magic_worker_free(NfcMagicWorker* nfc_magic_worker);
|
|
|
|
void nfc_magic_worker_stop(NfcMagicWorker* nfc_magic_worker);
|
|
|
|
void nfc_magic_worker_start(
|
|
NfcMagicWorker* nfc_magic_worker,
|
|
NfcMagicWorkerState state,
|
|
NfcMagicDevice* magic_dev,
|
|
NfcDeviceData* dev_data,
|
|
uint32_t new_password,
|
|
NfcMagicWorkerCallback callback,
|
|
void* context);
|