1 /* 2 * Copyright (c) 2022-2024 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 SOC_PERF_INTERFACES_INNER_API_SOCPERF_CLIENT_INCLUDE_I_SOCPERF_SERVICE_H 17 #define SOC_PERF_INTERFACES_INNER_API_SOCPERF_CLIENT_INCLUDE_I_SOCPERF_SERVICE_H 18 19 #include "iremote_stub.h" 20 #include "socperf_action_type.h" 21 22 namespace OHOS { 23 namespace SOCPERF { 24 class ISocPerfService : public IRemoteBroker { 25 public: 26 /** 27 * @brief Sending a performance request. 28 * 29 * @param cmdId scene id defined in config file. 30 * @param msg Additional string info, which is used for other extensions. 31 */ 32 virtual void PerfRequest(int32_t cmdId, const std::string& msg) = 0; 33 34 /** 35 * @brief Sending a performance request. 36 * 37 * @param cmdId Scene id defined in config file. 38 * @param onOffTag Indicates the start of end of a long-term frequency increase event. 39 * @param msg Additional string info, which is used for other extensions. 40 */ 41 virtual void PerfRequestEx(int32_t cmdId, bool onOffTag, const std::string& msg) = 0; 42 43 /** 44 * @brief Sending a power limit boost request. 45 * 46 * @param onOffTag Indicates the start of end of a power limit boost event. 47 * @param msg Additional string info, which is used for other extensions. 48 */ 49 virtual void PowerLimitBoost(bool onOffTag, const std::string& msg) = 0; 50 51 /** 52 * @brief Sending a thermal limit boost request. 53 * 54 * @param onOffTag Indicates the start of end of a thermal limit boost event. 55 * @param msg Additional string info, which is used for other extensions. 56 */ 57 virtual void ThermalLimitBoost(bool onOffTag, const std::string& msg) = 0; 58 59 /** 60 * @brief Sending a limit request. 61 * 62 * @param clientId Used to indentify the caller of frequency limiting, such as 63 * the thermal module or power consumption module. 64 * @param configs Indicates the specific value to be limited. 65 * @param msg Additional string info, which is used for other extensions. 66 */ 67 virtual void LimitRequest(int32_t clientId, 68 const std::vector<int32_t>& tags, const std::vector<int64_t>& configs, const std::string& msg) = 0; 69 70 /** 71 * @brief set socperf server status, enable or disable 72 * 73 * @param status true means enable socperfserver, false means disable socperfserver 74 * @param msg the reason why we need change socperfserver status 75 */ 76 virtual void SetRequestStatus(bool status, const std::string& msg) = 0; 77 78 /** 79 * @brief set thermal level intermal for perfquest 80 * 81 * @param level thermal level 82 */ 83 virtual void SetThermalLevel(int32_t level) = 0; 84 85 /** 86 * @brief send the device mode, enable or disable 87 * 88 * @param mode the mode which will to be changed 89 * @param status true means socperfserver enter the device mode, false quit the device mode 90 */ 91 virtual void RequestDeviceMode(const std::string& mode, bool status) = 0; 92 93 /** 94 * @brief get cmd Id count, cmdID is trigger, its count++ 95 * @param msg the reason 96 * @return cmdId count, as 10000:xx,10001:xx 97 */ 98 virtual std::string RequestCmdIdCount(const std::string& msg) = 0; 99 100 public: 101 DECLARE_INTERFACE_DESCRIPTOR(u"Resourceschedule.ISocPerfService"); 102 }; 103 } // namespace SOCPERF 104 } // namespace OHOS 105 106 #endif // SOC_PERF_INTERFACES_INNER_API_SOCPERF_CLIENT_INCLUDE_I_SOCPERF_SERVICE_H 107