Loading...
Searching...
No Matches
mf_ultralight_poller.h
1#pragma once
2
3#include "mf_ultralight.h"
4#include <lib/nfc/protocols/iso14443_3a/iso14443_3a_poller.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
14
18typedef enum {
19 MfUltralightPollerEventTypeRequestMode,
20 MfUltralightPollerEventTypeAuthRequest,
21 MfUltralightPollerEventTypeAuthSuccess,
22 MfUltralightPollerEventTypeAuthFailed,
23 MfUltralightPollerEventTypeReadSuccess,
24 MfUltralightPollerEventTypeReadFailed,
25 MfUltralightPollerEventTypeRequestWriteData,
26 MfUltralightPollerEventTypeCardMismatch,
27 MfUltralightPollerEventTypeCardLocked,
28 MfUltralightPollerEventTypeWriteSuccess,
29 MfUltralightPollerEventTypeWriteFail,
30} MfUltralightPollerEventType;
31
35typedef enum {
36 MfUltralightPollerModeRead,
37 MfUltralightPollerModeWrite,
38} MfUltralightPollerMode;
39
50
54typedef union {
56 MfUltralightError error;
57 const MfUltralightData* write_data;
58 MfUltralightPollerMode poller_mode;
60
66typedef struct {
67 MfUltralightPollerEventType type;
70
80MfUltralightError mf_ultralight_poller_auth_pwd(
81 MfUltralightPoller* instance,
83
96MfUltralightError mf_ultralight_poller_authenticate_start(
97 MfUltralightPoller* instance,
98 const uint8_t* RndA,
99 uint8_t* output);
100
111MfUltralightError mf_ultralight_poller_authenticate_end(
112 MfUltralightPoller* instance,
113 const uint8_t* RndB,
114 const uint8_t* request,
115 uint8_t* response);
116
130MfUltralightError mf_ultralight_poller_read_page(
131 MfUltralightPoller* instance,
132 uint8_t start_page,
134
148MfUltralightError mf_ultralight_poller_read_page_from_sector(
149 MfUltralightPoller* instance,
150 uint8_t sector,
151 uint8_t tag,
153
164MfUltralightError mf_ultralight_poller_write_page(
165 MfUltralightPoller* instance,
166 uint8_t page,
167 const MfUltralightPage* data);
168
178MfUltralightError
179 mf_ultralight_poller_read_version(MfUltralightPoller* instance, MfUltralightVersion* data);
180
190MfUltralightError
191 mf_ultralight_poller_read_signature(MfUltralightPoller* instance, MfUltralightSignature* data);
192
203MfUltralightError mf_ultralight_poller_read_counter(
204 MfUltralightPoller* instance,
205 uint8_t counter_num,
206 MfUltralightCounter* data);
207
218MfUltralightError mf_ultralight_poller_read_tearing_flag(
219 MfUltralightPoller* instance,
220 uint8_t tearing_falg_num,
222
223#ifdef __cplusplus
224}
225#endif
Definition mf_ultralight.h:135
Definition mf_ultralight.h:127
Definition mf_ultralight.h:131
Definition mf_ultralight.h:178
Definition mf_ultralight.h:95
Definition mf_ultralight.h:99
MfUltralight poller authentication context.
Definition mf_ultralight_poller.h:43
MfUltralightAuthPack pack
Pack received on successfull authentication.
Definition mf_ultralight_poller.h:46
MfUltralightAuthPassword password
Password to be used for authentication.
Definition mf_ultralight_poller.h:44
bool auth_success
Set to true if authentication succeeded, false otherwise.
Definition mf_ultralight_poller.h:47
bool skip_auth
Set to true if authentication should be skipped, false otherwise.
Definition mf_ultralight_poller.h:48
MfUltralight poller event structure.
Definition mf_ultralight_poller.h:66
MfUltralightPollerEventData * data
Pointer to event specific data.
Definition mf_ultralight_poller.h:68
MfUltralightPollerEventType type
Type of emmitted event.
Definition mf_ultralight_poller.h:67
Definition mf_ultralight_poller_i.h:75
Definition mf_ultralight.h:114
Definition mf_ultralight.h:123
Definition mf_ultralight.h:103
Definition mf_ultralight.h:118
MfUltralight poller event data.
Definition mf_ultralight_poller.h:54
MfUltralightError error
Error code indicating reading fail reason.
Definition mf_ultralight_poller.h:56
MfUltralightPollerAuthContext auth_context
Authentication context.
Definition mf_ultralight_poller.h:55