nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
isodep.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef NFC_T4T_ISODEP_H_
8#define NFC_T4T_ISODEP_H_
9
17#ifdef __cplusplus
18extern "C" {
19#endif
20
26#define NFC_T4T_ISODEP_SYNTAX_ERROR 1
27
29#define NFC_T4T_ISODEP_SEMANTIC_ERROR 2
30
32#define NFC_T4T_ISODEP_TRANSMISSION_ERROR 3
33
35#define NFC_T4T_ISODEP_TIMEOUT_ERROR 4
36
42#define NFC_T4T_ISODEP_HIST_MAX_LEN 15
43
49 uint32_t fwt;
50
52 uint32_t sfgt;
53
55 uint16_t fsc;
56
58 uint8_t did;
59
61 uint8_t lp_divisor;
62
64 uint8_t pl_divisor;
65
68
71
74
77};
78
84
87
90
93
96
99
102
105
109
124 void (*data_received)(const uint8_t *data, size_t data_len);
125
130 void (*selected)(const struct nfc_t4t_isodep_tag *t4t_tag);
131
136 void (*deselected)(void);
137
147 void (*ready_to_send)(uint8_t *data, size_t data_len, uint32_t ftd);
148
154 void (*error)(int err);
155};
156
177
188
203int nfc_t4t_isodep_data_received(const uint8_t *data, size_t data_len, int err);
204
216int nfc_t4t_isodep_transmit(const uint8_t *data, size_t data_len);
217
226
243int nfc_t4t_isodep_init(uint8_t *tx_buf, size_t tx_size,
244 uint8_t *rx_buf, size_t rx_size,
245 const struct nfc_t4t_isodep_cb *cb);
246
247#ifdef __cplusplus
248}
249#endif
250
255#endif /* NFC_T4T_ISODEP_H_ */
int nfc_t4t_isodep_data_received(const uint8_t *data, size_t data_len, int err)
Handle NFC ISO-DEP protocol received data.
int nfc_t4t_isodep_transmit(const uint8_t *data, size_t data_len)
Exchange the specified amount of data.
int nfc_t4t_isodep_tag_deselect(void)
Send a Deselect command.
int nfc_t4t_isodep_rats_send(enum nfc_t4t_isodep_fsd fsd, uint8_t did)
Send a Request for Answer to Select (RATS).
int nfc_t4t_isodep_init(uint8_t *tx_buf, size_t tx_size, uint8_t *rx_buf, size_t rx_size, const struct nfc_t4t_isodep_cb *cb)
Initialize NFC ISO-DEP protocol.
nfc_t4t_isodep_fsd
NFC Type 4 Tag ISO-DEP frame size.
Definition: isodep.h:81
@ NFC_T4T_ISODEP_FSD_64
Definition: isodep.h:98
@ NFC_T4T_ISODEP_FSD_32
Definition: isodep.h:89
@ NFC_T4T_ISODEP_FSD_96
Definition: isodep.h:101
@ NFC_T4T_ISODEP_FSD_16
Definition: isodep.h:83
@ NFC_T4T_ISODEP_FSD_128
Definition: isodep.h:104
@ NFC_T4T_ISODEP_FSD_256
Definition: isodep.h:107
@ NFC_T4T_ISODEP_FSD_48
Definition: isodep.h:95
@ NFC_T4T_ISODEP_FSD_40
Definition: isodep.h:92
@ NFC_T4T_ISODEP_FSD_24
Definition: isodep.h:86
void nfc_t4t_isodep_on_timeout(void)
Handle a transmission timeout error.
#define NFC_T4T_ISODEP_HIST_MAX_LEN
Definition: isodep.h:42
void(* ready_to_send)(uint8_t *data, size_t data_len, uint32_t ftd)
ISO-DEP data ready to send a callback.
Definition: isodep.h:147
void(* data_received)(const uint8_t *data, size_t data_len)
ISO-DEP data received callback.
Definition: isodep.h:124
void(* selected)(const struct nfc_t4t_isodep_tag *t4t_tag)
Type 4 Tag ISO-DEP selected callback.
Definition: isodep.h:130
void(* deselected)(void)
Type 4 Tag ISO-DEP deselected callback.
Definition: isodep.h:136
void(* error)(int err)
ISO-DEP error callback.
Definition: isodep.h:154
ISO-DEP Protocol callback structure.
Definition: isodep.h:115
uint8_t historical[15]
Definition: isodep.h:67
uint8_t lp_divisor
Definition: isodep.h:61
uint8_t did
Definition: isodep.h:58
bool did_supported
Definition: isodep.h:73
uint32_t fwt
Definition: isodep.h:49
uint8_t pl_divisor
Definition: isodep.h:64
uint8_t historical_len
Definition: isodep.h:70
bool nad_supported
Definition: isodep.h:76
uint16_t fsc
Definition: isodep.h:55
uint32_t sfgt
Definition: isodep.h:52
NFC Type 4 Tag data negotiated over RATS command exchange.
Definition: isodep.h:47