Flipper Zero Firmware
Loading...
Searching...
No Matches
mf_classic_listener_i.h
1#pragma once
2
3#include "mf_classic_listener.h"
4#include <lib/nfc/protocols/iso14443_3a/iso14443_3a_listener_i.h>
6#include <nfc/helpers/crypto1.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
12typedef enum {
13 MfClassicListenerCommandProcessed,
14 MfClassicListenerCommandAck,
15 MfClassicListenerCommandNack,
16 MfClassicListenerCommandSilent,
17 MfClassicListenerCommandSleep,
18} MfClassicListenerCommand;
19
20typedef enum {
21 MfClassicListenerStateIdle,
22 MfClassicListenerStateAuthComplete,
23} MfClassicListenerState;
24
25typedef enum {
26 MfClassicListenerCommStatePlain,
27 MfClassicListenerCommStateEncrypted,
28} MfClassicListenerCommState;
29
31 Iso14443_3aListener* iso14443_3a_listener;
32 MfClassicListenerState state;
33 MfClassicListenerCommState comm_state;
34
35 MfClassicData* data;
36 BitBuffer* tx_plain_buffer;
37 BitBuffer* tx_encrypted_buffer;
38 BitBuffer* rx_plain_buffer;
39
40 Crypto1* crypto;
41 MfClassicAuthContext auth_context;
42
43 // Write block context
44 uint8_t write_block;
45
46 // Value operation data
47 int32_t transfer_value;
48 bool transfer_valid;
49 MfClassicValueCommand value_cmd;
50
51 NfcGenericEvent generic_event;
52 MfClassicListenerEvent mfc_event;
53 MfClassicListenerEventData mfc_event_data;
54 NfcGenericCallback callback;
55 void* context;
56
57 bool cmd_in_progress;
58 size_t current_cmd_idx;
59 size_t current_cmd_handler_idx;
60
61 size_t total_block_num;
62};
63
64#ifdef __cplusplus
65}
66#endif
Generic Nfc stack event definitions.
NfcCommand(* NfcGenericCallback)(NfcGenericEvent event, void *context)
Generic Nfc event callback type.
Definition nfc_generic_event.h:75
Definition bit_buffer.c:7
Definition crypto1.h:9
Definition iso14443_3a_listener_i.h:15
Definition mf_classic.h:109
Definition mf_classic.h:135
Definition mf_classic_listener.h:20
Definition mf_classic_listener_i.h:30
Generic Nfc event type.
Definition nfc_generic_event.h:58
Definition mf_classic_listener.h:16