• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2023 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_THERMAL_CONSTANTS_H
17 #define OHOS_THERMAL_CONSTANTS_H
18 
19 #include <string>
20 
21 namespace OHOS {
22 namespace PowerMgr {
23     // action name
24     const std::string AIRPLANE_ACTION_NAME = "airplane";
25     const std::string CPU_BIG_ACTION_NAME = "cpu_big";
26     const std::string CPU_MED_ACTION_NAME = "cpu_med";
27     const std::string CPU_LIT_ACTION_NAME = "cpu_lit";
28     const std::string CPU_BOOST_ACTION_NAME = "boost";
29     const std::string CPU_ISOLATE_ACTION_NAME = "isolate";
30     const std::string CPU_NONVIP_ACTION_NAME = "nonvip";
31     const std::string GPU_ACTION_NAME = "gpu";
32     const std::string LCD_ACTION_NAME = "lcd";
33     const std::string VOLUME_ACTION_NAME = "volume";
34     const std::string SHUTDOWN_ACTION_NAME = "shut_down";
35     const std::string PROCESS_ACTION_NAME = "process_ctrl";
36     const std::string THERMAL_LEVEL_NAME = "thermallevel";
37     const std::string POPUP_ACTION_NAME = "popup";
38     const std::string CURRENT_ACTION_NAME = "current";
39     const std::string VOLATAGE_ACTION_NAME = "voltage";
40     const std::string CURRENT_SC_ACTION_NAME = "current_sc";
41     const std::string CURRENT_BUCK_ACTION_NAME = "current_buck";
42     const std::string VOLATAGE_SC_ACTION_NAME = "voltage_sc";
43     const std::string VOLATAGE_BUCK_ACTION_NAME = "voltage_buck";
44     const std::string NODE_ACTION_NAME = "node";
45     // state name
46     const std::string STATE_CHARGER = "charge";
47     const std::string STATE_SCREEN = "screen";
48     const std::string STATE_SCENE = "scene";
49     const std::string STATE_CHARGE_DELAY = "charge_delay";
50     const std::string STATE_STARTUP_DELAY = "startup_delay";
51     const std::string STATE_CUST = "cust";
52 
53     // scene sensor name
54     const std::string BATTERY = "battery";
55     const std::string BUCK_PROTOCOL = "buck";
56     const std::string SC_PROTOCOL = "sc";
57     const std::string SOC = "soc";
58     constexpr int32_t INVAILD_TEMP = -1000;
59     constexpr int32_t MIN = 0;
60     constexpr int32_t MAX = 3;
61     constexpr int32_t INTERVAL = 5000;
62 
63     constexpr int APP_FIRST_UID = 15000;
64 
65     // observer
66     const int32_t INVALID_TEMP = -1000000;
67     const int32_t TYPE_MAX_SIZE = 10;
68 
69     // fallback value
70     const std::string FALLBACK_ACTION_VALUE = "0";
71     const uint32_t ARG_0 = 0;
72     const uint32_t ARG_1 = 1;
73     const uint32_t ARG_2 = 2;
74     const uint32_t ARG_3 = 3;
75     const uint32_t ARG_4 = 4;
76     const uint32_t ARG_5 = 5;
77     const uint32_t ARG_6 = 6;
78     const uint32_t ARG_7 = 7;
79     const uint32_t ARG_8 = 8;
80     const uint32_t ARG_9 = 9;
81 
82     //fallback value
83     constexpr float FALLBACK_VALUE_FLOAT = 1.0f;
84     constexpr uint32_t FALLBACK_VALUE_UINT_ZERO = 0;
85     constexpr uint32_t FALLBACK_VALUE_UINT_SOC = static_cast<uint32_t>(INT_MAX);
86 
87     // floating-point precision
88     constexpr float FLOAT_ACCURACY = 0.001f;
89 
90     // strtol function base parameter format
91     constexpr uint32_t STRTOL_FORMART_DEC = 10;
92 
93     //socperf resource id
94     constexpr int32_t LIM_CPU_BIG_ID = 1005;
95     constexpr int32_t LIM_CPU_BIG2_ID = 1102;
96     constexpr int32_t LIM_CPU_BIG3_ID = 1104;
97     constexpr int32_t LIM_CPU_BIG4_ID = 1106;
98     constexpr int32_t LIM_CPU_MED_ID = 1003;
99     constexpr int32_t LIM_CPU_LIT_ID = 1001;
100     constexpr int32_t LIM_GPU_ID = 1021;
101 } // namespace PowerMgr
102 } // namespace OHOS
103 #endif // OHOS_THERMAL_CONSTANTS_H
104