nRF5 SDK v13.0.0
Modules | Enumerations | Functions
NFC BLE Pairing Lib

High level library for BLE Connection Handover pairing using NFC. More...

Modules

 Library parameters configuration
 

Enumerations

enum  nfc_pairing_mode_t {
  NFC_PAIRING_MODE_JUST_WORKS,
  NFC_PAIRING_MODE_OOB,
  NFC_PAIRING_MODE_LESC_JUST_WORKS,
  NFC_PAIRING_MODE_LESC_OOB,
  NFC_PAIRING_MODE_CNT
}
 NFC pairing types. More...
 

Functions

ret_code_t nfc_ble_pair_init (nfc_pairing_mode_t mode)
 Initializes NFC tag data and turns on tag emulation. More...
 
ret_code_t nfc_ble_pair_mode_set (nfc_pairing_mode_t mode)
 Sets pairing data and BLE security mode. More...
 
nfc_pairing_mode_t nfc_ble_pair_mode_get (void)
 Funtion to obtain current pairing mode. More...
 
void on_nfc_ble_pair_evt (const ble_evt_t *const p_ble_evt)
 NFC pairing BLE events handler. More...
 

Detailed Description

High level library for BLE Connection Handover pairing using NFC.

Enumeration Type Documentation

NFC pairing types.

Enumerator
NFC_PAIRING_MODE_JUST_WORKS 

Legacy Just Works pairing without security key

NFC_PAIRING_MODE_OOB 

Legacy OOB pairing with Temporary Key shared through NFC tag data

NFC_PAIRING_MODE_LESC_JUST_WORKS 

LESC pairing without authentication data

NFC_PAIRING_MODE_LESC_OOB 

LESC pairing with OOB authentication data

NFC_PAIRING_MODE_CNT 

Number of available pairing modes

Function Documentation

ret_code_t nfc_ble_pair_init ( nfc_pairing_mode_t  mode)

Initializes NFC tag data and turns on tag emulation.

Warning
It is assumed that Peer Manager has already been initialized before calling this function. It is also assumed that BLE advertising has already been initialized and it is configured to run in the BLE_ADV_MODE_FAST mode.
Note
This library also controls BLE advertising, so ble_advertising_on_ble_evt should not be called on BLE events.
Parameters
[in]modePairing mode, this is value of the nfc_pairing_mode_t enum.
Return values
NRF_SUCCESSIf NFC has been initialized properly.
NRF_ERROR_INVALID_PARAMIf pairing mode is invalid.
OtherOther error codes might be returned depending on used modules.
nfc_pairing_mode_t nfc_ble_pair_mode_get ( void  )

Funtion to obtain current pairing mode.

Returns
Current pairing mode.
ret_code_t nfc_ble_pair_mode_set ( nfc_pairing_mode_t  mode)

Sets pairing data and BLE security mode.

Parameters
[in]modeNew pairing mode, this is value of the nfc_pairing_mode_t enum.
Return values
NRF_SUCCESSIf new pairing mode has been set correctly.
NRF_ERROR_INVALID_PARAMIf pairing mode is invalid.
OtherOther error codes might be returned depending on used modules.
void on_nfc_ble_pair_evt ( const ble_evt_t *const  p_ble_evt)

NFC pairing BLE events handler.

Handles BLE authorization events, replying with OOB data.

Note
This function should be called inside BLE event dispatcher as it response to the BLE_GAP_EVT_AUTH_KEY_REQUEST and BLE_GAP_EVT_LESC_DHKEY_REQUEST events. It also manages BLE advertising module based on BLE_GAP_EVT_CONNECTED and BLE_GAP_EVT_DISCONNECTED events.
Parameters
[in]p_ble_evtBluetooth stack event.

Documentation feedback | Developer Zone | Subscribe | Updated