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