1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-12 04:34:43 +04:00
Files
unleashed-firmware/lib/nfc/parsers/nfc_supported_card.h
2023-09-17 13:56:14 +03:00

47 lines
1.3 KiB
C

#pragma once
#include <furi_hal_nfc.h>
#include "../nfc_worker.h"
#include "../nfc_device.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
NfcSupportedCardTypePlantain,
NfcSupportedCardTypeTroika,
NfcSupportedCardTypeSocialCardMoscow,
NfcSupportedCardTypePlantain4K,
NfcSupportedCardTypeTwoCities,
NfcSupportedCardTypeAllInOne,
NfcSupportedCardTypeOpal,
NfcSupportedCardTypeEnd,
} NfcSupportedCardType;
typedef bool (*NfcSupportedCardVerify)(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx);
typedef bool (*NfcSupportedCardRead)(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx);
typedef bool (*NfcSupportedCardParse)(NfcDeviceData* dev_data);
typedef struct {
NfcProtocol protocol;
NfcSupportedCardVerify verify;
NfcSupportedCardRead read;
NfcSupportedCardParse parse;
} NfcSupportedCard;
extern NfcSupportedCard nfc_supported_card[NfcSupportedCardTypeEnd];
bool nfc_supported_card_verify_and_parse(NfcDeviceData* dev_data);
// stub_parser_verify_read does nothing, and always reports that it does not
// support the card. This is needed for DESFire card parsers which can't
// provide keys, and only use NfcSupportedCard->parse.
bool stub_parser_verify_read(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx);
#ifdef __cplusplus
}
#endif