2022-07-26 15:30:49 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <furi_hal_nfc.h>
|
|
|
|
#include "../nfc_worker.h"
|
2022-08-17 15:08:13 +00:00
|
|
|
#include "../nfc_device.h"
|
2022-07-26 15:30:49 +00:00
|
|
|
|
|
|
|
typedef enum {
|
2022-09-19 16:05:04 +00:00
|
|
|
NfcSupportedCardTypePlantain,
|
|
|
|
NfcSupportedCardTypeTroika,
|
|
|
|
NfcSupportedCardTypePlantain4K,
|
|
|
|
NfcSupportedCardTypeTroika4K,
|
|
|
|
NfcSupportedCardTypeTwoCities,
|
|
|
|
NfcSupportedCardTypeAllInOne,
|
2023-05-29 11:55:55 +00:00
|
|
|
NfcSupportedCardTypeOpal,
|
2022-07-26 15:30:49 +00:00
|
|
|
|
|
|
|
NfcSupportedCardTypeEnd,
|
|
|
|
} NfcSupportedCardType;
|
|
|
|
|
|
|
|
typedef bool (*NfcSupportedCardVerify)(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx);
|
|
|
|
|
|
|
|
typedef bool (*NfcSupportedCardRead)(NfcWorker* nfc_worker, FuriHalNfcTxRxContext* tx_rx);
|
|
|
|
|
2022-08-17 15:08:13 +00:00
|
|
|
typedef bool (*NfcSupportedCardParse)(NfcDeviceData* dev_data);
|
2022-07-26 15:30:49 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
NfcProtocol protocol;
|
|
|
|
NfcSupportedCardVerify verify;
|
|
|
|
NfcSupportedCardRead read;
|
|
|
|
NfcSupportedCardParse parse;
|
|
|
|
} NfcSupportedCard;
|
|
|
|
|
|
|
|
extern NfcSupportedCard nfc_supported_card[NfcSupportedCardTypeEnd];
|
2022-08-17 15:08:13 +00:00
|
|
|
|
|
|
|
bool nfc_supported_card_verify_and_parse(NfcDeviceData* dev_data);
|
2023-05-29 11:55:55 +00:00
|
|
|
|
|
|
|
// 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);
|