nrf-softdevice-s132

Crates

git

Versions

default

Flavors

pub unsafe fn sd_ble_gap_adv_set_configure(
p_adv_handle: *mut u8,
p_adv_data: *const ble_gap_adv_data_t,
p_adv_params: *const ble_gap_adv_params_t
) -> u32
Expand description

@brief Configure an advertising set. Set, clear or update advertising and scan response data.

@note The format of the advertising data will be checked by this call to ensure interoperability. Limitations imposed by this API call to the data provided include having a flags data type in the scan response data and duplicating the local name in the advertising data and scan response data.

@note In order to update advertising data while advertising, new advertising buffers must be provided.

@mscs @mmsc{@ref BLE_GAP_ADV_MSC} @mmsc{@ref BLE_GAP_WL_SHARE_MSC} @endmscs

@param[in,out] p_adv_handle Provide a pointer to a handle containing @ref 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. @param[in] p_adv_data Advertising data. If set to NULL, no advertising data will be used. See @ref ble_gap_adv_data_t. @param[in] p_adv_params Advertising parameters. When this function is used to update advertising data while advertising, this parameter must be NULL. See @ref ble_gap_adv_params_t.

@retval ::NRF_SUCCESS Advertising set successfully configured. @retval ::NRF_ERROR_INVALID_PARAM Invalid parameter(s) supplied: - Invalid advertising data configuration specified. See @ref ble_gap_adv_data_t. - Invalid configuration of p_adv_params. See @ref ble_gap_adv_params_t. - Use of whitelist requested but whitelist has not been set, see @ref sd_ble_gap_whitelist_set. @retval ::BLE_ERROR_GAP_INVALID_BLE_ADDR ble_gap_adv_params_t::p_peer_addr is invalid. @retval ::NRF_ERROR_INVALID_STATE Invalid state to perform operation. Either: - It is invalid to provide non-NULL advertising set parameters while advertising. - It is invalid to provide the same data buffers while advertising. To update advertising data, provide new advertising buffers. @retval ::BLE_ERROR_GAP_DISCOVERABLE_WITH_WHITELIST Discoverable mode and whitelist incompatible. @retval ::BLE_ERROR_INVALID_ADV_HANDLE The provided advertising handle was not found. Use @ref BLE_GAP_ADV_SET_HANDLE_NOT_SET to configure a new advertising handle. @retval ::NRF_ERROR_INVALID_ADDR Invalid pointer supplied. @retval ::NRF_ERROR_INVALID_FLAGS Invalid combination of advertising flags supplied. @retval ::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. @retval ::NRF_ERROR_INVALID_LENGTH Invalid data length(s) supplied. @retval ::NRF_ERROR_NOT_SUPPORTED Unsupported data length or advertising parameter configuration. @retval ::NRF_ERROR_NO_MEM Not enough memory to configure a new advertising handle. Update an existing advertising handle instead. @retval ::BLE_ERROR_GAP_UUID_LIST_MISMATCH Invalid UUID list supplied.