1f16e0440Sopenharmony_ci/*
2f16e0440Sopenharmony_ci * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3f16e0440Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4f16e0440Sopenharmony_ci * you may not use this file except in compliance with the License.
5f16e0440Sopenharmony_ci * You may obtain a copy of the License at
6f16e0440Sopenharmony_ci *
7f16e0440Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8f16e0440Sopenharmony_ci *
9f16e0440Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10f16e0440Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11f16e0440Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12f16e0440Sopenharmony_ci * See the License for the specific language governing permissions and
13f16e0440Sopenharmony_ci * limitations under the License.
14f16e0440Sopenharmony_ci */
15f16e0440Sopenharmony_ci
16f16e0440Sopenharmony_ci#ifndef BATTERY_LED_H
17f16e0440Sopenharmony_ci#define BATTERY_LED_H
18f16e0440Sopenharmony_ci
19f16e0440Sopenharmony_ci#include "battery_config.h"
20f16e0440Sopenharmony_ci#include "power_supply_provider.h"
21f16e0440Sopenharmony_ci#include "v1_0/ilight_interface.h"
22f16e0440Sopenharmony_ci#include "v1_0/light_types.h"
23f16e0440Sopenharmony_ci
24f16e0440Sopenharmony_cinamespace OHOS {
25f16e0440Sopenharmony_cinamespace PowerMgr {
26f16e0440Sopenharmony_ciclass BatteryLed {
27f16e0440Sopenharmony_cipublic:
28f16e0440Sopenharmony_ci    BatteryLed() = default;
29f16e0440Sopenharmony_ci    ~BatteryLed() = default;
30f16e0440Sopenharmony_ci
31f16e0440Sopenharmony_ci    void InitLight();
32f16e0440Sopenharmony_ci    void TurnOff();
33f16e0440Sopenharmony_ci    void TurnOn(uint32_t color = 0);
34f16e0440Sopenharmony_ci    bool UpdateColor(int32_t chargeState, int32_t capacity);
35f16e0440Sopenharmony_ci    bool IsAvailable() const;
36f16e0440Sopenharmony_ci    uint32_t GetLightColor() const;
37f16e0440Sopenharmony_ci
38f16e0440Sopenharmony_ciprivate:
39f16e0440Sopenharmony_ci    sptr<OHOS::HDI::Light::V1_0::ILightInterface> batteryLight_ {nullptr};
40f16e0440Sopenharmony_ci    bool available_ {false};
41f16e0440Sopenharmony_ci    uint32_t lightColor_ {0};
42f16e0440Sopenharmony_ci};
43f16e0440Sopenharmony_ci} // namespace PowerMgr
44f16e0440Sopenharmony_ci} // namespace OHOS
45f16e0440Sopenharmony_ci#endif
46