Loading...
Searching...
No Matches
iso14443_4a.h
1#pragma once
2
3#include <nfc/protocols/iso14443_3a/iso14443_3a.h>
4
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11typedef enum {
12 Iso14443_4aErrorNone,
13 Iso14443_4aErrorNotPresent,
14 Iso14443_4aErrorProtocol,
15 Iso14443_4aErrorTimeout,
16} Iso14443_4aError;
17
18typedef enum {
19 Iso14443_4aBitRateBoth106Kbit,
20 Iso14443_4aBitRatePiccToPcd212Kbit,
21 Iso14443_4aBitRatePiccToPcd424Kbit,
22 Iso14443_4aBitRatePiccToPcd848Kbit,
23 Iso14443_4aBitRatePcdToPicc212Kbit,
24 Iso14443_4aBitRatePcdToPicc424Kbit,
25 Iso14443_4aBitRatePcdToPicc848Kbit,
26} Iso14443_4aBitRate;
27
28typedef enum {
29 Iso14443_4aFrameOptionNad,
30 Iso14443_4aFrameOptionCid,
31} Iso14443_4aFrameOption;
32
33typedef struct {
34 uint8_t tl;
35 uint8_t t0;
36 uint8_t ta_1;
37 uint8_t tb_1;
38 uint8_t tc_1;
39 SimpleArray* t1_tk;
41
42typedef struct {
43 Iso14443_3aData* iso14443_3a_data;
44 Iso14443_4aAtsData ats_data;
46
47// Virtual methods
48
49Iso14443_4aData* iso14443_4a_alloc(void);
50
51void iso14443_4a_free(Iso14443_4aData* data);
52
53void iso14443_4a_reset(Iso14443_4aData* data);
54
55void iso14443_4a_copy(Iso14443_4aData* data, const Iso14443_4aData* other);
56
57bool iso14443_4a_verify(Iso14443_4aData* data, const FuriString* device_type);
58
59bool iso14443_4a_load(Iso14443_4aData* data, FlipperFormat* ff, uint32_t version);
60
61bool iso14443_4a_save(const Iso14443_4aData* data, FlipperFormat* ff);
62
63bool iso14443_4a_is_equal(const Iso14443_4aData* data, const Iso14443_4aData* other);
64
65const char* iso14443_4a_get_device_name(const Iso14443_4aData* data, NfcDeviceNameType name_type);
66
67const uint8_t* iso14443_4a_get_uid(const Iso14443_4aData* data, size_t* uid_len);
68
69bool iso14443_4a_set_uid(Iso14443_4aData* data, const uint8_t* uid, size_t uid_len);
70
71Iso14443_3aData* iso14443_4a_get_base_data(const Iso14443_4aData* data);
72
73// Getters & Tests
74
75uint16_t iso14443_4a_get_frame_size_max(const Iso14443_4aData* data);
76
77uint32_t iso14443_4a_get_fwt_fc_max(const Iso14443_4aData* data);
78
79const uint8_t* iso14443_4a_get_historical_bytes(const Iso14443_4aData* data, uint32_t* count);
80
81bool iso14443_4a_supports_bit_rate(const Iso14443_4aData* data, Iso14443_4aBitRate bit_rate);
82
83bool iso14443_4a_supports_frame_option(const Iso14443_4aData* data, Iso14443_4aFrameOption option);
84
85#ifdef __cplusplus
86}
87#endif
NfcDeviceNameType
Verbosity level of the displayed NFC device name.
Definition nfc_device_base.h:14
This file provides a simple (non-type safe) array for elements with (optional) in-place construction ...
Definition flipper_format.c:12
Definition string.c:4
Definition iso14443_3a.h:58
Definition iso14443_4a.h:33
Definition iso14443_4a.h:42
Definition simple_array.c:5