• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 
16 #ifndef POWERMGR_INNERKITS_IBATTERY_SRV_H
17 #define POWERMGR_INNERKITS_IBATTERY_SRV_H
18 
19 #include <string>
20 #include "iremote_broker.h"
21 #include "iremote_object.h"
22 #include "battery_info.h"
23 
24 namespace OHOS {
25 namespace PowerMgr {
26 class IBatterySrv : public IRemoteBroker {
27 public:
28     enum {
29         BATT_GET_CAPACITY = 0,
30         BATT_GET_CHARGING_STATUS,
31         BATT_GET_HEALTH_STATUS,
32         BATT_GET_PLUG_TYPE,
33         BATT_GET_VOLTAGE,
34         BATT_GET_PRESENT,
35         BATT_GET_TEMPERATURE,
36         BATT_GET_TECHNOLOGY,
37         BATT_GET_BATTERY_LEVEL,
38         BATT_GET_REMAINING_CHARGE_TIME,
39         BATT_GET_BATTERY_TOTAL_ENERGY,
40         BATT_GET_BATTERY_CURRENT_AVERAGE,
41         BATT_GET_BATTERY_CURRENT_NOW,
42         BATT_GET_BATTERY_REMAIN_ENERGY
43     };
44 
45     virtual int32_t GetCapacity() = 0;
46     virtual BatteryChargeState GetChargingStatus() = 0;
47     virtual BatteryHealthState GetHealthStatus() = 0;
48     virtual BatteryPluggedType GetPluggedType() = 0;
49     virtual int32_t GetVoltage() = 0;
50     virtual bool GetPresent() = 0;
51     virtual std::string GetTechnology() = 0;
52     virtual int32_t GetTotalEnergy() = 0;
53     virtual int32_t GetCurrentAverage() = 0;
54     virtual int32_t GetNowCurrent() = 0;
55     virtual int32_t GetRemainEnergy() = 0;
56     virtual int32_t GetBatteryTemperature() = 0;
57     virtual BatteryCapacityLevel GetCapacityLevel() = 0;
58     virtual int64_t GetRemainingChargeTime() = 0;
59 public:
60     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.powermgr.IBatterySrv");
61 };
62 } // space PowerMgr
63 } // namespace OHOS
64 
65 #endif // POWERMGR_INNERKITS_IBATTERY_SRV_H
66