1/* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16package ohos.hdi.battery.v1_0; 17 18enum BatteryHealthState 19{ 20 BATTERY_HEALTH_UNKNOWN = 0, 21 BATTERY_HEALTH_GOOD, 22 BATTERY_HEALTH_OVERHEAT, 23 BATTERY_HEALTH_OVERVOLTAGE, 24 BATTERY_HEALTH_COLD, 25 BATTERY_HEALTH_DEAD, 26 BATTERY_HEALTH_RESERVED, 27}; 28 29enum BatteryChargeState 30{ 31 CHARGE_STATE_NONE = 0, 32 CHARGE_STATE_ENABLE, 33 CHARGE_STATE_DISABLE, 34 CHARGE_STATE_FULL, 35 CHARGE_STATE_RESERVED, 36}; 37 38enum BatteryPluggedType 39{ 40 PLUGGED_TYPE_NONE = 0, 41 PLUGGED_TYPE_AC, 42 PLUGGED_TYPE_USB, 43 PLUGGED_TYPE_WIRELESS, 44 PLUGGED_TYPE_BUTT 45}; 46 47struct BatteryInfo { 48 int capacity; 49 int voltage; 50 int temperature; 51 int healthState; 52 int pluggedType; 53 int pluggedMaxCurrent; 54 int pluggedMaxVoltage; 55 int chargeState; 56 int chargeCounter; 57 int totalEnergy; 58 int curAverage; 59 int curNow; 60 int remainEnergy; 61 byte present; 62 String technology; 63}; 64