| 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 | Functions | Variables
Hs (Handover Select) records
BLE pairing messages

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

## 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); \
static 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, \
TNF_WELL_KNOWN, \
0, \
0, \
nfc_hs_rec_type_field , \
NFC_HS_REC_TYPE_LENGTH, \
nfc_hs_rec_payload_constructor, \
&(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 a static instance of type nfc_ndef_record_desc_t and a static 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.

Parameters

  [in] | NAME | Name of the created record descriptor instance.
  [in] | MAJOR_VERSION | Major version number of the supported Connection Handover specification.
  [in] | MINOR_VERSION | Minor version number of the supported Connection Handover specification.
  [in] | MAX_RECORDS | Maximum 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_rec | Pointer to a Handover Select record.
  [in] | p_local_rec | Pointer to a local record to add.

Return values

  NRF_SUCCESS | If the local record was added successfully.
  NRF_ERROR_NO_MEM | If 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_rec | Pointer 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.