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

◆ bt_fast_pair_adv_data_fill()

int bt_fast_pair_adv_data_fill ( struct bt_data *  adv_data,
uint8_t *  buf,
size_t  buf_size,
struct bt_fast_pair_adv_config  fp_adv_config 
)

#include <include/bluetooth/services/fast_pair/fast_pair.h>

Fill Bluetooth advertising packet with Fast Pair advertising data.

Provided buffer will be used in bt_data structure. The data must be valid while the structure is in use.

The buffer size must be at least bt_fast_pair_adv_data_size. Caller shall also make sure that Account Key write from a connected Fast Pair Seeker would not preempt generating Fast Pair not discoverable advertising data. To achieve this, this function and bt_fast_pair_adv_data_size must be called from context with cooperative priority.

This function can only be called if Fast Pair was previously enabled with the bt_fast_pair_enable API.

Parameters
[out]adv_dataPointer to the Bluetooth advertising data structure to be filled.
[out]bufPointer to the buffer used to store Fast Pair advertising data.
[in]buf_sizeSize of the buffer used to store Fast Pair advertising data.
[in]fp_adv_configFast Pair advertising config.
Returns
0 if the operation was successful. Otherwise, a (negative) error code is returned.