nRF Connect SDK API 0.1.0
|
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
embed:rst:inline :kconfig:option:`CONFIG_BT_FAST_PAIR_BN`
Kconfig option is enabled.
[in] | battery_comp | Battery component. |
[in] | battery | Battery value. |
0 | on success. |
-EINVAL | if battery value is invalid. |