S145 SoftDevice for nRF54L15/nRF54L10/nRF54L05 API documentation 10.0.0
Loading...
Searching...
No Matches

◆ sd_ble_gap_encrypt()

uint32_t sd_ble_gap_encrypt ( uint16_t conn_handle,
ble_gap_master_id_t const * p_master_id,
ble_gap_enc_info_t const * p_enc_info )

#include <ble_gap.h>

Initiate GAP Encryption procedure.

In the central role, this function will initiate the encryption procedure using the encryption information provided.

Note
If the link is already encrypted, a call to this function will enable a new encryption key to be used without disconnecting the link.
Events generated
BLE_GAP_EVT_CONN_SEC_UPDATEThe connection security has been updated.
Relevant Message Sequence Charts
Central Encryption and Authentication mutual exclusion
Encryption Establishment using stored keys
Security Request Reception
Parameters
[in]conn_handleConnection handle.
[in]p_master_idPointer to a ble_gap_master_id_t master identification structure.
[in]p_enc_infoPointer to a ble_gap_enc_info_t encryption information structure.
Return values
NRF_SUCCESSSuccessfully initiated authentication procedure.
NRF_ERROR_INVALID_ADDRInvalid pointer supplied.
NRF_ERROR_INVALID_STATENo link has been established.
BLE_ERROR_INVALID_CONN_HANDLEInvalid connection handle supplied.
BLE_ERROR_INVALID_ROLEOperation is not supported in the Peripheral role.
NRF_ERROR_BUSYProcedure already in progress or not allowed at this time, wait for pending procedures to complete and retry.
BLE_ERROR_UNSUPPORTED_REMOTE_FEATUREPeer has indicated that it does not support Encryption procedure.