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