nRF5 SDK v13.0.0
Modules | Data Structures | Macros | Functions
CC file parser

Capability Container file parser for Type 4 Tag. More...

Modules

 Capability Container file for Type 4 Tag configuration
 
 File Control TLV block parser for Type 4 Tag.
 File Control TLV block parser for Type 4 Tag (T4T).
 

Data Structures

struct  nfc_t4t_capability_container_t
 Descriptor for the Capability Container (CC) file of Type 4 Tag. More...
 

Macros

#define NFC_T4T_CC_DESC_DEF(NAME, MAX_BLOCKS)
 Macro for creating and initializing a Type 4 Tag Capability Container descriptor. More...
 
#define NFC_T4T_CC_DESC(NAME)   (NAME##_type_4_tag)
 Macro for accessing the nfc_t4t_capability_container_t instance that was created with NFC_T4T_CC_DESC_DEF. More...
 

Functions

ret_code_t nfc_t4t_cc_file_parse (nfc_t4t_capability_container_t *p_t4t_cc_file, uint8_t *p_raw_data, uint16_t len)
 Function for parsing raw data of a CC file, read from a Type 4 Tag. More...
 
nfc_t4t_tlv_block_tnfc_t4t_file_content_get (nfc_t4t_capability_container_t *p_t4t_cc_file, uint16_t file_id)
 Function for finding File Control TLV block within the CC file descriptor. More...
 
ret_code_t nfc_t4t_file_content_set (nfc_t4t_capability_container_t *p_t4t_cc_file, nfc_t4t_file_t file, uint16_t file_id)
 Function for binding a file with its File Control TLV block. More...
 
void nfc_t4t_cc_file_printout (nfc_t4t_capability_container_t *p_t4t_cc_file)
 Function for printing the CC file descriptor. More...
 

Detailed Description

Capability Container file parser for Type 4 Tag.

Macro Definition Documentation

#define NFC_T4T_CC_DESC (   NAME)    (NAME##_type_4_tag)

Macro for accessing the nfc_t4t_capability_container_t instance that was created with NFC_T4T_CC_DESC_DEF.

Parameters
[in]NAMEName of the created descriptor instance.
#define NFC_T4T_CC_DESC_DEF (   NAME,
  MAX_BLOCKS 
)
Value:
static nfc_t4t_tlv_block_t NAME##_tlv_block_array[MAX_BLOCKS]; \
static nfc_t4t_capability_container_t NAME##_type_4_tag = \
{ \
.max_tlv_blocks = MAX_BLOCKS, \
.p_tlv_block_array = NAME##_tlv_block_array, \
.tlv_count = 0 \
}

Macro for creating and initializing a Type 4 Tag Capability Container descriptor.

This macro creates and initializes a static instance of a nfc_t4t_capability_container_t structure and an array of nfc_t4t_tlv_block_t descriptors.

Use the macro NFC_T4T_CC_DESC to access the Type 4 Tag descriptor instance.

Parameters
[in]NAMEName of the created descriptor instance.
[in]MAX_BLOCKSMaximum number of nfc_t4t_tlv_block_t descriptors that can be stored in the array.

Function Documentation

ret_code_t nfc_t4t_cc_file_parse ( nfc_t4t_capability_container_t p_t4t_cc_file,
uint8_t *  p_raw_data,
uint16_t  len 
)

Function for parsing raw data of a CC file, read from a Type 4 Tag.

This function parses raw data of a Capability Container file and stores the results in its descriptor.

Parameters
[in,out]p_t4t_cc_filePointer to the CC file descriptor that will be filled with parsed data.
[in]p_raw_dataPointer to the buffer with raw data.
[in]lenBuffer length.
Return values
NRF_SUCCESSIf operation was successful.
NRF_ERROR_NULLIf any of the provided pointer arguments is NULL.
NRF_ERROR_INVALID_LENGTHIf provided buffer exceeds a valid CC file length range.
NRF_ERROR_INVALID_DATAIf mapping version of Type 4 Tag specification is not a compatible CC file structure.
OtherOther error codes might be returned depending on nfc_t4t_file_control_tlv_parse function.
void nfc_t4t_cc_file_printout ( nfc_t4t_capability_container_t p_t4t_cc_file)

Function for printing the CC file descriptor.

This function prints the CC file descriptor.

Parameters
[in]p_t4t_cc_filePointer to the CC file.
nfc_t4t_tlv_block_t* nfc_t4t_file_content_get ( nfc_t4t_capability_container_t p_t4t_cc_file,
uint16_t  file_id 
)

Function for finding File Control TLV block within the CC file descriptor.

This function finds File Control TLV block that matches the specified file ID within the CC file descriptor.

Parameters
[in]p_t4t_cc_filePointer to the CC file descriptor.
[in]file_idFile identifier.
Return values
TLVPointer to the File Control TLV.
NULLIf TLV with the specified File ID was not found.
ret_code_t nfc_t4t_file_content_set ( nfc_t4t_capability_container_t p_t4t_cc_file,
nfc_t4t_file_t  file,
uint16_t  file_id 
)

Function for binding a file with its File Control TLV block.

This function binds file content with its File Control TLV block, in which maximal file size and access conditions are stored.

Parameters
[in,out]p_t4t_cc_filePointer to the CC file descriptor.
[in]fileFile descriptor.
[in]file_idFile identifier.
Return values
NRF_SUCCESSIf operation was successful.
NRF_ERROR_NOT_FOUNDIf the provided file ID does not match any ID stored in TLV blocks of the CC file.

Documentation feedback | Developer Zone | Subscribe | Updated