Embassy
nrf-softdevice-s112

Crates

git

Versions

default

Flavors

pub unsafe fn sd_ble_gap_authenticate(
conn_handle: u16,
p_sec_params: *const ble_gap_sec_params_t
) -> u32
Expand description

@brief Initiate the GAP Authentication procedure.

@details In the peripheral role, this function will send an SMP Security Request.

@events @event{Depending on the security parameters set and the packet exchanges with the peer, the following events may be generated:} @event{@ref BLE_GAP_EVT_SEC_PARAMS_REQUEST} @event{@ref BLE_GAP_EVT_SEC_INFO_REQUEST} @event{@ref BLE_GAP_EVT_PASSKEY_DISPLAY} @event{@ref BLE_GAP_EVT_KEY_PRESSED} @event{@ref BLE_GAP_EVT_AUTH_KEY_REQUEST} @event{@ref BLE_GAP_EVT_LESC_DHKEY_REQUEST} @event{@ref BLE_GAP_EVT_CONN_SEC_UPDATE} @event{@ref BLE_GAP_EVT_AUTH_STATUS} @event{@ref BLE_GAP_EVT_TIMEOUT} @endevents

@mscs @mmsc{@ref BLE_GAP_PERIPH_SEC_REQ_MSC} @endmscs

@param[in] conn_handle Connection handle. @param[in] p_sec_params Pointer to the @ref ble_gap_sec_params_t structure with the security parameters to be used during the pairing or bonding procedure. In the peripheral role, only the bond, mitm, lesc and keypress fields of this structure are used.

@retval ::NRF_SUCCESS Successfully initiated authentication procedure. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: - No link has been established. - An encryption is already executing or queued. @retval ::NRF_ERROR_NO_MEM The maximum number of authentication procedures that can run in parallel for the given role is reached. @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.