bf36baa0e3 | ||
---|---|---|
.. | ||
figures | ||
frameworks | ||
interfaces/kits | ||
services | ||
BUILD.gn | ||
LICENSE | ||
OAT.xml | ||
README.md | ||
README_zh.md | ||
batterymgr.gni | ||
config.gni |
README.md
Lite Battery Manager
Introduction
The lite battery manager provides the following functionalities:
- Obtaining battery information
- Obtaining the battery charging status and the battery state of charge
SoC
- Monitoring the battery state of health
SoH
- Controlling the battery charging indicator
Figure 1 Lite battery manager architecture
Directory Structure
base/powermgr/battery_lite
├── frameworks # Frameworks
│ ├── include # Header files
│ └── src # Source files
├── interfaces # APIs
│ ├── innerkits # Internal APIs
│ └── kits # External APIs
├── services # Services
│ ├── include # Header files
│ └── src # Source files
Usage
Available APIs
The following table lists the JavaScript APIs provided by the lite battery manager.
Usage Guidelines
The lite battery manager provides APIs for obtaining the battery SoC, battery charging status, and battery SoH.
The sample code is as follows:
int32_t capacity = GetBatSoc();
BatteryChargeState chargState = GetChargingStatus();
Repositories Involved
powermgr_powermgr_lite