S115 SoftDevice for nRF54LV10 API documentation 10.0.0
Loading...
Searching...
No Matches

◆ sd_ble_gap_auth_key_reply()

uint32_t sd_ble_gap_auth_key_reply ( uint16_t conn_handle,
uint8_t key_type,
uint8_t const * p_key )

#include <ble_gap.h>

Reply with an authentication key.

This function is only used to reply to a BLE_GAP_EVT_AUTH_KEY_REQUEST or a BLE_GAP_EVT_PASSKEY_DISPLAY, calling it at other times will result in an NRF_ERROR_INVALID_STATE.

Events generated
This function is used during authentication procedures, see the list of events in the documentation of sd_ble_gap_authenticate.
Relevant Message Sequence Charts
Peripheral Legacy Bonding: Passkey Entry, User Inputs on Peripheral
Peripheral Legacy Bonding: Out of Band
Peripheral LESC Bonding: Numeric Comparison
Peripheral LESC Bonding: Passkey Entry, User Inputs on Peripheral
Parameters
[in]conn_handleConnection handle.
[in]key_typeSee GAP Authentication Key Types.
[in]p_keyIf key type is BLE_GAP_AUTH_KEY_TYPE_NONE, then NULL. If key type is 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 BLE_GAP_AUTH_KEY_TYPE_OOB, then a 16-byte OOB key value in little-endian format.
Return values
NRF_SUCCESSAuthentication key successfully set.
NRF_ERROR_INVALID_ADDRInvalid pointer supplied.
NRF_ERROR_INVALID_PARAMInvalid parameter(s) supplied.
NRF_ERROR_INVALID_STATEAuthentication key has not been requested.
BLE_ERROR_INVALID_CONN_HANDLEInvalid connection handle supplied.