1/* 2 * Copyright (c) 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/** 17 * @addtogroup thermal 18 * @{ 19 * 20 * @brief Provides APIs for managing, controlling, and subscribing to the device temperature. 21 * 22 * After obtaining an object or proxy of this module, the thermal service can invoke related APIs to manage, control, 23 * and subscribe to the device temperature. 24 * 25 * @since 3.1 26 * @version 1.1 27 */ 28 29/** 30 * @file IThermalInterface.idl 31 * 32 * @brief Provides APIs for managing, controlling, and subscribing to the device temperature. 33 * 34 * 35 * 36 * @since 3.1 37 * @version 1.1 38 */ 39 40package ohos.hdi.thermal.v1_1; 41 42import ohos.hdi.thermal.v1_1.ThermalTypes; 43import ohos.hdi.thermal.v1_1.IThermalCallback; 44import ohos.hdi.thermal.v1_1.IFanCallback; 45 46/** 47 * @brief Represents APIs for managing, controlling, and subscribing to the device temperature. 48 * 49 * 50 * 51 * @since 3.1 52 */ 53interface IThermalInterface { 54 /** 55 * @brief Sets the CPU frequency. 56 * 57 * @param freq CPU frequency to set. 58 * 59 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 60 * 61 * @since 3.1 62 */ 63 SetCpuFreq([in] int freq); 64 65 /** 66 * @brief Sets the GPU frequency. 67 * 68 * @param freq GPU frequency to set. 69 * 70 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 71 * 72 * @since 3.1 73 */ 74 SetGpuFreq([in] int freq); 75 76 /** 77 * @brief Sets the charging current. 78 * 79 * @param current Charging current, in mA. 80 * 81 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 82 * 83 * @since 3.1 84 */ 85 SetBatteryCurrent([in] int current); 86 87 /** 88 * @brief Obtains the thermal information of the device. 89 * 90 * @param event Thermal information of the device, including the device type and temperature. 91 * 92 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 93 * @see HdfThermalCallbackInfo 94 * 95 * @since 3.1 96 */ 97 GetThermalZoneInfo([out] struct HdfThermalCallbackInfo event); 98 99 /** 100 * @brief Isolate the CPU core. 101 * 102 * @param num CPU core number. 103 * 104 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 105 * 106 * @since 4.0 107 */ 108 IsolateCpu([in] int num); 109 110 /** 111 * @brief Registers the callback of the device thermal status. 112 * 113 * @param callbackObj Callback to register. 114 * 115 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 116 * @see IThermalCallback 117 * 118 * @since 3.1 119 */ 120 Register([in] IThermalCallback callbackObj); 121 122 /** 123 * @brief Registers the callback of the device thermal status. 124 * 125 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 126 * 127 * @since 3.1 128 */ 129 Unregister(); 130 131 /** 132 * @brief Register the callback of fan fault detect. 133 * 134 * @param callbackObj Callback to register. 135 * 136 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 137 * @see IFanCallback 138 * 139 * @since 4.0 140 */ 141 RegisterFanCallback([in] IFanCallback callbackObj); 142 143 /** 144 * @brief Unregister the callback of the fan fault detect. 145 * 146 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 147 * 148 * @since 4.0 149 */ 150 UnregisterFanCallback(); 151} 152/** @} */ 153