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