Generation of NFC NDEF Alternative Carrier records for NDEF messages. More...
Data Structures | |
struct | nfc_ac_rec_data_ref_t |
Carrier Data Reference and Auxiliary Data Reference descriptor. More... | |
struct | nfc_ac_rec_payload_desc_t |
Alternative Carrier record payload descriptor. More... | |
Macros | |
#define | AC_REC_CPS_BYTE_SIZE 1 |
Size of the field with CPS data. | |
#define | AC_REC_DATA_REF_LEN_SIZE 1 |
Size of the Data Reference Length field. | |
#define | AC_REC_AUX_DATA_REF_COUNT_SIZE 1 |
Size of the Data Reference Length field. | |
#define | NFC_AC_CPS_MASK (NFC_AC_CPS_UNKNOWN) |
Mask of Carrier Power State bits in a first ac record byte. | |
#define | NFC_AC_REC_TYPE_LENGTH 2 |
Size of the type field of the Alternative Carrier record, defined in the file nfc_ac_rec.c . It is used in the NFC_NDEF_AC_RECORD_DESC_DEF macro. | |
#define | NFC_NDEF_AC_RECORD_DESC_DEF(NAME,CPS,CARR_DATA_REF_LEN,P_CARR_DATA_REF,MAX_AUX_DATA_REF) |
Macro for creating and initializing an NFC NDEF record descriptor for an Alternative Carrier record. More... | |
#define | NFC_NDEF_AC_RECORD_DESC(NAME) NFC_NDEF_GENERIC_RECORD_DESC(NAME) |
Macro for accessing the NFC NDEF Alternative Carrier record descriptor instance that was created with NFC_NDEF_AC_RECORD_DESC_DEF. | |
Enumerations | |
enum | nfc_ac_rec_cps_t { NFC_AC_CPS_INACTIVE = 0x00, NFC_AC_CPS_ACTIVE = 0x01, NFC_AC_CPS_ACTIVATING = 0x02, NFC_AC_CPS_UNKNOWN = 0x03 } |
Carrier Power State. More... | |
Functions | |
ret_code_t | nfc_ac_rec_payload_constructor (nfc_ac_rec_payload_desc_t *p_nfc_rec_ac_payload_desc, uint8_t *p_buff, uint32_t *p_len) |
Constructor for an NFC NDEF Alternative Carrier record payload. More... | |
void | nfc_ac_rec_auxiliary_data_ref_clear (nfc_ndef_record_desc_t *p_ac_rec) |
Function for clearing an Auxiliary Data Reference in an NFC NDEF Alternative Carrier record. More... | |
ret_code_t | nfc_ac_rec_auxiliary_data_ref_add (nfc_ndef_record_desc_t *p_ac_rec, uint8_t *p_aux_data, uint8_t aux_length) |
Function for adding an Auxiliary Data Reference to an NFC NDEF Alternative Carrier record. More... | |
Variables | |
const uint8_t | nfc_ac_rec_type_field [2] |
External reference to the type field of the Alternative Carrier record, defined in the file nfc_ac_rec.c . It is used in the NFC_NDEF_AC_RECORD_DESC_DEF macro. | |
Generation of NFC NDEF Alternative Carrier records for NDEF messages.
#define NFC_NDEF_AC_RECORD_DESC_DEF | ( | NAME, | |
CPS, | |||
CARR_DATA_REF_LEN, | |||
P_CARR_DATA_REF, | |||
MAX_AUX_DATA_REF | |||
) |
Macro for creating and initializing an NFC NDEF record descriptor for an Alternative Carrier record.
This macro creates and initializes a static instance of type nfc_ndef_record_desc_t and a static instance of type nfc_ac_rec_payload_desc_t, which together constitute an instance of an Alternative Carrier record.
Use the macro NFC_NDEF_AC_RECORD_DESC to access the NDEF Alternative Carrier record descriptor instance.
[in] | NAME | Name of the created record descriptor instance. |
[in] | CPS | Carrier Power State value. |
[in] | CARR_DATA_REF_LEN | Length of the Carrier Data Reference field. |
[in] | P_CARR_DATA_REF | Pointer to the Carrier Data Reference field. |
[in] | MAX_AUX_DATA_REF | Maximum number of Auxiliary Data Reference fields. |
enum nfc_ac_rec_cps_t |
Carrier Power State.
Possible Carrier Power State field values in an Alternative Carrier record.
ret_code_t nfc_ac_rec_auxiliary_data_ref_add | ( | nfc_ndef_record_desc_t * | p_ac_rec, |
uint8_t * | p_aux_data, | ||
uint8_t | aux_length | ||
) |
Function for adding an Auxiliary Data Reference to an NFC NDEF Alternative Carrier record.
[in,out] | p_ac_rec | Pointer to an ac record. |
[in] | p_aux_data | Pointer to the Auxiliary Data Reference data buffer. |
[in] | aux_length | Length of the Auxiliary Data Reference data. |
NRF_SUCCESS | If the Auxiliary Data Reference was added successfully. |
NRF_ERROR_NO_MEM | If the record already contains the maximum number of Auxiliary Data References. |
void nfc_ac_rec_auxiliary_data_ref_clear | ( | nfc_ndef_record_desc_t * | p_ac_rec | ) |
Function for clearing an Auxiliary Data Reference in an NFC NDEF Alternative Carrier record.
This function clears the Auxiliary Data References from the Alternative Carrier record.
[in,out] | p_ac_rec | Pointer to the Alternative Carrier record descriptor. |
ret_code_t nfc_ac_rec_payload_constructor | ( | nfc_ac_rec_payload_desc_t * | p_nfc_rec_ac_payload_desc, |
uint8_t * | p_buff, | ||
uint32_t * | p_len | ||
) |
Constructor for an NFC NDEF Alternative Carrier record payload.
This function encodes the payload of an Alternative Carrier record as specified in the Connection Handover standard. It implements an API compatible with p_payload_constructor_t.