Loading...
Searching...
No Matches
iso14443_3a_poller_i.h
1#pragma once
2
3#include "iso14443_3a_poller.h"
4
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#define ISO14443_3A_POLLER_MAX_BUFFER_SIZE (512U)
12
13#define ISO14443_3A_POLLER_SEL_CMD(cascade_lvl) (0x93 + 2 * (cascade_lvl))
14#define ISO14443_3A_POLLER_SEL_PAR(bytes, bits) (((bytes) << 4 & 0xf0U) | ((bits) & 0x0fU))
15#define ISO14443_3A_POLLER_SDD_CL (0x88U)
16
17typedef enum {
18 Iso14443_3aPollerColResStateStateIdle,
19 Iso14443_3aPollerColResStateStateNewCascade,
20 Iso14443_3aPollerColResStateStateSelectCascade,
21 Iso14443_3aPollerColResStateStateSuccess,
22 Iso14443_3aPollerColResStateStateFail,
23} Iso14443_3aPollerColResState;
24
25typedef struct {
26 Iso14443_3aPollerColResState state;
27 Iso14443_3aSensResp sens_resp;
28 Iso14443_3aSddReq sdd_req;
29 Iso14443_3aSddResp sdd_resp;
30 Iso14443_3aSelReq sel_req;
31 Iso14443_3aSelResp sel_resp;
32 uint8_t cascade_level;
34
35typedef enum {
36 Iso14443_3aPollerStateIdle,
37 Iso14443_3aPollerStateColResInProgress,
38 Iso14443_3aPollerStateColResFailed,
39 Iso14443_3aPollerStateActivated,
40} Iso14443_3aPollerState;
41
43 Nfc* nfc;
44 Iso14443_3aPollerState state;
46 Iso14443_3aData* data;
47 BitBuffer* tx_buffer;
48 BitBuffer* rx_buffer;
49
50 NfcGenericEvent general_event;
51 Iso14443_3aPollerEvent iso14443_3a_event;
52 Iso14443_3aPollerEventData iso14443_3a_event_data;
53 NfcGenericCallback callback;
54 void* context;
55};
56
57const Iso14443_3aData* iso14443_3a_poller_get_data(Iso14443_3aPoller* instance);
58
59#ifdef __cplusplus
60}
61#endif
Bit Buffer.
NfcCommand(* NfcGenericCallback)(NfcGenericEvent event, void *context)
Generic Nfc event callback type.
Definition nfc_generic_event.h:75
Definition bit_buffer.c:7
Definition iso14443_3a.h:58
Definition iso14443_3a_poller_i.h:25
Iso14443_3a poller event structure.
Definition iso14443_3a_poller.h:37
Definition iso14443_3a_poller_i.h:42
Definition iso14443_3a.h:36
Definition iso14443_3a.h:42
Definition iso14443_3a.h:47
Definition iso14443_3a.h:54
Definition iso14443_3a.h:32
Generic Nfc event type.
Definition nfc_generic_event.h:58
Definition nfc.c:41
Iso14443_3a poller event data.
Definition iso14443_3a_poller.h:28