Functions | |
uint32_t | sd_ble_gap_addr_set (ble_gap_addr_t const *p_addr) |
Set the local Bluetooth identity address. More... | |
uint32_t | sd_ble_gap_addr_get (ble_gap_addr_t *p_addr) |
Get local Bluetooth identity address. More... | |
uint32_t | sd_ble_gap_adv_addr_get (uint8_t adv_handle, ble_gap_addr_t *p_addr) |
Get the Bluetooth device address used by the advertiser. More... | |
uint32_t | sd_ble_gap_whitelist_set (ble_gap_addr_t const *const *pp_wl_addrs, uint8_t len) |
Set the active whitelist in the SoftDevice. More... | |
uint32_t | sd_ble_gap_device_identities_set (ble_gap_id_key_t const *const *pp_id_keys, ble_gap_irk_t const *const *pp_local_irks, uint8_t len) |
Set device identity list. More... | |
uint32_t | sd_ble_gap_privacy_set (ble_gap_privacy_params_t const *p_privacy_params) |
Set privacy settings. More... | |
uint32_t | sd_ble_gap_privacy_get (ble_gap_privacy_params_t *p_privacy_params) |
Get privacy settings. More... | |
uint32_t | sd_ble_gap_adv_set_configure (uint8_t *p_adv_handle, ble_gap_adv_data_t const *p_adv_data, ble_gap_adv_params_t const *p_adv_params) |
Configure an advertising set. Set, clear or update advertising and scan response data. More... | |
uint32_t | sd_ble_gap_adv_start (uint8_t adv_handle, uint8_t conn_cfg_tag) |
Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). More... | |
uint32_t | sd_ble_gap_adv_stop (uint8_t adv_handle) |
Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure). More... | |
uint32_t | sd_ble_gap_conn_param_update (uint16_t conn_handle, ble_gap_conn_params_t const *p_conn_params) |
Update connection parameters. More... | |
uint32_t | sd_ble_gap_disconnect (uint16_t conn_handle, uint8_t hci_status_code) |
Disconnect (GAP Link Termination). More... | |
uint32_t | sd_ble_gap_tx_power_set (uint8_t role, uint16_t handle, int8_t tx_power) |
Set the radio's transmit power. More... | |
uint32_t | sd_ble_gap_appearance_set (uint16_t appearance) |
Set GAP Appearance value. More... | |
uint32_t | sd_ble_gap_appearance_get (uint16_t *p_appearance) |
Get GAP Appearance value. More... | |
uint32_t | sd_ble_gap_ppcp_set (ble_gap_conn_params_t const *p_conn_params) |
Set GAP Peripheral Preferred Connection Parameters. More... | |
uint32_t | sd_ble_gap_ppcp_get (ble_gap_conn_params_t *p_conn_params) |
Get GAP Peripheral Preferred Connection Parameters. More... | |
uint32_t | sd_ble_gap_device_name_set (ble_gap_conn_sec_mode_t const *p_write_perm, uint8_t const *p_dev_name, uint16_t len) |
Set GAP device name. More... | |
uint32_t | sd_ble_gap_device_name_get (uint8_t *p_dev_name, uint16_t *p_len) |
Get GAP device name. More... | |
uint32_t | sd_ble_gap_authenticate (uint16_t conn_handle, ble_gap_sec_params_t const *p_sec_params) |
Initiate the GAP Authentication procedure. More... | |
uint32_t | sd_ble_gap_sec_params_reply (uint16_t conn_handle, uint8_t sec_status, ble_gap_sec_params_t const *p_sec_params, ble_gap_sec_keyset_t const *p_sec_keyset) |
Reply with GAP security parameters. More... | |
uint32_t | sd_ble_gap_auth_key_reply (uint16_t conn_handle, uint8_t key_type, uint8_t const *p_key) |
Reply with an authentication key. More... | |
uint32_t | sd_ble_gap_lesc_dhkey_reply (uint16_t conn_handle, ble_gap_lesc_dhkey_t const *p_dhkey) |
Reply with an LE Secure connections DHKey. More... | |
uint32_t | sd_ble_gap_keypress_notify (uint16_t conn_handle, uint8_t kp_not) |
Notify the peer of a local keypress. More... | |
uint32_t | sd_ble_gap_lesc_oob_data_get (uint16_t conn_handle, ble_gap_lesc_p256_pk_t const *p_pk_own, ble_gap_lesc_oob_data_t *p_oobd_own) |
Generate a set of OOB data to send to a peer out of band. More... | |
uint32_t | sd_ble_gap_lesc_oob_data_set (uint16_t conn_handle, ble_gap_lesc_oob_data_t const *p_oobd_own, ble_gap_lesc_oob_data_t const *p_oobd_peer) |
Provide the OOB data sent/received out of band. More... | |
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) |
Initiate GAP Encryption procedure. More... | |
uint32_t | sd_ble_gap_sec_info_reply (uint16_t conn_handle, ble_gap_enc_info_t const *p_enc_info, ble_gap_irk_t const *p_id_info, ble_gap_sign_info_t const *p_sign_info) |
Reply with GAP security information. More... | |
uint32_t | sd_ble_gap_conn_sec_get (uint16_t conn_handle, ble_gap_conn_sec_t *p_conn_sec) |
Get the current connection security. More... | |
uint32_t | sd_ble_gap_rssi_start (uint16_t conn_handle, uint8_t threshold_dbm, uint8_t skip_count) |
Start reporting the received signal strength to the application. More... | |
uint32_t | sd_ble_gap_rssi_stop (uint16_t conn_handle) |
Stop reporting the received signal strength. More... | |
uint32_t | sd_ble_gap_rssi_get (uint16_t conn_handle, int8_t *p_rssi, uint8_t *p_ch_index) |
Get the received signal strength for the last connection event. More... | |
uint32_t | sd_ble_gap_scan_start (ble_gap_scan_params_t const *p_scan_params, ble_data_t const *p_adv_report_buffer) |
Start or continue scanning (GAP Discovery procedure, Observer Procedure). More... | |
uint32_t | sd_ble_gap_scan_stop (void) |
Stop scanning (GAP Discovery procedure, Observer Procedure). More... | |
uint32_t | sd_ble_gap_connect (ble_gap_addr_t const *p_peer_addr, ble_gap_scan_params_t const *p_scan_params, ble_gap_conn_params_t const *p_conn_params, uint8_t conn_cfg_tag) |
Create a connection (GAP Link Establishment). More... | |
uint32_t | sd_ble_gap_connect_cancel (void) |
Cancel a connection establishment. More... | |
uint32_t | sd_ble_gap_phy_update (uint16_t conn_handle, ble_gap_phys_t const *p_gap_phys) |
Initiate or respond to a PHY Update Procedure. More... | |
uint32_t | sd_ble_gap_data_length_update (uint16_t conn_handle, ble_gap_data_length_params_t const *p_dl_params, ble_gap_data_length_limitation_t *p_dl_limitation) |
Initiate or respond to a Data Length Update Procedure. More... | |
uint32_t | sd_ble_gap_qos_channel_survey_start (uint32_t interval_us) |
Start the Quality of Service (QoS) channel survey module. More... | |
uint32_t | sd_ble_gap_qos_channel_survey_stop (void) |
Stop the Quality of Service (QoS) channel survey module. More... | |
uint32_t | sd_ble_gap_next_conn_evt_counter_get (uint16_t conn_handle, uint16_t *p_counter) |
Obtain the next connection event counter value. More... | |
uint32_t | sd_ble_gap_conn_evt_trigger_start (uint16_t conn_handle, ble_gap_conn_event_trigger_t const *p_params) |
Start triggering a given task on connection event start. More... | |
uint32_t | sd_ble_gap_conn_evt_trigger_stop (uint16_t conn_handle) |
Stop triggering the task configured using sd_ble_gap_conn_evt_trigger_start. More... | |
uint32_t sd_ble_gap_addr_get | ( | ble_gap_addr_t * | p_addr | ) |
Get local Bluetooth identity address.
[out] | p_addr | Pointer to address structure to be filled in. |
NRF_SUCCESS | Address successfully retrieved. |
NRF_ERROR_INVALID_ADDR | Invalid or NULL pointer supplied. |
uint32_t sd_ble_gap_addr_set | ( | ble_gap_addr_t const * | p_addr | ) |
Set the local Bluetooth identity address.
The local Bluetooth identity address is the address that identifies this device to other peers. The address type must be either @ref BLE_GAP_ADDR_TYPE_PUBLIC or @ref BLE_GAP_ADDR_TYPE_RANDOM_STATIC.
Advertising |
[in] | p_addr | Pointer to address structure. |
NRF_SUCCESS | Address successfully set. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
BLE_ERROR_GAP_INVALID_BLE_ADDR | Invalid address. |
NRF_ERROR_BUSY | The stack is busy, process pending events and retry. |
NRF_ERROR_INVALID_STATE | The identity address cannot be changed while advertising, scanning or creating a connection. |
uint32_t sd_ble_gap_adv_addr_get | ( | uint8_t | adv_handle, |
ble_gap_addr_t * | p_addr | ||
) |
Get the Bluetooth device address used by the advertiser.
[in] | adv_handle | The advertising handle to get the address from. |
[out] | p_addr | Pointer to address structure to be filled in. |
NRF_SUCCESS | Address successfully retrieved. |
NRF_ERROR_INVALID_ADDR | Invalid or NULL pointer supplied. |
BLE_ERROR_INVALID_ADV_HANDLE | The provided advertising handle was not found. |
NRF_ERROR_INVALID_STATE | The advertising set is currently not advertising. |
uint32_t sd_ble_gap_adv_set_configure | ( | uint8_t * | p_adv_handle, |
ble_gap_adv_data_t const * | p_adv_data, | ||
ble_gap_adv_params_t const * | p_adv_params | ||
) |
Configure an advertising set. Set, clear or update advertising and scan response data.
Advertising |
Whitelist Sharing |
[in,out] | p_adv_handle | Provide a pointer to a handle containing BLE_GAP_ADV_SET_HANDLE_NOT_SET to configure a new advertising set. On success, a new handle is then returned through the pointer. Provide a pointer to an existing advertising handle to configure an existing advertising set. |
[in] | p_adv_data | Advertising data. If set to NULL, no advertising data will be used. See ble_gap_adv_data_t. |
[in] | p_adv_params | Advertising parameters. When this function is used to update advertising data while advertising, this parameter must be NULL. See ble_gap_adv_params_t. |
NRF_SUCCESS | Advertising set successfully configured. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied:
|
BLE_ERROR_GAP_INVALID_BLE_ADDR | ble_gap_adv_params_t::p_peer_addr is invalid. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. Either:
|
BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST | Discoverable mode and whitelist incompatible. |
BLE_ERROR_INVALID_ADV_HANDLE | The provided advertising handle was not found. Use BLE_GAP_ADV_SET_HANDLE_NOT_SET to configure a new advertising handle. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_FLAGS | Invalid combination of advertising flags supplied. |
NRF_ERROR_INVALID_DATA | Invalid data type(s) supplied. Check the advertising data format specification given in Bluetooth Specification Version 5.0, Volume 3, Part C, Chapter 11. |
NRF_ERROR_INVALID_LENGTH | Invalid data length(s) supplied. |
NRF_ERROR_NOT_SUPPORTED | Unsupported data length or advertising parameter configuration. |
NRF_ERROR_NO_MEM | Not enough memory to configure a new advertising handle. Update an existing advertising handle instead. |
BLE_ERROR_GAP_UUID_LIST_MISMATCH | Invalid UUID list supplied. |
uint32_t sd_ble_gap_adv_start | ( | uint8_t | adv_handle, |
uint8_t | conn_cfg_tag | ||
) |
Start advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
BLE_GAP_EVT_CONNECTED | Generated after connection has been established through connectable advertising. |
BLE_GAP_EVT_ADV_SET_TERMINATED | Advertising set has terminated. |
BLE_GAP_EVT_SCAN_REQ_REPORT | A scan request was received. |
Advertising |
Peripheral Connection Establishment with Private Peer |
Directed Advertising |
Whitelist Sharing |
[in] | adv_handle | Advertising handle to advertise on, received from sd_ble_gap_adv_set_configure. |
[in] | conn_cfg_tag | Tag identifying a configuration set by sd_ble_cfg_set or BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. For non-connectable advertising, this is ignored. |
NRF_SUCCESS | The BLE stack has started advertising. |
NRF_ERROR_INVALID_STATE | adv_handle is not configured or already advertising. |
NRF_ERROR_CONN_COUNT | The limit of available connections for this connection configuration tag has been reached; connectable advertiser cannot be started. To increase the number of available connections, use sd_ble_cfg_set with BLE_GAP_CFG_ROLE_COUNT or BLE_CONN_CFG_GAP. |
BLE_ERROR_INVALID_ADV_HANDLE | Advertising handle not found. Configure a new adveriting handle with sd_ble_gap_adv_set_configure. |
NRF_ERROR_NOT_FOUND | conn_cfg_tag not found. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied:
|
NRF_ERROR_RESOURCES | Either:
|
NRF_ERROR_NOT_SUPPORTED | Unsupported PHYs supplied to the call. |
uint32_t sd_ble_gap_adv_stop | ( | uint8_t | adv_handle | ) |
Stop advertising (GAP Discoverable, Connectable modes, Broadcast Procedure).
Advertising |
Whitelist Sharing |
[in] | adv_handle | The advertising handle that should stop advertising. |
NRF_SUCCESS | The BLE stack has stopped advertising. |
BLE_ERROR_INVALID_ADV_HANDLE | Invalid advertising handle. |
NRF_ERROR_INVALID_STATE | The advertising handle is not advertising. |
uint32_t sd_ble_gap_appearance_get | ( | uint16_t * | p_appearance | ) |
Get GAP Appearance value.
[out] | p_appearance | Pointer to appearance (16-bit) to be filled in, see Bluetooth Appearance values. |
NRF_SUCCESS | Appearance value retrieved successfully. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
uint32_t sd_ble_gap_appearance_set | ( | uint16_t | appearance | ) |
Set GAP Appearance value.
[in] | appearance | Appearance (16-bit), see Bluetooth Appearance values. |
NRF_SUCCESS | Appearance value set successfully. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
uint32_t sd_ble_gap_auth_key_reply | ( | uint16_t | conn_handle, |
uint8_t | key_type, | ||
uint8_t const * | p_key | ||
) |
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.
This function is used during authentication procedures, see the list of events in the documentation of sd_ble_gap_authenticate. |
[in] | conn_handle | Connection handle. |
[in] | key_type | See GAP Authentication Key Types. |
[in] | p_key | If 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. |
NRF_SUCCESS | Authentication key successfully set. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_STATE | Authentication key has not been requested. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
uint32_t sd_ble_gap_authenticate | ( | uint16_t | conn_handle, |
ble_gap_sec_params_t const * | p_sec_params | ||
) |
Initiate the GAP Authentication procedure.
In the central role, this function will send an SMP Pairing Request (or an SMP Pairing Failed if rejected), otherwise in the peripheral role, an SMP Security Request will be sent.
Depending on the security parameters set and the packet exchanges with the peer, the following events may be generated: | |
BLE_GAP_EVT_SEC_PARAMS_REQUEST | |
BLE_GAP_EVT_SEC_INFO_REQUEST | |
BLE_GAP_EVT_PASSKEY_DISPLAY | |
BLE_GAP_EVT_KEY_PRESSED | |
BLE_GAP_EVT_AUTH_KEY_REQUEST | |
BLE_GAP_EVT_LESC_DHKEY_REQUEST | |
BLE_GAP_EVT_CONN_SEC_UPDATE | |
BLE_GAP_EVT_AUTH_STATUS | |
BLE_GAP_EVT_TIMEOUT |
[in] | conn_handle | Connection handle. |
[in] | p_sec_params | Pointer to the 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. In the central role, this pointer may be NULL to reject a Security Request. |
NRF_SUCCESS | Successfully initiated authentication procedure. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. Either:
|
NRF_ERROR_NO_MEM | The maximum number of authentication procedures that can run in parallel for the given role is reached. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
NRF_ERROR_NOT_SUPPORTED | Setting of sign or link fields in 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 ble_gap_cfg_car_incl_cfg_t and ble_gap_cfg_role_count_t. |
NRF_ERROR_TIMEOUT | A SMP timeout has occurred, and further SMP operations on this link is prohibited. |
uint32_t sd_ble_gap_conn_evt_trigger_start | ( | uint16_t | conn_handle, |
ble_gap_conn_event_trigger_t const * | p_params | ||
) |
Start triggering a given task on connection event start.
When enabled, this feature will trigger a PPI task at the start of connection events. The application can configure the SoftDevice to trigger every N connection events starting from a given connection event counter. See also ble_gap_conn_event_trigger_t.
[in] | conn_handle | Connection handle. |
[in] | p_params | Connection event trigger parameters. |
NRF_SUCCESS | Success. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter supplied. See ble_gap_conn_event_trigger_t. |
NRF_ERROR_INVALID_STATE | Either:
|
uint32_t sd_ble_gap_conn_evt_trigger_stop | ( | uint16_t | conn_handle | ) |
Stop triggering the task configured using sd_ble_gap_conn_evt_trigger_start.
[in] | conn_handle | Connection handle. |
NRF_SUCCESS | Success. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
NRF_ERROR_INVALID_STATE | Trying to stop connection event triggering when it is not enabled. |
uint32_t sd_ble_gap_conn_param_update | ( | uint16_t | conn_handle, |
ble_gap_conn_params_t const * | p_conn_params | ||
) |
Update connection parameters.
In the central role this will initiate a Link Layer connection parameter update procedure, otherwise in the peripheral role, this will send the corresponding L2CAP request and wait for the central to perform the procedure. In both cases, and regardless of success or failure, the application will be informed of the result with a BLE_GAP_EVT_CONN_PARAM_UPDATE event.
This function can be used as a central both to reply to a BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST or to start the procedure unrequested.
BLE_GAP_EVT_CONN_PARAM_UPDATE | Result of the connection parameter update procedure. |
[in] | conn_handle | Connection handle. |
[in] | p_conn_params | Pointer to desired connection parameters. If NULL is provided on a peripheral role, the parameters in the PPCP characteristic of the GAP service will be used instead. If NULL is provided on a central role and in response to a BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST, the peripheral request will be rejected |
NRF_SUCCESS | The Connection Update procedure has been started successfully. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied, check parameter limits and constraints. |
NRF_ERROR_INVALID_STATE | Disconnection in progress or link has not been established. |
NRF_ERROR_BUSY | Procedure already in progress, wait for pending procedures to complete and retry. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
NRF_ERROR_NO_MEM | Not enough memory to complete operation. |
uint32_t sd_ble_gap_conn_sec_get | ( | uint16_t | conn_handle, |
ble_gap_conn_sec_t * | p_conn_sec | ||
) |
Get the current connection security.
[in] | conn_handle | Connection handle. |
[out] | p_conn_sec | Pointer to a ble_gap_conn_sec_t structure to be filled in. |
NRF_SUCCESS | Current connection security successfully retrieved. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
uint32_t sd_ble_gap_connect | ( | ble_gap_addr_t const * | p_peer_addr, |
ble_gap_scan_params_t const * | p_scan_params, | ||
ble_gap_conn_params_t const * | p_conn_params, | ||
uint8_t | conn_cfg_tag | ||
) |
Create a connection (GAP Link Establishment).
BLE_GAP_EVT_CONNECTED | A connection was established. |
BLE_GAP_EVT_TIMEOUT | Failed to establish a connection. |
Whitelist Sharing |
Central Connection Establishment with Private Peer |
Central Connection Establishment and Termination |
[in] | p_peer_addr | Pointer to peer identity address. If ble_gap_scan_params_t::filter_policy is set to use whitelist, then p_peer_addr is ignored. |
[in] | p_scan_params | Pointer to scan parameters structure. |
[in] | p_conn_params | Pointer to desired connection parameters. |
[in] | conn_cfg_tag | Tag identifying a configuration set by sd_ble_cfg_set or BLE_CONN_CFG_TAG_DEFAULT to use the default connection configuration. |
NRF_SUCCESS | Successfully initiated connection procedure. |
NRF_ERROR_INVALID_ADDR | Invalid parameter(s) pointer supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied.
|
NRF_ERROR_NOT_FOUND | conn_cfg_tag not found. |
NRF_ERROR_INVALID_STATE | The SoftDevice is in an invalid state to perform this operation. This may be due to an existing locally initiated connect procedure, which must complete before initiating again. |
BLE_ERROR_GAP_INVALID_BLE_ADDR | Invalid Peer address. |
NRF_ERROR_CONN_COUNT | The limit of available connections for this connection configuration tag has been reached. To increase the number of available connections, use sd_ble_cfg_set with BLE_GAP_CFG_ROLE_COUNT or BLE_CONN_CFG_GAP. |
NRF_ERROR_RESOURCES | Either:
|
NRF_ERROR_NOT_SUPPORTED | Unsupported PHYs supplied to the call. |
uint32_t sd_ble_gap_connect_cancel | ( | void | ) |
Cancel a connection establishment.
Central Connection Establishment and Termination |
NRF_SUCCESS | Successfully canceled an ongoing connection procedure. |
NRF_ERROR_INVALID_STATE | No locally initiated connect procedure started or connection completed occurred. |
uint32_t sd_ble_gap_data_length_update | ( | uint16_t | conn_handle, |
ble_gap_data_length_params_t const * | p_dl_params, | ||
ble_gap_data_length_limitation_t * | p_dl_limitation | ||
) |
Initiate or respond to a Data Length Update Procedure.
[in] | conn_handle | Connection handle. |
[in] | p_dl_params | Pointer to local parameters to be used in Data Length Update Procedure. Set any member to BLE_GAP_DATA_LENGTH_AUTO to let the SoftDevice automatically decide the value for that member. Set to NULL to use automatic values for all members. |
[out] | p_dl_limitation | Pointer to limitation to be written when local device does not have enough resources or does not support the requested Data Length Update parameters. Ignored if NULL. |
Data Length Update Procedure |
NRF_SUCCESS | Successfully set Data Length Extension initiation/response parameters. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle parameter supplied. |
NRF_ERROR_INVALID_STATE | No link has been established. |
NRF_ERROR_INVALID_PARAM | Invalid parameters supplied. |
NRF_ERROR_NOT_SUPPORTED | The requested parameters are not supported by the SoftDevice. Inspect p_dl_limitation to see which parameter is not supported. |
NRF_ERROR_RESOURCES | The connection event length configured for this link is not sufficient for the requested parameters. Use sd_ble_cfg_set with BLE_CONN_CFG_GAP to increase the connection event length. Inspect p_dl_limitation to see where the limitation is. |
NRF_ERROR_BUSY | Peer has already initiated a Data Length Update Procedure. Process the pending BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST event to respond. |
uint32_t sd_ble_gap_device_identities_set | ( | ble_gap_id_key_t const *const * | pp_id_keys, |
ble_gap_irk_t const *const * | pp_local_irks, | ||
uint8_t | len | ||
) |
Set device identity list.
[in] | pp_id_keys | Pointer to an array of peer identity addresses and peer IRKs, if NULL the device identity list will be cleared. |
[in] | pp_local_irks | Pointer to an array of local IRKs. Each entry in the array maps to the entry in pp_id_keys at the same index. To fill in the list with the currently set device IRK for all peers, set to NULL. |
[in] | len | Length of the device identity list, maximum BLE_GAP_DEVICE_IDENTITIES_MAX_COUNT. |
Private Advertising |
Private Scanning |
Scan Private Devices |
Directed Advertising |
Peripheral Connection Establishment with Private Peer |
Central Connection Establishment with Private Peer |
NRF_SUCCESS | The device identity list successfully set/cleared. |
NRF_ERROR_INVALID_ADDR | The device identity list (or one of its entries) provided is invalid. This code may be returned if the local IRK list also has an invalid entry. |
BLE_ERROR_GAP_DEVICE_IDENTITIES_IN_USE | The device identity list is in use and cannot be set or cleared. |
BLE_ERROR_GAP_DEVICE_IDENTITIES_DUPLICATE | The device identity list contains multiple entries with the same identity address. |
BLE_ERROR_GAP_INVALID_BLE_ADDR | Invalid address type is supplied. |
NRF_ERROR_DATA_SIZE | The given device identity list size invalid (zero or too large); this can only return when pp_id_keys is not NULL. |
uint32_t sd_ble_gap_device_name_get | ( | uint8_t * | p_dev_name, |
uint16_t * | p_len | ||
) |
Get GAP device name.
[out] | p_dev_name | Pointer to an empty buffer where the UTF-8 non NULL-terminated string will be placed. Set to NULL to obtain the complete device name length. |
[in,out] | p_len | Length of the buffer pointed by p_dev_name, complete device name length on output. |
NRF_SUCCESS | GAP device name retrieved successfully. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_DATA_SIZE | Invalid data size(s) supplied. |
uint32_t sd_ble_gap_device_name_set | ( | ble_gap_conn_sec_mode_t const * | p_write_perm, |
uint8_t const * | p_dev_name, | ||
uint16_t | len | ||
) |
Set GAP device name.
[in] | p_write_perm | Write permissions for the Device Name characteristic, see ble_gap_conn_sec_mode_t. |
[in] | p_dev_name | Pointer to a UTF-8 encoded, non NULL-terminated string. |
[in] | len | Length of the UTF-8, non NULL-terminated string pointed to by p_dev_name in octets (must be smaller or equal than BLE_GAP_DEVNAME_MAX_LEN). |
NRF_SUCCESS | GAP device name and permissions set successfully. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_DATA_SIZE | Invalid data size(s) supplied. |
NRF_ERROR_FORBIDDEN | Device name is not writable. |
uint32_t sd_ble_gap_disconnect | ( | uint16_t | conn_handle, |
uint8_t | hci_status_code | ||
) |
Disconnect (GAP Link Termination).
This call initiates the disconnection procedure, and its completion will be communicated to the application with a BLE_GAP_EVT_DISCONNECTED event.
BLE_GAP_EVT_DISCONNECTED | Generated when disconnection procedure is complete. |
Peripheral Connection Establishment and Termination |
[in] | conn_handle | Connection handle. |
[in] | hci_status_code | HCI status code, see Bluetooth status codes (accepted values are BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION and BLE_HCI_CONN_INTERVAL_UNACCEPTABLE). |
NRF_SUCCESS | The disconnection procedure has been started successfully. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
NRF_ERROR_INVALID_STATE | Disconnection in progress or link has not been established. |
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 | ||
) |
Initiate GAP Encryption procedure.
In the central role, this function will initiate the encryption procedure using the encryption information provided.
BLE_GAP_EVT_CONN_SEC_UPDATE | The connection security has been updated. |
Central Encryption and Authentication mutual exclusion |
Encryption Establishment using stored keys |
Central Control Procedure Serialization on multiple links |
Security Request Reception |
[in] | conn_handle | Connection handle. |
[in] | p_master_id | Pointer to a ble_gap_master_id_t master identification structure. |
[in] | p_enc_info | Pointer to a ble_gap_enc_info_t encryption information structure. |
NRF_SUCCESS | Successfully initiated authentication procedure. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_STATE | No link has been established. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
BLE_ERROR_INVALID_ROLE | Operation is not supported in the Peripheral role. |
NRF_ERROR_BUSY | Procedure already in progress or not allowed at this time, wait for pending procedures to complete and retry. |
uint32_t sd_ble_gap_keypress_notify | ( | uint16_t | conn_handle, |
uint8_t | kp_not | ||
) |
Notify the peer of a local keypress.
Bonding: Passkey Entry, User Inputs on Peripheral |
Bonding: Passkey Entry: User Inputs on Central |
[in] | conn_handle | Connection handle. |
[in] | kp_not | See GAP Keypress Notification Types. |
NRF_SUCCESS | Keypress notification successfully queued for transmission. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. Either:
|
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
NRF_ERROR_BUSY | The BLE stack is busy. Retry at later time. |
uint32_t sd_ble_gap_lesc_dhkey_reply | ( | uint16_t | conn_handle, |
ble_gap_lesc_dhkey_t const * | p_dhkey | ||
) |
Reply with an LE Secure connections DHKey.
This function is only used to reply to a BLE_GAP_EVT_LESC_DHKEY_REQUEST, calling it at other times will result in an NRF_ERROR_INVALID_STATE.
This function is used during authentication procedures, see the list of events in the documentation of sd_ble_gap_authenticate. |
[in] | conn_handle | Connection handle. |
[in] | p_dhkey | LE Secure Connections DHKey. |
NRF_SUCCESS | DHKey successfully set. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. Either:
|
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
uint32_t sd_ble_gap_lesc_oob_data_get | ( | uint16_t | conn_handle, |
ble_gap_lesc_p256_pk_t const * | p_pk_own, | ||
ble_gap_lesc_oob_data_t * | p_oobd_own | ||
) |
Generate a set of OOB data to send to a peer out of band.
Bonding: Out of Band |
Bonding: Out of Band |
[in] | conn_handle | Connection handle. Can be BLE_CONN_HANDLE_INVALID if a BLE connection has not been established yet. |
[in] | p_pk_own | LE Secure Connections local P-256 Public Key. |
[out] | p_oobd_own | The OOB data to be sent out of band to a peer. |
NRF_SUCCESS | OOB data successfully generated. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
uint32_t sd_ble_gap_lesc_oob_data_set | ( | uint16_t | conn_handle, |
ble_gap_lesc_oob_data_t const * | p_oobd_own, | ||
ble_gap_lesc_oob_data_t const * | p_oobd_peer | ||
) |
Provide the OOB data sent/received out of band.
This function is used during authentication procedures, see the list of events in the documentation of sd_ble_gap_authenticate. |
Bonding: Out of Band |
Bonding: Out of Band |
[in] | conn_handle | Connection handle. |
[in] | p_oobd_own | The OOB data sent out of band to a peer or NULL if the peer has not received OOB data. Must correspond to ble_gap_sec_params_t::oob flag in BLE_GAP_EVT_SEC_PARAMS_REQUEST. |
[in] | p_oobd_peer | The OOB data received out of band from a peer or NULL if none received. Must correspond to ble_gap_sec_params_t::oob flag in sd_ble_gap_authenticate in the central role or in sd_ble_gap_sec_params_reply in the peripheral role. |
NRF_SUCCESS | OOB data accepted. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. Either:
|
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
uint32_t sd_ble_gap_next_conn_evt_counter_get | ( | uint16_t | conn_handle, |
uint16_t * | p_counter | ||
) |
Obtain the next connection event counter value.
The connection event counter is initialized to zero on the first connection event. The value is incremented by one for each connection event. For more information see Bluetooth Core Specification v5.0, Vol 6, Part B, Section 4.5.1.
[in] | conn_handle | Connection handle. |
[out] | p_counter | Pointer to the variable where the next connection event counter will be written. |
NRF_SUCCESS | The connection event counter was successfully retrieved. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle parameter supplied. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
uint32_t sd_ble_gap_phy_update | ( | uint16_t | conn_handle, |
ble_gap_phys_t const * | p_gap_phys | ||
) |
Initiate or respond to a PHY Update Procedure.
This function is used to initiate or respond to a PHY Update Procedure. It will always generate a BLE_GAP_EVT_PHY_UPDATE event if successfully executed. If this function is used to initiate a PHY Update procedure and the only option provided in ble_gap_phys_t::tx_phys and ble_gap_phys_t::rx_phys is the currently active PHYs in the respective directions, the SoftDevice will generate a BLE_GAP_EVT_PHY_UPDATE with the current PHYs set and will not initiate the procedure in the Link Layer.
If ble_gap_phys_t::tx_phys or ble_gap_phys_t::rx_phys is BLE_GAP_PHY_AUTO, then the stack will select PHYs based on the peer's PHY preferences and the local link configuration. The PHY Update procedure will for this case result in a PHY combination that respects the time constraints configured with sd_ble_cfg_set and the current link layer data length.
When acting as a central, the SoftDevice will select the fastest common PHY in each direction.
If the peer does not support the PHY Update Procedure, then the resulting BLE_GAP_EVT_PHY_UPDATE event will have a status set to BLE_HCI_UNSUPPORTED_REMOTE_FEATURE.
If the PHY Update procedure was rejected by the peer due to a procedure collision, the status will be BLE_HCI_STATUS_CODE_LMP_ERROR_TRANSACTION_COLLISION or BLE_HCI_DIFFERENT_TRANSACTION_COLLISION. If the peer responds to the PHY Update procedure with invalid parameters, the status will be BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS. If the PHY Update procedure was rejected by the peer for a different reason, the status will contain the reason as specified by the peer.
BLE_GAP_EVT_PHY_UPDATE | Result of the PHY Update Procedure. |
Central PHY Update |
Peripheral PHY Update |
[in] | conn_handle | Connection handle to indicate the connection for which the PHY Update is requested. |
[in] | p_gap_phys | Pointer to PHY structure. |
NRF_SUCCESS | Successfully requested a PHY Update. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_NOT_SUPPORTED | Unsupported PHYs supplied to the call. |
NRF_ERROR_INVALID_STATE | No link has been established. |
NRF_ERROR_BUSY | Procedure is already in progress or not allowed at this time. Process pending events and wait for the pending procedure to complete and retry. |
uint32_t sd_ble_gap_ppcp_get | ( | ble_gap_conn_params_t * | p_conn_params | ) |
Get GAP Peripheral Preferred Connection Parameters.
[out] | p_conn_params | Pointer to a ble_gap_conn_params_t structure where the parameters will be stored. |
NRF_SUCCESS | Peripheral Preferred Connection Parameters retrieved successfully. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_NOT_SUPPORTED | The characteristic is not included in the Attribute Table, see ble_gap_cfg_ppcp_incl_cfg_t. |
uint32_t sd_ble_gap_ppcp_set | ( | ble_gap_conn_params_t const * | p_conn_params | ) |
Set GAP Peripheral Preferred Connection Parameters.
[in] | p_conn_params | Pointer to a ble_gap_conn_params_t structure with the desired parameters. |
NRF_SUCCESS | Peripheral Preferred Connection Parameters set successfully. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_NOT_SUPPORTED | The characteristic is not included in the Attribute Table, see ble_gap_cfg_ppcp_incl_cfg_t. |
uint32_t sd_ble_gap_privacy_get | ( | ble_gap_privacy_params_t * | p_privacy_params | ) |
Get privacy settings.
[in,out] | p_privacy_params | Privacy settings. |
NRF_SUCCESS | Privacy settings read. |
NRF_ERROR_INVALID_ADDR | The pointer given for returning the privacy settings may be NULL or invalid. Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer. |
uint32_t sd_ble_gap_privacy_set | ( | ble_gap_privacy_params_t const * | p_privacy_params | ) |
Set privacy settings.
[in] | p_privacy_params | Privacy settings. |
Private Advertising |
Private Scanning |
Directed Advertising |
NRF_SUCCESS | Set successfully. |
NRF_ERROR_BUSY | The stack is busy, process pending events and retry. |
BLE_ERROR_GAP_INVALID_BLE_ADDR | Invalid address type is supplied. |
NRF_ERROR_INVALID_ADDR | The pointer to privacy settings is NULL or invalid. Otherwise, the p_device_irk pointer in privacy parameter is an invalid pointer. |
NRF_ERROR_INVALID_PARAM | Out of range parameters are provided. |
NRF_ERROR_NOT_SUPPORTED | The SoftDevice does not support privacy if the Central Address Resolution characteristic is not configured to be included and the SoftDevice is configured to support central roles. See ble_gap_cfg_car_incl_cfg_t and ble_gap_cfg_role_count_t. |
NRF_ERROR_INVALID_STATE | Privacy settings cannot be changed while advertising, scanning or creating a connection. |
uint32_t sd_ble_gap_qos_channel_survey_start | ( | uint32_t | interval_us | ) |
Start the Quality of Service (QoS) channel survey module.
The channel survey module provides measurements of the energy levels on the Bluetooth Low Energy channels. When the module is enabled, BLE_GAP_EVT_QOS_CHANNEL_SURVEY_REPORT events will periodically report the measured energy levels for each channel.
[in] | interval_us | Requested average interval for the measurements and reports. See Quality of Service (QoS) Channel survey interval defines for valid ranges. If set to BLE_GAP_QOS_CHANNEL_SURVEY_INTERVAL_CONTINUOUS, the channel survey role will be scheduled at every available opportunity. |
NRF_SUCCESS | The module is successfully started. |
NRF_ERROR_INVALID_PARAM | Invalid parameter supplied. interval_us is out of the allowed range. |
NRF_ERROR_INVALID_STATE | Trying to start the module when already running. |
NRF_ERROR_RESOURCES | The channel survey module is not available to the application. Set ble_gap_cfg_role_count_t::qos_channel_survey_role_available using sd_ble_cfg_set. |
uint32_t sd_ble_gap_qos_channel_survey_stop | ( | void | ) |
Stop the Quality of Service (QoS) channel survey module.
NRF_SUCCESS | The module is successfully stopped. |
NRF_ERROR_INVALID_STATE | Trying to stop the module when it is not running. |
uint32_t sd_ble_gap_rssi_get | ( | uint16_t | conn_handle, |
int8_t * | p_rssi, | ||
uint8_t * | p_ch_index | ||
) |
Get the received signal strength for the last connection event.
@ref sd_ble_gap_rssi_start must be called to start reporting RSSI before using this function. @ref NRF_ERROR_NOT_FOUND will be returned until RSSI was sampled for the first time after calling @ref sd_ble_gap_rssi_start.
RSSI get sample |
[in] | conn_handle | Connection handle. |
[out] | p_rssi | Pointer to the location where the RSSI measurement shall be stored. |
[out] | p_ch_index | Pointer to the location where Channel Index for the RSSI measurement shall be stored. |
NRF_SUCCESS | Successfully read the RSSI. |
NRF_ERROR_NOT_FOUND | No sample is available. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
NRF_ERROR_INVALID_STATE | RSSI reporting is not ongoing. |
uint32_t sd_ble_gap_rssi_start | ( | uint16_t | conn_handle, |
uint8_t | threshold_dbm, | ||
uint8_t | skip_count | ||
) |
Start reporting the received signal strength to the application.
A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called.
BLE_GAP_EVT_RSSI_CHANGED | New RSSI data available. How often the event is generated is dependent on the settings of the threshold_dbm and skip_count input parameters. |
RSSI get sample |
RSSI for connections with event filter |
[in] | conn_handle | Connection handle. |
[in] | threshold_dbm | Minimum change in dBm before triggering the BLE_GAP_EVT_RSSI_CHANGED event. Events are disabled if threshold_dbm equals BLE_GAP_RSSI_THRESHOLD_INVALID. |
[in] | skip_count | Number of RSSI samples with a change of threshold_dbm or more before sending a new BLE_GAP_EVT_RSSI_CHANGED event. |
NRF_SUCCESS | Successfully activated RSSI reporting. |
NRF_ERROR_INVALID_STATE | RSSI reporting is already ongoing. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
uint32_t sd_ble_gap_rssi_stop | ( | uint16_t | conn_handle | ) |
Stop reporting the received signal strength.
RSSI get sample |
RSSI for connections with event filter |
[in] | conn_handle | Connection handle. |
NRF_SUCCESS | Successfully deactivated RSSI reporting. |
NRF_ERROR_INVALID_STATE | RSSI reporting is not ongoing. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
uint32_t sd_ble_gap_scan_start | ( | ble_gap_scan_params_t const * | p_scan_params, |
ble_data_t const * | p_adv_report_buffer | ||
) |
Start or continue scanning (GAP Discovery procedure, Observer Procedure).
BLE_GAP_EVT_ADV_REPORT | An advertising or scan response packet has been received. |
BLE_GAP_EVT_TIMEOUT | Scanner has timed out. |
Scanning |
Whitelist Sharing |
[in] | p_scan_params | Pointer to scan parameters structure. When this function is used to continue scanning, this parameter must be NULL. |
[in] | p_adv_report_buffer | Pointer to buffer used to store incoming advertising data. The memory pointed to should be kept alive until the scanning is stopped. See GAP Minimum scanner buffer size for minimum and maximum buffer size. If the scanner receives advertising data larger than can be stored in the buffer, a BLE_GAP_EVT_ADV_REPORT will be raised with ble_gap_adv_report_type_t::status set to BLE_GAP_ADV_DATA_STATUS_INCOMPLETE_TRUNCATED. |
NRF_SUCCESS | Successfully initiated scanning procedure. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. Either:
|
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. See ble_gap_scan_params_t. |
NRF_ERROR_NOT_SUPPORTED | Unsupported parameters supplied. See ble_gap_scan_params_t. |
NRF_ERROR_INVALID_LENGTH | The provided buffer length is invalid. See BLE_GAP_SCAN_BUFFER_MIN. |
NRF_ERROR_RESOURCES | Not enough BLE role slots available. Stop one or more currently active roles (Central, Peripheral or Broadcaster) and try again |
NRF_ERROR_NOT_SUPPORTED | Unsupported PHYs supplied to the call. |
uint32_t sd_ble_gap_scan_stop | ( | void | ) |
Stop scanning (GAP Discovery procedure, Observer Procedure).
Scanning |
Whitelist Sharing |
NRF_SUCCESS | Successfully stopped scanning procedure. |
NRF_ERROR_INVALID_STATE | Not in the scanning state. |
uint32_t sd_ble_gap_sec_info_reply | ( | uint16_t | conn_handle, |
ble_gap_enc_info_t const * | p_enc_info, | ||
ble_gap_irk_t const * | p_id_info, | ||
ble_gap_sign_info_t const * | p_sign_info | ||
) |
Reply with GAP security information.
This function is only used to reply to a BLE_GAP_EVT_SEC_INFO_REQUEST, calling it at other times will result in NRF_ERROR_INVALID_STATE.
Peripheral Encryption Establishment using stored keys |
[in] | conn_handle | Connection handle. |
[in] | p_enc_info | Pointer to a ble_gap_enc_info_t encryption information structure. May be NULL to signal none is available. |
[in] | p_id_info | Pointer to a ble_gap_irk_t identity information structure. May be NULL to signal none is available. |
[in] | p_sign_info | Pointer to a ble_gap_sign_info_t signing information structure. May be NULL to signal none is available. |
NRF_SUCCESS | Successfully accepted security information. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_STATE | Invalid state to perform operation. Either:
|
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
uint32_t sd_ble_gap_sec_params_reply | ( | uint16_t | conn_handle, |
uint8_t | sec_status, | ||
ble_gap_sec_params_t const * | p_sec_params, | ||
ble_gap_sec_keyset_t const * | p_sec_keyset | ||
) |
Reply with GAP security parameters.
This function is only used to reply to a BLE_GAP_EVT_SEC_PARAMS_REQUEST, calling it at other times will result in an NRF_ERROR_INVALID_STATE.
This function is used during authentication procedures | see the list of events in the documentation of sd_ble_gap_authenticate. |
[in] | conn_handle | Connection handle. |
[in] | sec_status | Security status, see GAP Security status. |
[in] | p_sec_params | Pointer to a 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 sd_ble_gap_authenticate. |
[in,out] | p_sec_keyset | Pointer to a 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 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 BLE_GAP_EVT_AUTH_STATUS event. |
NRF_SUCCESS | Successfully accepted security parameter from the application. |
NRF_ERROR_INVALID_ADDR | Invalid pointer supplied. |
NRF_ERROR_BUSY | The stack is busy, process pending events and retry. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
NRF_ERROR_INVALID_STATE | Security parameters has not been requested. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
NRF_ERROR_NOT_SUPPORTED | Setting of sign or link fields in 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 ble_gap_cfg_car_incl_cfg_t and ble_gap_cfg_role_count_t. |
uint32_t sd_ble_gap_tx_power_set | ( | uint8_t | role, |
uint16_t | handle, | ||
int8_t | tx_power | ||
) |
Set the radio's transmit power.
[in] | role | The role to set the transmit power for, see BLE_GAP_TX_POWER_ROLES for possible roles. |
[in] | handle | The handle parameter is interpreted depending on role:
|
[in] | tx_power | Radio transmit power in dBm (see note for accepted values). |
NRF_SUCCESS | Successfully changed the transmit power. |
NRF_ERROR_INVALID_PARAM | Invalid parameter(s) supplied. |
BLE_ERROR_INVALID_ADV_HANDLE | Advertising handle not found. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle supplied. |
uint32_t sd_ble_gap_whitelist_set | ( | ble_gap_addr_t const *const * | pp_wl_addrs, |
uint8_t | len | ||
) |
Set the active whitelist in the SoftDevice.
Whitelist Sharing |
Scan Private Devices |
[in] | pp_wl_addrs | Pointer to a whitelist of peer addresses, if NULL the whitelist will be cleared. |
[in] | len | Length of the whitelist, maximum BLE_GAP_WHITELIST_ADDR_MAX_COUNT. |
NRF_SUCCESS | The whitelist is successfully set/cleared. |
NRF_ERROR_INVALID_ADDR | The whitelist (or one of its entries) provided is invalid. |
BLE_ERROR_GAP_WHITELIST_IN_USE | The whitelist is in use by a BLE role and cannot be set or cleared. |
BLE_ERROR_GAP_INVALID_BLE_ADDR | Invalid address type is supplied. |
NRF_ERROR_DATA_SIZE | The given whitelist size is invalid (zero or too large); this can only return when pp_wl_addrs is not NULL. |