BLE_GAP_EnableEncryption

C

uint16_t BLE_GAP_EnableEncryption(uint16_t connHandle, uint8_t *p_random, uint8_t *p_ediv, uint8_t *p_ltk);

Description

Authenticates and encrypts the connection using the provided encryption key.

Note

This command should only be used when the local device's role is Central.

Parameters

ParameterDescription
[in] connHandleConnection handle associated with this connection.
[in] p_randomPointer to a 64-bit random number.
[in] p_edivPointer to a 16-bit encrypted diversifier.
[in] p_ltkPointer to a 128-bit long-term key (LTK).

Return values

Return valueDescription
MBA_RES_SUCCESSSuccessfully starts the encryption process.
MBA_RES_OOMInternal memory allocation failure occurred.
MBA_RES_INVALID_PARAThe parameters provided are invalid.
MBA_RES_COMMAND_DISALLOWEDCommand disallowed due to a conflicting operation or state.