• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 BATTERYD_API_H
17 #define BATTERYD_API_H
18 
19 #include <stdlib.h>
20 #include <string>
21 
22 enum BatterydCmd {
23     CMD_BIND_BATTERY_SUBSCRIBER = 0,
24     CMD_UNBIND_BATTERY_SUBSCRIBER,
25     CMD_NOTIFY_SUBSCRIBER,
26     CMD_GET_CAPACITY,
27     CMD_GET_VOLTAGE,
28     CMD_GET_TEMPERATURE,
29     CMD_GET_HEALTH_STATE,
30     CMD_GET_PLUGGED_TYPE,
31     CMD_GET_CHARGE_STATE,
32     CMD_GET_PRESENT,
33     CMD_GET_TECHNOLOGY,
34     CMD_CHANGE_PATH
35 };
36 
37 enum BatterydPluggedType {
38     PLUGGED_TYPE_NONE = 0,
39     PLUGGED_TYPE_AC,
40     PLUGGED_TYPE_USB,
41     PLUGGED_TYPE_WIRELESS,
42     PLUGGED_TYPE_BUTT
43 };
44 
45 // Keep it same as the inner kit battery_info.h
46 struct BatterydInfo {
47     int32_t capacity_;
48     int32_t voltage_;
49     int32_t temperature_;
50     int32_t healthState_;
51     int32_t pluggedType_;
52     int32_t pluggedMaxCurrent_;
53     int32_t pluggedMaxVoltage_;
54     int32_t chargeState_;
55     int32_t chargeCounter_;
56     int32_t totalEnergy_;
57     int32_t curAverage_;
58     int32_t curNow_;
59     int32_t remainEnergy_;
60     int8_t present_;
61     std::string technology_;
62 };
63 
64 #endif // BATTERYD_API_H
65