Battery Service
- group BAS
Battery service.
The Battery Service exposes the state of a battery within a device.
Battery Service generally makes up a profile with some other services, and it can provide the state of a battery within a device.
The default supported feature provided by BAS is the notify property of battery level characteristic, and the application developers can modify the feature supported by BAS according to their own requirements. The specific configuration process can be achieved by modifying file bas_config.h.
Example usage
#define BAS_BATTERY_LEVEL_NOTIFY_SUPPORT 1
Applications shall register battery service during initialization through bas_add_service function.
Applications can set the battery level of BAS through bas_set_parameter function.
Applications can send the battery level value of BAS to the client with a notification through bas_battery_level_value_notify function.