ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
nfc_t4t_lib.h
Go to the documentation of this file.
1 
41 #ifndef NFC_T4T_LIB_H__
42 #define NFC_T4T_LIB_H__
43 
76 #include <stdint.h>
77 #include <stdbool.h>
78 #include <string.h>
79 #include "sdk_errors.h"
80 
81 #ifdef __cplusplus
82 extern "C" {
83 #endif
84 
85 #define NFC_T4T_MAX_PAYLOAD_SIZE 0xFFF0U
86 
88 typedef enum
89 {
93 
94 
96 typedef enum
97 {
100 
103 
106 
109 
115 
134 
137 
151 
153 typedef enum
154 {
156  NFC_T4T_DI_FLAG_MORE = 0x01
158 
162 typedef enum
163 {
172 
183 typedef void (*nfc_t4t_callback_t)(void * p_context,
184  nfc_t4t_event_t event,
185  const uint8_t * p_data,
186  size_t data_length,
187  uint32_t flags);
188 
207 ret_code_t nfc_t4t_setup(nfc_t4t_callback_t callback, void * p_context);
208 
227 ret_code_t nfc_t4t_ndef_rwpayload_set(uint8_t * p_emulation_buffer, size_t buffer_length);
228 
242 ret_code_t nfc_t4t_ndef_staticpayload_set(const uint8_t * p_emulation_buffer, size_t buffer_length);
243 
261 ret_code_t nfc_t4t_response_pdu_send(const uint8_t * p_pdu, size_t pdu_length);
262 
275 ret_code_t nfc_t4t_parameter_set(nfc_t4t_param_id_t id, void * p_data, size_t data_length);
276 
291 ret_code_t nfc_t4t_parameter_get(nfc_t4t_param_id_t id, void * p_data, size_t * p_max_data_length);
292 
300 ret_code_t nfc_t4t_emulation_start(void);
301 
310 ret_code_t nfc_t4t_emulation_stop(void);
311 
322 ret_code_t nfc_t4t_done(void);
323 
324 #ifdef __cplusplus
325 }
326 #endif
327 
332 #endif // NFC_T4T_LIB_H__
ret_code_t nfc_t4t_response_pdu_send(const uint8_t *p_pdu, size_t pdu_length)
Send a raw response PDU after getting a Request PDU callback.
nfc_t4t_emu_mode_t
Definition: nfc_t4t_lib.h:89
ret_code_t nfc_t4t_done(void)
Release reference to application callback.
ret_code_t nfc_t4t_parameter_get(nfc_t4t_param_id_t id, void *p_data, size_t *p_max_data_length)
Query an NFC parameter value.
ret_code_t nfc_t4t_ndef_rwpayload_set(uint8_t *p_emulation_buffer, size_t buffer_length)
Set emulation buffer and content for a NDEF Tag emulation that is Read/Writable.
void(* nfc_t4t_callback_t)(void *p_context, nfc_t4t_event_t event, const uint8_t *p_data, size_t data_length, uint32_t flags)
Callback to pass events from NFCLib to application.
Definition: nfc_t4t_lib.h:183
ret_code_t nfc_t4t_setup(nfc_t4t_callback_t callback, void *p_context)
Register the application callback for event signaling.
nfc_t4t_event_t
Definition: nfc_t4t_lib.h:97
nfc_t4t_data_ind_flags_t
Definition: nfc_t4t_lib.h:154
ret_code_t nfc_t4t_emulation_start(void)
Activate the NFC frontend.
ret_code_t nfc_t4t_parameter_set(nfc_t4t_param_id_t id, void *p_data, size_t data_length)
Set an NFC parameter.
ret_code_t nfc_t4t_ndef_staticpayload_set(const uint8_t *p_emulation_buffer, size_t buffer_length)
Set emulationBuffer and Content for a NDEF Tag emulation that is Read-Only.
nfc_t4t_param_id_t
Definition: nfc_t4t_lib.h:163
ret_code_t nfc_t4t_emulation_stop(void)
Deactivate the NFC frontend.
@ NFC_T4T_EMUMODE_NDEF
Emulated NDEF AID and EF-Files.
Definition: nfc_t4t_lib.h:90
@ NFC_T4T_EMUMODE_PICC
Run just ISO-DEP, deliver I-Frames up.
Definition: nfc_t4t_lib.h:91
@ NFC_T4T_EVENT_NDEF_UPDATED
External Reader has written to length information of NDEF-Data from Emulation.
Definition: nfc_t4t_lib.h:113
@ NFC_T4T_EVENT_FIELD_OFF
External Reader polling ended.
Definition: nfc_t4t_lib.h:104
@ NFC_T4T_EVENT_DATA_IND
In Raw mode delivers the APDU fragments.
Definition: nfc_t4t_lib.h:135
@ NFC_T4T_EVENT_FIELD_ON
External Reader polling detected.
Definition: nfc_t4t_lib.h:101
@ NFC_T4T_EVENT_NONE
This ID is never used. Dummy value for completeness.
Definition: nfc_t4t_lib.h:98
@ NFC_T4T_EVENT_NDEF_READ
External Reader has read static NDEF-Data from Emulation.
Definition: nfc_t4t_lib.h:107
@ NFC_T4T_EVENT_DATA_TRANSMITTED
In Raw mode it signals that the data from nfc_t4t_response_pdu_send have been sent out.
Definition: nfc_t4t_lib.h:132
@ NFC_T4T_DI_FLAG_NONE
Dummy value.
Definition: nfc_t4t_lib.h:155
@ NFC_T4T_DI_FLAG_MORE
This signals that more data is expected to be received.
Definition: nfc_t4t_lib.h:156
@ NFC_T4T_PARAM_SELRES
Parameter for setting 'Protocol' bits for SEL_RES packet.
Definition: nfc_t4t_lib.h:166
@ NFC_T4T_PARAM_NFCID1
Definition: nfc_t4t_lib.h:167
@ NFC_T4T_PARAM_TESTING
Internal usage only for Unit-Testing.
Definition: nfc_t4t_lib.h:164
@ NFC_T4T_PARAM_FWI
Frame Wait Time parameter.
Definition: nfc_t4t_lib.h:165