Flipper Zero Firmware
Loading...
Searching...
No Matches
battery_service.h
1#pragma once
2
3#include <stdint.h>
4#include <stdbool.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10/*
11 * Battery service. Can be used in most profiles.
12 * If auto_update is true, the service will automatically update the battery
13 * level and charging state from power state updates.
14 */
15
17
18BleServiceBattery* ble_svc_battery_start(bool auto_update);
19
20void ble_svc_battery_stop(BleServiceBattery* service);
21
22bool ble_svc_battery_update_level(BleServiceBattery* service, uint8_t battery_level);
23
24bool ble_svc_battery_update_power_state(BleServiceBattery* service, bool charging);
25
26/* Global function, callable without a service instance
27 * Will update all service instances created with auto_update==true
28 * Both parameters are optional, pass NULL if no value is available
29 */
30void ble_svc_battery_state_update(uint8_t* battery_level, bool* charging);
31
32#ifdef __cplusplus
33}
34#endif
Definition battery_service.c:73