nRF5 SDK v15.3.0
BLE pairing message generation

BLE pairing messages contain information that tells a polling device how to pair with the device that contains the NFC tag through Bluetooth low energy. Different types of messages exist, depending on what devices are targeted and what kind of pairing is used. The message format is partly based on the NFC Forum Application Document Bluetooth Secure Simple Pairing Using NFC, extended with non-standard messages that work with Windows Phone.

A BLE pairing message that works with Android devices contains one Bluetooth LE OOB record (see LE OOB records), which contains the BLE advertising data structure that is used to establish the connection. This message has the type NFC_BLE_PAIR_MSG_BLUETOOTH_LE_SHORT.

A non-standard BLE pairing message that works with Windows Phone devices contains one Bluetooth EP OOB record (see EP OOB records). Note that this message does not comply with the Bluetooth Secure Simple Pairing Using NFC document and Bluetooth EP OOB records are usually used for classic Bluetooth handover. The record contains the BLE advertising data structure that is used to establish the connection. This message has the type NFC_BLE_PAIR_MSG_BLUETOOTH_EP_SHORT.

The module, which is responsible for encoding of the BLE advertising data (present in both types of OOB records: LE and EP), can support only OOB-related BLE AD types with default settings. These AD types are listed in the Bluetooth Secure Simple Pairing Using NFC as: Security Manager OOB Pairing Required and Optional Data Types. However, you can force the encoding module to support all types of the BLE advertising data with ADVANCED_ADVDATA_SUPPORT in nfc_ble_oob_advdata_dox_config.h. In this case, calculation of the NDEF message length with NULL payload buffer is not supported (refer to the code example in Creating a message).

A full BLE pairing message that works with both Android and Windows Phone devices contains one Bluetooth LE OOB record, one non-standard Bluetooth EP OOB record, and one Handover Select record (see Hs (Handover Select) records), which contains two Alternative Carrier records (see ac (Alternative carrier) records) that point to the two other records. This message is called a Handover Select Message and has the type NFC_BLE_PAIR_MSG_FULL.

connection_handover.svg
Structure of a Handover Select Message

Four types of pairing methods are supported by the library:

The library supports dynamic replacing of OOB keys without encoding a whole new message. This feature allows to change OOB authentication data for each connection attempt.

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 LE OOB records, EP OOB records, and Hs (Handover Select) records modules provide functions for creating the records, and the BLE pairing messages module provides functions for creating and encoding the messages. Additionally, the LE OOB and the EP OOB records use the Advertising and Scan Response Data Encoder for NFC OOB pairing module to create their payload.

Note that you can choose a pairing method by passing NULL for the p_tk_value and/or p_lesc_data arguments. In addition, the security parameters must be set properly for each pairing method (see the first code snippet). For more examples of NFC Connection Handover pairing methods usage, see NFC BLE pairing library.

BLE pairing messages can be parsed by the NFC Connection Handover Message Parser.


Documentation feedback | Developer Zone | Subscribe | Updated