pub unsafe extern "C" fn bt_le_ext_adv_set_data(
adv: *mut bt_le_ext_adv,
ad: *const bt_data,
ad_len: usize,
sd: *const bt_data,
sd_len: usize,
) -> i32
Expand description
@brief Set an advertising set’s advertising or scan response data.
Set advertisement data or scan response data. If the advertising set is currently advertising then the advertising data will be updated in subsequent advertising events.
When both @ref BT_LE_ADV_OPT_EXT_ADV and @ref BT_LE_ADV_OPT_SCANNABLE are enabled then advertising data is ignored. When @ref BT_LE_ADV_OPT_SCANNABLE is not enabled then scan response data is ignored.
If the advertising set has been configured to send advertising data on the primary advertising channels then the maximum data length is @ref BT_GAP_ADV_MAX_ADV_DATA_LEN bytes. If the advertising set has been configured for extended advertising, then the maximum data length is defined by the controller with the maximum possible of @ref BT_GAP_ADV_MAX_EXT_ADV_DATA_LEN bytes.
@note Not all scanners support extended data length advertising data.
@note When updating the advertising data while advertising the advertising data and scan response data length must be smaller or equal to what can be fit in a single advertising packet. Otherwise the advertiser must be stopped.
@param adv Advertising set object. @param ad Data to be used in advertisement packets. @param ad_len Number of elements in ad @param sd Data to be used in scan response packets. @param sd_len Number of elements in sd
@return Zero on success or (negative) error code otherwise.