Loading...
Searching...
No Matches
felica_poller_i.h
1#pragma once
2
3#include "felica_poller.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10#define FELICA_POLLER_MAX_BUFFER_SIZE (256U)
11
12#define FELICA_POLLER_POLLING_FWT (200000U)
13
14#define FELICA_POLLER_CMD_POLLING_REQ_CODE (0x00U)
15#define FELICA_POLLER_CMD_POLLING_RESP_CODE (0x01U)
16
17typedef enum {
18 FelicaPollerStateIdle,
19 FelicaPollerStateActivated,
20 FelicaPollerStateAuthenticateInternal,
21 FelicaPollerStateAuthenticateExternal,
22 FelicaPollerStateReadBlocks,
23 FelicaPollerStateReadSuccess,
24 FelicaPollerStateReadFailed,
25
26 FelicaPollerStateNum
27} FelicaPollerState;
28
30 Nfc* nfc;
31 FelicaPollerState state;
33
34 FelicaData* data;
35 BitBuffer* tx_buffer;
36 BitBuffer* rx_buffer;
37
38 NfcGenericEvent general_event;
39 FelicaPollerEvent felica_event;
40 FelicaPollerEventData felica_event_data;
41 NfcGenericCallback callback;
42 uint8_t block_index;
43 void* context;
44};
45
46typedef struct {
47 uint16_t system_code;
48 uint8_t request_code;
49 uint8_t time_slot;
51
52typedef struct {
53 FelicaIDm idm;
54 FelicaPMm pmm;
55 uint8_t request_data[2];
57
58const FelicaData* felica_poller_get_data(FelicaPoller* instance);
59
68FelicaError felica_poller_polling(
69 FelicaPoller* instance,
72
82FelicaError felica_poller_read_blocks(
83 FelicaPoller* instance,
84 const uint8_t block_count,
85 const uint8_t* const block_numbers,
86 FelicaPollerReadCommandResponse** const response_ptr);
87
98FelicaError felica_poller_write_blocks(
99 const FelicaPoller* instance,
100 const uint8_t block_count,
101 const uint8_t* const block_numbers,
102 const uint8_t* data,
103 FelicaPollerWriteCommandResponse** const response_ptr);
104
117FelicaError felica_poller_frame_exchange(
118 const FelicaPoller* instance,
119 const BitBuffer* tx_buffer,
120 BitBuffer* rx_buffer,
121 uint32_t fwt);
122
123#ifdef __cplusplus
124}
125#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
Structure used to hold authentication related fields.
Definition felica.h:99
Definition felica.h:167
Structure used to store Felica data and additional values about reading.
Definition felica.h:149
Felica ID block.
Definition felica.h:106
Felica PMm block.
Definition felica.h:111
FelicaPoller poller event structure.
Definition felica_poller.h:40
Definition felica_poller_i.h:29
Definition felica_poller_i.h:46
Definition felica_poller_i.h:52
Definition felica.h:182
Generic Nfc event type.
Definition nfc_generic_event.h:58
Definition nfc.c:41
Felica poller event data.
Definition felica_poller.h:30