nrf-softdevice-s140

Crates

git

Versions

default

Flavors

pub unsafe fn sd_ble_gap_sec_params_reply(
conn_handle: u16,
sec_status: u8,
p_sec_params: *const ble_gap_sec_params_t,
p_sec_keyset: *const ble_gap_sec_keyset_t
) -> u32
Expand description

@brief Reply with GAP security parameters.

@details This function is only used to reply to a @ref BLE_GAP_EVT_SEC_PARAMS_REQUEST, 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_PAIRING_JW_MSC} @mmsc{@ref BLE_GAP_PERIPH_BONDING_JW_MSC} @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_PERIPH_MSC} @mmsc{@ref BLE_GAP_PERIPH_BONDING_PK_CENTRAL_OOB_MSC} @mmsc{@ref BLE_GAP_PERIPH_BONDING_STATIC_PK_MSC} @mmsc{@ref BLE_GAP_PERIPH_PAIRING_CONFIRM_FAIL_MSC} @mmsc{@ref BLE_GAP_PERIPH_LESC_PAIRING_JW_MSC} @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_NC_MSC} @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_PD_MSC} @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_PKE_CD_MSC} @mmsc{@ref BLE_GAP_PERIPH_LESC_BONDING_OOB_MSC} @mmsc{@ref BLE_GAP_PERIPH_PAIRING_KS_TOO_SMALL_MSC} @mmsc{@ref BLE_GAP_PERIPH_PAIRING_APP_ERROR_MSC} @mmsc{@ref BLE_GAP_PERIPH_PAIRING_REMOTE_PAIRING_FAIL_MSC} @mmsc{@ref BLE_GAP_PERIPH_PAIRING_TIMEOUT_MSC} @mmsc{@ref BLE_GAP_CENTRAL_PAIRING_JW_MSC} @mmsc{@ref BLE_GAP_CENTRAL_BONDING_JW_MSC} @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_MSC} @mmsc{@ref BLE_GAP_CENTRAL_BONDING_PK_PERIPH_OOB_MSC} @mmsc{@ref BLE_GAP_CENTRAL_LESC_PAIRING_JW_MSC} @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_NC_MSC} @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_PD_MSC} @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_PKE_CD_MSC} @mmsc{@ref BLE_GAP_CENTRAL_LESC_BONDING_OOB_MSC} @endmscs

@param[in] conn_handle Connection handle. @param[in] sec_status Security status, see @ref BLE_GAP_SEC_STATUS. @param[in] p_sec_params Pointer to a @ref ble_gap_sec_params_t security parameters structure. In the central role this must be set to NULL, as the parameters have already been provided during a previous call to @ref sd_ble_gap_authenticate. @param[in,out] p_sec_keyset Pointer to a @ref ble_gap_sec_keyset_t security keyset structure. Any keys generated and/or distributed as a result of the ongoing security procedure will be stored into the memory referenced by the pointers inside this structure. The keys will be stored and available to the application upon reception of a @ref BLE_GAP_EVT_AUTH_STATUS event. Note that the SoftDevice expects the application to provide memory for storing the peer’s keys. So it must be ensured that the relevant pointers inside this structure are not NULL. The pointers to the local key can, however, be NULL, in which case, the local key data will not be available to the application upon reception of the @ref BLE_GAP_EVT_AUTH_STATUS event.

@retval ::NRF_SUCCESS Successfully accepted security parameter from the application. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::NRF_ERROR_BUSY The stack is busy, process pending events and retry. @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied. @retval ::NRF_ERROR_INVALID_STATE Security parameters has not been requested. @retval ::BLE_ERROR_INVALID_CONN_HANDLE Invalid connection handle supplied. @retval ::NRF_ERROR_NOT_SUPPORTED Setting of sign or link fields in @ref ble_gap_sec_kdist_t not supported. Distribution of own Identity Information is only supported if the Central Address Resolution characteristic is configured to be included or the Softdevice is configured to support peripheral roles only. See @ref ble_gap_cfg_car_incl_cfg_t and @ref ble_gap_cfg_role_count_t.