Flipper Zero Firmware
Loading...
Searching...
No Matches
iso14443_3b.h
1#pragma once
2
4
5#include <core/string.h>
6#include <toolbox/bit_buffer.h>
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef enum {
14 Iso14443_3bErrorNone,
15 Iso14443_3bErrorNotPresent,
16 Iso14443_3bErrorColResFailed,
17 Iso14443_3bErrorBufferOverflow,
18 Iso14443_3bErrorCommunication,
19 Iso14443_3bErrorFieldOff,
20 Iso14443_3bErrorWrongCrc,
21 Iso14443_3bErrorTimeout,
22} Iso14443_3bError;
23
24typedef enum {
25 Iso14443_3bBitRateBoth106Kbit,
26 Iso14443_3bBitRatePiccToPcd212Kbit,
27 Iso14443_3bBitRatePiccToPcd424Kbit,
28 Iso14443_3bBitRatePiccToPcd848Kbit,
29 Iso14443_3bBitRatePcdToPicc212Kbit,
30 Iso14443_3bBitRatePcdToPicc424Kbit,
31 Iso14443_3bBitRatePcdToPicc848Kbit,
32} Iso14443_3bBitRate;
33
34typedef enum {
35 Iso14443_3bFrameOptionNad,
36 Iso14443_3bFrameOptionCid,
37} Iso14443_3bFrameOption;
38
39typedef struct Iso14443_3bData Iso14443_3bData;
40
41// Virtual methods
42
43Iso14443_3bData* iso14443_3b_alloc(void);
44
45void iso14443_3b_free(Iso14443_3bData* data);
46
47void iso14443_3b_reset(Iso14443_3bData* data);
48
49void iso14443_3b_copy(Iso14443_3bData* data, const Iso14443_3bData* other);
50
51bool iso14443_3b_verify(Iso14443_3bData* data, const FuriString* device_type);
52
53bool iso14443_3b_load(Iso14443_3bData* data, FlipperFormat* ff, uint32_t version);
54
55bool iso14443_3b_save(const Iso14443_3bData* data, FlipperFormat* ff);
56
57bool iso14443_3b_is_equal(const Iso14443_3bData* data, const Iso14443_3bData* other);
58
59const char* iso14443_3b_get_device_name(const Iso14443_3bData* data, NfcDeviceNameType name_type);
60
61const uint8_t* iso14443_3b_get_uid(const Iso14443_3bData* data, size_t* uid_len);
62
63bool iso14443_3b_set_uid(Iso14443_3bData* data, const uint8_t* uid, size_t uid_len);
64
65Iso14443_3bData* iso14443_3b_get_base_data(const Iso14443_3bData* data);
66
67// Getters and tests
68
69bool iso14443_3b_supports_iso14443_4(const Iso14443_3bData* data);
70
71bool iso14443_3b_supports_bit_rate(const Iso14443_3bData* data, Iso14443_3bBitRate bit_rate);
72
73bool iso14443_3b_supports_frame_option(const Iso14443_3bData* data, Iso14443_3bFrameOption option);
74
75const uint8_t* iso14443_3b_get_application_data(const Iso14443_3bData* data, size_t* data_size);
76
77uint16_t iso14443_3b_get_frame_size_max(const Iso14443_3bData* data);
78
79uint32_t iso14443_3b_get_fwt_fc_max(const Iso14443_3bData* data);
80
81#ifdef __cplusplus
82}
83#endif
Flipper File Format helper library.
Common top-level types for the NFC protocol stack.
NfcDeviceNameType
Verbosity level of the displayed NFC device name.
Definition nfc_device_base.h:14
Furi string primitive.
Definition flipper_format.c:12
Definition string.c:4
Definition iso14443_3b_i.h:33