1/* 2 * Copyright (c) 2022 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.0 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.0 38 */ 39 40package ohos.hdi.thermal.v1_0; 41 42import ohos.hdi.thermal.v1_0.ThermalTypes; 43import ohos.hdi.thermal.v1_0.IThermalCallback; 44 45/** 46 * @brief Represents APIs for managing, controlling, and subscribing to the device temperature. 47 * 48 * 49 * 50 * @since 3.1 51 */ 52interface IThermalInterface { 53 /** 54 * @brief Sets the CPU frequency. 55 * 56 * @param freq CPU frequency to set. 57 * 58 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 59 * 60 * @since 3.1 61 */ 62 SetCpuFreq([in] int freq); 63 64 /** 65 * @brief Sets the GPU frequency. 66 * 67 * @param freq GPU frequency to set. 68 * 69 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 70 * 71 * @since 3.1 72 */ 73 SetGpuFreq([in] int freq); 74 75 /** 76 * @brief Sets the charging current. 77 * 78 * @param current Charging current, in mA. 79 * 80 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 81 * 82 * @since 3.1 83 */ 84 SetBatteryCurrent([in] int current); 85 86 /** 87 * @brief Obtains the thermal information of the device. 88 * 89 * @param event Thermal information of the device, including the device type and temperature. 90 * 91 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 92 * @see HdfThermalCallbackInfo 93 * 94 * @since 3.1 95 */ 96 GetThermalZoneInfo([out] struct HdfThermalCallbackInfo event); 97 98 /** 99 * @brief Registers the callback of the device thermal status. 100 * 101 * @param callbackObj Callback to register. 102 * 103 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 104 * @see IThermalCallback 105 * 106 * @since 3.1 107 */ 108 Register([in] IThermalCallback callbackObj); 109 110 /** 111 * @brief Registers the callback of the device thermal status. 112 * 113 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful. 114 * 115 * @since 3.1 116 */ 117 Unregister(); 118} 119/** @} */ 120