1# ohbattery_info.h
2
3
4## Overview
5
6Declares the battery APIs that are used to obtain the current battery capacity and power supply type and define common battery events.
7
8**Library**: libohbattery_info.so
9
10**System capability**: SystemCapability.PowerManager.BatteryManager.Core
11
12**Since**: 13
13
14**Related module**: [OH_BatteryInfo](oh__batteryinfo.md)
15
16
17## Summary
18
19
20### Enums
21
22| Name| Description|
23| -------- | -------- |
24| [BatteryInfo_BatteryPluggedType](oh__batteryinfo.md#batteryinfo_batterypluggedtype) {<br>PLUGGED_TYPE_NONE , PLUGGED_TYPE_AC , PLUGGED_TYPE_USB , PLUGGED_TYPE_WIRELESS , PLUGGED_TYPE_BUTT } | Defines the plug type.|
25
26
27### Functions
28
29| Name| Description|
30| -------- | -------- |
31| int32_t [OH_BatteryInfo_GetCapacity](oh__batteryinfo.md#oh_batteryinfo_getcapacity) () | Obtains the current battery capacity.|
32| [BatteryInfo_BatteryPluggedType](oh__batteryinfo.md#batteryinfo_batterypluggedtype)[OH_BatteryInfo_GetPluggedType](oh__batteryinfo.md#oh_batteryinfo_getpluggedtype) () | Obtains the plug type.|
33
34
35### Variables
36
37| Name| Description|
38| -------- | -------- |
39| static const char\* [COMMON_EVENT_KEY_CAPACITY](oh__batteryinfo.md#common_event_key_capacity) = "soc" | Common event indicating a battery capacity change.|
40| static const char\* [COMMON_EVENT_KEY_CHARGE_STATE](oh__batteryinfo.md#common_event_key_charge_state) = "chargeState" | Common event indicating a charging status change.|
41| static const char\* [COMMON_EVENT_KEY_PLUGGED_TYPE](oh__batteryinfo.md#common_event_key_plugged_type) = "pluggedType" | Common event indicating a plug type change.|
42