Bluetooth LE OOB records

BLE pairing messages contain information that tell a polling device how to pair with the device that contains the NFC tag through Bluetooth Low Energy. A BLE pairing message that works with Android devices contains one Bluetooth LE OOB record. This record contains the BLE advertising data structure that is used to establish the connection.

The following BLE pairing methods can be used in combination with this module:

  • Legacy and LE Secure Connections Just Works pairing

    The NDEF record contains basic advertising data such as device name, address, and role. In this case, pairing over NFC does not provide MITM protection - the only advantage is automation of pairing through NFC touch.

  • LE Secure Connections pairing with OOB data

    The NDEF record contains two additional data types: Confirmation Value and Random Value that are used for OOB authentication. In this case, pairing MITM protection is considered as strong as the MITM protection of NFC.

For more information about NFC Connection Handover pairing methods, refer to the Bluetooth Secure Simple Pairing Using NFC and Bluetooth Core Specification Volume 3 Part H Chapter 2.

The Bluetooth LE OOB record is used in the Bluetooth: Peripheral HIDS keyboard sample.

API documentation

Header file: include/nfc/ndef/le_oob_rec.h
Source file: subsys/nfc/ndef/le_oob_rec.c
group nfc_ndef_le_oob_rec

Generation of NFC NDEF LE OOB records for NDEF messages.

Defines

NFC_NDEF_LE_OOB_RECORD_DESC_DEF(name, payload_id, payload_desc)

Generate a description of an NFC NDEF Bluetooth Carrier Configuration LE Record.

This macro declares and initializes an instance of an NFC NDEF record description for a Bluetooth Carrier Configuration LE record.

Note

The record descriptor is declared as automatic variable, which implies that the NDEF message encoding must be done in the same variable scope.

Parameters
  • name: Name for accessing the record descriptor.

  • payload_id: NDEF record header Payload ID field (limited to one byte). If 0, no ID is present in the record description.

  • payload_desc: Pointer to the description of the payload. This data is used to create the record payload.

NFC_NDEF_LE_OOB_RECORD_DESC(NAME)

Macro for accessing the NFC NDEF Bluetooth Carrier Configuration LE record descriptor instance that was created with NFC_NDEF_LE_OOB_RECORD_DESC_DEF.

Enums

enum nfc_ndef_le_oob_rec_le_role

LE role options.

Values:

NFC_NDEF_LE_OOB_REC_LE_ROLE_PERIPH_ONLY

Only Peripheral role supported.

NFC_NDEF_LE_OOB_REC_LE_ROLE_CENTRAL_ONLY

Only Central role supported.

NFC_NDEF_LE_OOB_REC_LE_ROLE_PERIPH_PREFFERED

Peripheral and Central roles supported. Peripheral role preferred for connection establishment.

NFC_NDEF_LE_OOB_REC_LE_ROLE_CENTRAL_PREFFERED

Peripheral and Central roles supported. Central role preferred for connection establishment.

NFC_NDEF_LE_OOB_REC_LE_ROLE_OPTIONS_NUM

Total number of options.

Functions

int nfc_ndef_le_oob_rec_payload_constructor(const struct nfc_ndef_le_oob_rec_payload_desc *payload_desc, u8_t *buff, u32_t *len)

Construct the payload for a Bluetooth Carrier Configuration LE Record.

This function encodes the record payload according to the payload descriptor. It implements an API compatible with payload_constructor_t.

Parameters
  • payload_desc: Pointer to the description of the payload.

  • buff: Pointer to payload destination. If NULL, function will calculate the expected size of the record payload.

  • len: Size of available memory to write as input. Size of generated payload as output.

Return Value
  • 0: If the payload was encoded successfully.

  • -EINVAL: If parameters in the payload descriptor are invalid or missing.

  • -ENOMEM: If the predicted payload size is bigger than the provided buffer space.

Variables

const u8_t nfc_ndef_le_oob_rec_type_field[32]

External reference to the type field of the Bluetooth LE Carrier Configuration NDEF Record, defined in the file le_oob_rec.c.

struct nfc_ndef_le_oob_rec_payload_desc
#include <le_oob_rec.h>

LE OOB record payload descriptor.