[][src]Function nrf_softdevice_s113::sd_ble_gap_auth_key_reply

pub unsafe fn sd_ble_gap_auth_key_reply(
    conn_handle: u16,
    key_type: u8,
    p_key: *const u8
) -> u32

@brief Reply with an authentication key.

@details This function is only used to reply to a @ref BLE_GAP_EVT_AUTH_KEY_REQUEST or a @ref BLE_GAP_EVT_PASSKEY_DISPLAY, calling it at other times will result in an @ref NRF_ERROR_INVALID_STATE. @note If the call returns an error code, the request is still pending, and the reply call may be repeated with corrected parameters.

@events @event{This function is used during authentication procedures, see the list of events in the documentation of @ref sd_ble_gap_authenticate.} @endevents

@mscs @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC} @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC} @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} @endmscs

@param[in] conn_handle Connection handle. @param[in] key_type See @ref BLE_GAP_AUTH_KEY_TYPES. @param[in] p_key If key type is @ref BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL. If key type is @ref BLE_GAP_AUTH_KEY_TYPE_PASSKEY, then a 6-byte ASCII string (digit 0..9 only, no NULL termination) or NULL when confirming LE Secure Connections Numeric Comparison. If key type is @ref BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in little-endian format.

@retval ::NRF_SUCCESS Authentication key successfully set. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. @retval ::NRF_ERROR_INVALID_STATE Authentication key has not been requested. @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied.