1.2.2.1.4.4.8 BLE_SMP_InitiatePairing

C

uint16_t BLE_SMP_InitiatePairing(uint16_t connHandle);

Description

Initiate pairing procedure.

Note

If Pairing is initiated (unbonded devices) then following happens:

  • Phase 1: Pairing Feature Exchange.

  • Phase 2 (LE legacy pairing): Short Term Key (STK) Generation.

  • Phase 2 (LE Secure Connections): Long Term Key (LTK) Generation.

  • Phase 3: Transport Specific Key Distribution. The pairing method for Phase 2 is chosen based on IO Capabilities and Authentication request. flag. For phase 3:

    • LE Secure connection pairing: CSRK and IRK may be distributed.

    • LE Legacy pairing: Encryption key (LTK, EDIV, Rand), CSRK and IRK may be distributed.

Events generated

Depending on the pairing parameters configured by BLE_SMP_Config and the pairing feature exchanges with the peer, the following events may be generated:

BLE_SMP_EVT_PAIRING_COMPLETE Generated when pairing process is completed or failed.

BLE_SMP_EVT_NUMERIC_COMPARISON_CONFIRM_REQUEST Generated when received confirmation request for 6-digit values during pairing process (Numeric comparison).

BLE_SMP_EVT_INPUT_PASSKEY_REQUEST Generated when passkey is requested to be input during pairing process (Passkey entry).

BLE_SMP_EVT_DISPLAY_PASSKEY_REQUEST Generated when request to display passkey during pairing process (Passkey entry).

BLE_SMP_EVT_NOTIFY_KEYS Generated when key distribution finished.

BLE_SMP_EVT_PAIRING_REQUEST Generated when received pairing request from remote device.

BLE_SMP_EVT_INPUT_OOB_DATA_REQUEST Generated when OOB data for legacy pairing is requested to be input during pairing process (Out of Band).

BLE_SMP_EVT_INPUT_SC_OOB_DATA_REQUEST Generated when OOB data for Secure Connections pairing is requested to be input during pairing process (Out of Band).

BLE_SMP_EVT_KEYPRESS Generated when keypress notification from the remote device.

Parameters

ParameterDescription
[in] connHandleConnection handle associated with this connection.

Return values

Return valueDescription
MBA_RES_SUCCESSPairing procedure started successfully.
MBA_RES_FAILThe specified connection handle is invalid.