nRF Connect SDK API 3.4.99
Loading...
Searching...
No Matches

◆ dult_bt_adv_data_fill()

int dult_bt_adv_data_fill ( const struct dult_user * user,
struct bt_data * bt_adv_data,
uint8_t * buf,
size_t buf_size,
const struct dult_bt_adv_data * adv_data )

#include <include/dult/bt.h>

Encode the DULT location-enabled Bluetooth advertising payload.

This function can only be called if the DULT user was previously registered with the dult_user_register API.

Serializes the DULT data (UUID, network ID, near-owner byte, and optional proprietary data from adv_data) into buf and populates bt_adv_data to reference it. The caller must ensure that buf remains valid for as long as bt_adv_data is in use.

Parameters
[in]userPointer to the DULT user structure.
[out]bt_adv_dataPointer to the Bluetooth advertising data structure to populate.
[out]bufBacking buffer for the serialized payload. It must be large enough to hold the fixed DULT header followed by adv_data->proprietary.len bytes; otherwise the function returns -EINVAL.
[in]buf_sizeSize of buf in bytes.
[in]adv_dataAdvertising data to encode.
Returns
0 if the operation was successful. Otherwise, a (negative) error code is returned.