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 16 #ifndef OHOS_HDI_BATTERY_V1_0_BATTERYINTERFACEIMPL_H 17 #define OHOS_HDI_BATTERY_V1_0_BATTERYINTERFACEIMPL_H 18 19 #include "batteryd_api.h" 20 #include "battery_config.h" 21 #include "battery_led.h" 22 #include "battery_thread.h" 23 #include "power_supply_provider.h" 24 #include "v1_0/battery_interface_stub.h" 25 26 namespace OHOS { 27 namespace HDI { 28 namespace Battery { 29 namespace V1_0 { 30 class BatteryInterfaceImpl : public BatteryInterfaceStub { 31 public: 32 BatteryInterfaceImpl(); ~BatteryInterfaceImpl()33 virtual ~BatteryInterfaceImpl() {} 34 int32_t Init(); 35 int32_t Register(const sptr<IBatteryCallback>& event) override; 36 int32_t UnRegister() override; 37 int32_t ChangePath(const std::string& path) override; 38 int32_t GetCapacity(int32_t& capacity) override; 39 int32_t GetTotalEnergy(int32_t& totalEnergy) override; 40 int32_t GetCurrentAverage(int32_t& curAverage) override; 41 int32_t GetCurrentNow(int32_t& curNow) override; 42 int32_t GetRemainEnergy(int32_t& remainEnergy) override; 43 int32_t GetBatteryInfo(BatteryInfo& info) override; 44 int32_t GetVoltage(int32_t& voltage) override; 45 int32_t GetTemperature(int32_t& temperature) override; 46 int32_t GetHealthState(BatteryHealthState& healthState) override; 47 int32_t GetPluggedType(BatteryPluggedType& pluggedType) override; 48 int32_t GetChargeState(BatteryChargeState& chargeState) override; 49 int32_t GetPresent(bool& present) override; 50 int32_t GetTechnology(std::string& technology) override; 51 }; 52 } // V1_0 53 } // Battery 54 } // HDI 55 } // OHOS 56 57 #endif // OHOS_HDI_BATTERY_V1_0_BATTERYINTERFACEIMPL_H 58