nRF5 SDK  v15.0.0
Choose documentation:
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Hs (Handover Select) records

Generation of NFC NDEF Handover Select records for NDEF messages. More...

Modules

 Handover Select NDEF record encoder configuration
 

Data Structures

struct  nfc_hs_rec_payload_desc_t
 Handover Select record payload descriptor. More...
 

Macros

#define NFC_HS_REC_TYPE_LENGTH   2
 Size of the type field of the Handover Select record, defined in the file nfc_hs_rec.c. It is used in the NFC_NDEF_HS_RECORD_DESC_DEF macro.
 
#define NFC_NDEF_HS_RECORD_DESC_DEF(NAME,MAJOR_VERSION,MINOR_VERSION,MAX_RECORDS)
 Macro for creating and initializing an NFC NDEF record descriptor for a Handover Select record. More...
 
#define NFC_NDEF_HS_RECORD_DESC(NAME)   NFC_NDEF_GENERIC_RECORD_DESC(NAME)
 Macro for accessing the NFC NDEF Handover Select record descriptor instance that was created with NFC_NDEF_HS_RECORD_DESC_DEF.
 

Functions

ret_code_t nfc_hs_rec_payload_constructor (nfc_hs_rec_payload_desc_t *p_nfc_hs_rec_payload_desc, uint8_t *p_buff, uint32_t *p_len)
 Constructor for an NFC NDEF Handover Select record payload. More...
 
void nfc_hs_rec_local_record_clear (nfc_ndef_record_desc_t *p_hs_rec)
 Function for clearing local records in the NFC NDEF Handover Select record. More...
 
ret_code_t nfc_hs_rec_local_record_add (nfc_ndef_record_desc_t *p_hs_rec, nfc_ndef_record_desc_t *p_local_rec)
 Function for adding a local record to an NFC NDEF Handover Select record. More...
 

Variables

const uint8_t nfc_hs_rec_type_field []
 An external reference to the type field of the Handover Select record, defined in the file nfc_hs_rec.c. It is used in the NFC_NDEF_HS_RECORD_DESC_DEF macro.
 

Detailed Description

Generation of NFC NDEF Handover Select records for NDEF messages.

Macro Definition Documentation

#define NFC_NDEF_HS_RECORD_DESC_DEF (   NAME,
  MAJOR_VERSION,
  MINOR_VERSION,
  MAX_RECORDS 
)
Value:
NFC_NDEF_MSG_DEF(NAME, MAX_RECORDS); \
nfc_hs_rec_payload_desc_t NAME##_nfc_hs_rec_payload_desc = \
{ \
.major_version = MAJOR_VERSION, \
.minor_version = MINOR_VERSION, \
.p_local_records = &NFC_NDEF_MSG(NAME) \
}; \
NFC_NDEF_GENERIC_RECORD_DESC_DEF(NAME, \
0, \
0, \
&(NAME##_nfc_hs_rec_payload_desc))

Macro for creating and initializing an NFC NDEF record descriptor for a Handover Select record.

This macro creates and initializes an instance of type nfc_ndef_record_desc_t and an instance of type nfc_hs_rec_payload_desc_t, which together constitute an instance of a Handover Select record.

Use the macro NFC_NDEF_HS_RECORD_DESC to access the NDEF Handover Select 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]MAJOR_VERSIONMajor version number of the supported Connection Handover specification.
[in]MINOR_VERSIONMinor version number of the supported Connection Handover specification.
[in]MAX_RECORDSMaximum number of local records (ac records plus optional err record).

Function Documentation

ret_code_t nfc_hs_rec_local_record_add ( nfc_ndef_record_desc_t p_hs_rec,
nfc_ndef_record_desc_t p_local_rec 
)

Function for adding a local record to an NFC NDEF Handover Select record.

Parameters
[in,out]p_hs_recPointer to a Handover Select record.
[in]p_local_recPointer to a local record to add.
Return values
NRF_SUCCESSIf the local record was added successfully.
NRF_ERROR_NO_MEMIf the Handover Select record already contains the maximum number of local records.
void nfc_hs_rec_local_record_clear ( nfc_ndef_record_desc_t p_hs_rec)

Function for clearing local records in the NFC NDEF Handover Select record.

This function clears local records from the Handover Select record.

Parameters
[in,out]p_hs_recPointer to the Handover Select record descriptor.
ret_code_t nfc_hs_rec_payload_constructor ( nfc_hs_rec_payload_desc_t p_nfc_hs_rec_payload_desc,
uint8_t *  p_buff,
uint32_t *  p_len 
)

Constructor for an NFC NDEF Handover Select record payload.

This function encodes the payload of a Handover Select record as specified in the Connection Handover standard. It implements an API compatible with p_payload_constructor_t.