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