# Lite Battery Manager - [Introduction](#section11660541593) - [Directory Structure](#section19472752217) - [Usage](#section146636391856) - [Available APIs](#section481251394) - [Usage Guidelines](#section12620311012) - [Repositories Involved](#section63151229062) ## Introduction The lite battery manager provides the following functionalities: 1. Obtaining battery information 2. Obtaining the battery charging status and the battery state of charge \(SoC\) 3. Monitoring the battery state of health \(SoH\) 4. Controlling the battery charging indicator **Figure 1** Lite battery manager architecture ![](figures/en-us_image_0000001176131699.png) ## Directory Structure ``` base/powermgr/battery_lite ├── figures # Architecture figures ├── frameworks # Frameworks │ ├── js # Built_in interface │ └── native # Native code ├── interfaces # APIs │ └── kits # External APIs ├── services # Services │ ├── include # Header files │ └── src # Source files └── test # Interface test ``` ## Usage ### Available APIs The following table lists the JavaScript APIs provided by the lite battery manager.

API

Description

int32_t GetBatSoc()

Obtains the battery SoC.

BatteryChargeState GetChargingStatus()

Obtains the current battery charging status.

BatteryHealthState GetHealthStatus()

Obtains the battery SoH.

BatteryPluggedType GetPluggedType()

Obtains the charger type.

int32_t GetBatVoltage()

Obtains the battery voltage.

bool IsBatPresent()

Checks whether the battery is present.

char* GetBatTechnology()

Obtains the battery model.

int32_t GetBatTemperature()

Obtains the battery temperature.

### 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 [Power management subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/power-management.md) [powermgr_power_manager](https://gitee.com/openharmony/powermgr_power_manager) [powermgr_display_manager](https://gitee.com/openharmony/powermgr_display_manager) [powermgr_battery_manager](https://gitee.com/openharmony/powermgr_battery_manager) [powermgr_thermal_manager](https://gitee.com/openharmony/powermgr_thermal_manager) [powermgr_battery_statistics](https://gitee.com/openharmony/powermgr_battery_statistics) **powermgr_battery_lite** [powermgr_powermgr_lite](https://gitee.com/openharmony/powermgr_powermgr_lite)