| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
ac (Alternative carrier) records
BLE pairing messages

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 | 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 []
| 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:
static nfc_ac_rec_data_ref_t NAME##_nfc_ac_rec_aux_data_ref_array[MAX_AUX_DATA_REF]; \
static 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, \
TNF_WELL_KNOWN, \
0, \
0, \
nfc_ac_rec_type_field, \
NFC_AC_REC_TYPE_LENGTH, \
nfc_ac_rec_payload_constructor, \
&(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 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.

Parameters

  [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.

## Enumeration Type Documentation

enum nfc_ac_rec_cps_t

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_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.

Return values

  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.

Parameters

  [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.