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

◆ bt_fast_pair_battery_set()

int bt_fast_pair_battery_set ( enum bt_fast_pair_battery_comp battery_comp,
struct bt_fast_pair_battery battery )

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

Set or update specified battery value.

Battery values are used to generate advertising packet. To include battery values in advertising packet this function must be called before bt_fast_pair_adv_data_fill. It is user responsibility to update battery value and regenerate advertising packet when battery value change.

This function can only be used only when the

CONFIG_BT_FAST_PAIR_BN 

Kconfig option is enabled.

Parameters
[in]battery_compBattery component.
[in]batteryBattery value.
Return values
0on success.
-EINVALif battery value is invalid.