NFC Driver
The NFC driver is used for configuring NDEF records on an NFC tag.
Data Structures
NDEF Record header.
Member Name |
Type |
flags |
uint8_t |
typeLength |
uint8_t |
payloadLength |
uint32_t |
idLength |
uint8_t |
payloadType |
uint8_t |
payloadId |
uint8_t |
ATMO_NFC_Record_t
NDEF Record.
Member Name |
Type |
header |
ATMO_NFC_Record_Header_t |
payload |
uint8_t |
ATMO_NFC_Config_t
Member Name |
Type |
unused |
uint8_t |
Type Definitions
Name |
Definition |
Description |
ATMO_NFC_DriverInstance_t |
typedef struct ATMO_NFC_DriverInstance_t ATMO_NFC_DriverInstance_t |
|
Enumerations
enum
ATMO_NFC_Status_t
Name |
Value |
ATMO_NFC_Status_Success |
0x00u |
ATMO_NFC_Status_Fail |
0x01u |
ATMO_NFC_Status_Initialized |
0x02u |
ATMO_NFC_Status_Invalid |
0x03u |
ATMO_NFC_Status_NotSupported |
0x04u |
ATMO_NFC_Status_Unspecified |
0x05u |
enum
ATMO_NFC_TNF_Type_t
Name |
Value |
ATMO_NFC_TNF_None |
0x0 |
ATMO_NFC_TNF_WellKnown |
|
ATMO_NFC_TNF_MIME |
|
ATMO_NFC_TNF_URI |
|
ATMO_NFC_TNF_EXTERNAL |
|
enum
ATMO_NFC_TYPE_WELLKNOWN_t
Name |
Value |
ATMO_NFC_TYPE_WELLKNOWN_TEXT |
|
ATMO_NFC_TYPE_WELLKNOWN_URL |
|
Functions
ATMO_Status_t ATMO_NFC_AddDriverInstance(const ATMO_NFC_DriverInstance_t *driverInstance, ATMO_DriverInstanceData_t *driverInstanceData, ATMO_DriverInstanceHandle_t *instanceNumber)
Add an instance of a driver for NFC into the NFC driver handler.
Parameter |
Direction |
Type |
instanceNumber |
N/A |
ATMO_DriverInstanceHandle_t * |
driverInstanceData |
N/A |
ATMO_DriverInstanceData_t * |
driverInstance |
N/A |
const ATMO_NFC_DriverInstance_t * |
Return Type |
ATMO_Status_t |
ATMO_NFC_Status_t ATMO_NFC_Init(ATMO_DriverInstanceHandle_t instance)
Initialize the NFC driver.
Parameter |
Direction |
Type |
instance |
in |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_DeInit(ATMO_DriverInstanceHandle_t instance)
De-initialize the NFC driver.
Parameter |
Direction |
Type |
instance |
in |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_SetConfiguration(ATMO_DriverInstanceHandle_t instance, const ATMO_NFC_Config_t *config)
Set the NFC configuration.
Parameter |
Direction |
Type |
config |
in |
const ATMO_NFC_Config_t * |
instance |
in |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_SetMessage(ATMO_DriverInstanceHandle_t instance, unsigned int numRecords, ATMO_NFC_Record_t *records)
Insert a list of records into the NFC tag.
Parameter |
Direction |
Type |
records |
in |
ATMO_NFC_Record_t * |
numRecords |
in |
unsigned int |
instance |
N/A |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_SetMessagePtr(ATMO_DriverInstanceHandle_t instance, unsigned int numRecords, ATMO_NFC_Record_t **records)
Insert a list of records into the NFC tag.
Parameter |
Direction |
Type |
records |
in |
ATMO_NFC_Record_t ** |
numRecords |
in |
unsigned int |
instance |
N/A |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_GetNumStoredRecords(ATMO_DriverInstanceHandle_t instance, unsigned int *numRecords)
Get the number of records currently stored in the NFC tag.
Parameter |
Direction |
Type |
numRecords |
out |
unsigned int * |
instance |
N/A |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_GetRecord(ATMO_DriverInstanceHandle_t instance, unsigned int index, ATMO_NFC_Record_t *record)
Get a single record from the NFC tag.
Parameter |
Direction |
Type |
record |
out |
ATMO_NFC_Record_t * |
index |
in |
unsigned int |
instance |
N/A |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_SetMessageReceivedCallback(ATMO_DriverInstanceHandle_t instance, ATMO_Callback_t cb)
Set the callback for an NFC transmission received.
Parameter |
Direction |
Type |
cb |
N/A |
ATMO_Callback_t |
instance |
N/A |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_SetMessageReceivedAbilityHandle(ATMO_DriverInstanceHandle_t instance, unsigned int abilityHandle)
Set the ability handle for NFC transmission received.
Parameter |
Direction |
Type |
abilityHandle |
N/A |
unsigned int |
instance |
N/A |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_SyncAtmoRecords(ATMO_DriverInstanceHandle_t instance)
Called by Atmo stack to write all stored Atmo records.
Parameter |
Direction |
Type |
instance |
N/A |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_RegisterStoredRecord(ATMO_DriverInstanceHandle_t instance, ATMO_NFC_Record_t *record, unsigned int *recordHandle)
Parameter |
Direction |
Type |
recordHandle |
N/A |
unsigned int * |
record |
N/A |
ATMO_NFC_Record_t * |
instance |
N/A |
ATMO_DriverInstanceHandle_t |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_MakeRecordText(ATMO_NFC_Record_t *record, const char *text)
Make a WLT text record.
Parameter |
Direction |
Type |
text |
in |
const char * |
record |
in |
ATMO_NFC_Record_t * |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_MakeRecordURL(ATMO_NFC_Record_t *record, const char *url)
Make a URL record.
Parameter |
Direction |
Type |
url |
in |
const char * |
record |
N/A |
ATMO_NFC_Record_t * |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_MakeRecordMime(ATMO_NFC_Record_t *record, const char *mimeType, const char *data, unsigned int dataLen)
Make a MIME record.
Parameter |
Direction |
Type |
dataLen |
in |
unsigned int |
data |
in |
const char * |
mimeType |
in |
const char * |
record |
N/A |
ATMO_NFC_Record_t * |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_MakeRecordExternal(ATMO_NFC_Record_t *record, const char *type, const char *data, unsigned int dataLen)
Make external type record.
Parameter |
Direction |
Type |
dataLen |
in |
unsigned int |
data |
in |
const char * |
type |
in |
const char * |
record |
N/A |
ATMO_NFC_Record_t * |
Return Type |
ATMO_NFC_Status_t |
ATMO_NFC_Status_t ATMO_NFC_PrintRecord(ATMO_NFC_Record_t *record)
Print the record to a console.
Parameter |
Direction |
Type |
record |
N/A |
ATMO_NFC_Record_t * |
Return Type |
ATMO_NFC_Status_t |