nRF5 SDK v17.1.0
Modules | Data Structures | Macros | Enumerations | Functions | Variables
ac (Alternative carrier) records

Generation of NFC NDEF Alternative Carrier records for NDEF messages. More...

Modules

 NFC NDEF Alternative Carrier record encoder configuration
 

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.
 

Detailed Description

Generation of NFC NDEF Alternative Carrier records for NDEF messages.

Macro Definition Documentation

#define NFC_NDEF_AC_RECORD_DESC_DEF (   NAME,
  CPS,
  CARR_DATA_REF_LEN,
  P_CARR_DATA_REF,
  MAX_AUX_DATA_REF 
)
Value:
nfc_ac_rec_data_ref_t NAME##_nfc_ac_rec_aux_data_ref_array[MAX_AUX_DATA_REF]; \
nfc_ac_rec_payload_desc_t NAME##_nfc_ac_rec_payload_desc = \
{ \
.cps = CPS, \
.carrier_data_ref = {CARR_DATA_REF_LEN, P_CARR_DATA_REF}, \
.max_aux_data_ref = MAX_AUX_DATA_REF, \
.aux_data_ref_count = 0, \
.p_aux_data_ref = NAME##_nfc_ac_rec_aux_data_ref_array \
}; \
NFC_NDEF_GENERIC_RECORD_DESC_DEF(NAME, \
0, \
0, \
&(NAME##_nfc_ac_rec_payload_desc))

Macro for creating and initializing an NFC NDEF record descriptor for an Alternative Carrier record.

This macro creates and initializes an instance of type nfc_ndef_record_desc_t and an 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.

Note
The record descriptor is declared as automatic variable, which implies that the NDEF message encoding (see nfc_ble_full_handover_select_msg_encode) must be done in the same variable scope.
Parameters
[in]NAMEName of the created record descriptor instance.
[in]CPSCarrier Power State value.
[in]CARR_DATA_REF_LENLength of the Carrier Data Reference field.
[in]P_CARR_DATA_REFPointer to the Carrier Data Reference field.
[in]MAX_AUX_DATA_REFMaximum number of Auxiliary Data Reference fields.

Enumeration Type Documentation

Carrier Power State.

Possible Carrier Power State field values in an Alternative Carrier record.

Enumerator
NFC_AC_CPS_INACTIVE 

Alternative Carrier inactive.

NFC_AC_CPS_ACTIVE 

Alternative Carrier active.

NFC_AC_CPS_ACTIVATING 

Alternative Carrier activating.

NFC_AC_CPS_UNKNOWN 

Alternative Carrier power status unknown.

Function Documentation

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.

Parameters
[in,out]p_ac_recPointer to an ac record.
[in]p_aux_dataPointer to the Auxiliary Data Reference data buffer.
[in]aux_lengthLength of the Auxiliary Data Reference data.
Return values
NRF_SUCCESSIf the Auxiliary Data Reference was added successfully.
NRF_ERROR_NO_MEMIf 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.

Parameters
[in,out]p_ac_recPointer 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.


Documentation feedback | Developer Zone | Subscribe | Updated