diff --git a/thermal/v1_0/IThermalCallback.idl b/thermal/v1_0/IThermalCallback.idl index dabc30c907b9fb4b858de19241d6bbfe4b0e7f7c..de8133a298b04086ec8101fdc8a688a61dd8049f 100755 --- a/thermal/v1_0/IThermalCallback.idl +++ b/thermal/v1_0/IThermalCallback.idl @@ -13,10 +13,47 @@ * limitations under the License. */ + /** + * @addtogroup thermal + * @{ + * + * @brief Thermal_Manager模块接口定义 + * + * Thermal_Manager提供设备温度管理控制能力,保障整机热安全及热体验 + * + * @since 3.1 + * @version 1.0 + */ + + /** + * @file ThermalTypes.idl + * + * @brief Thermal_Manager模块接口定义中使用的自定义数据类型 + * + * Thermal_Manager模块接口定义中使用的自定义数据类型, 包括ThermalZone的信息、ThermalZone的信息列表 + * + * @since 3.1 + * @version 1.0 + */ + package ohos.hdi.thermal.v1_0; import ohos.hdi.thermal.v1_0.ThermalTypes; +/** + * @brief Thermal_Manager回调接口定义 + * + * 温度数据变化的回调; + * + */ [callback] interface IThermalCallback { + /** + * @brief 温度数据变化的回调接口 + * + * @param event 输入参数, ThermalZone的信息列表{@link HdfThermalCallbackInfo} + * + * @return HDF_SUCCESS 表示回调成功 + * + */ OnThermalDataEvent([in] struct HdfThermalCallbackInfo event); -} \ No newline at end of file +} diff --git a/thermal/v1_0/IThermalInterface.idl b/thermal/v1_0/IThermalInterface.idl index 30e6942a6b0c362407cb8800f9f66874b5aacd8a..627da6332e78e8dfd7c9a29fd735ea40ea4cbaca 100755 --- a/thermal/v1_0/IThermalInterface.idl +++ b/thermal/v1_0/IThermalInterface.idl @@ -13,16 +13,108 @@ * limitations under the License. */ + /** + * @addtogroup thermal + * @{ + * + * @brief Thermal_Manager模块接口定义 + * + * Thermal_Manager提供设备温度管理控制能力,保障整机热安全及热体验 + * + * @since 3.1 + * @version 1.0 + */ + + /** + * @file IThermalInterface.idl + * + * @brief Thermal_Manager模块的回调接口 + * + * 主要包括Thermal_Manager模块管理类接口 + * + * @since 3.1 + * @version 1.0 + */ + package ohos.hdi.thermal.v1_0; import ohos.hdi.thermal.v1_0.ThermalTypes; import ohos.hdi.thermal.v1_0.IThermalCallback; +/** + * @brief Thermal_Manager模块管理类接口定义 + * + * 主要提供以下功能: + * 1. 设置CPU频率; + * 2. 设置GPU频率; + * 3. 设置电池电流; + * 4. 获取ThermalZone的信息; + * 5. 注册; + * 6. 去注册。 + */ + interface IThermalInterface { + /** + * @brief 设置CPU频率 + * + * 通过此接口设置CPU频率 + * + * @param freq 输入参数,设置CPU频率的值 + * + * @return HDF_SUCCESS 表示设置成功 + */ SetCpuFreq([in] int freq); + + /** + * @brief 设置GPU频率 + * + * 通过此接口设置GPU频率 + * + * @param freq 输入参数,设置GPU频率的值 + * + * @return HDF_SUCCESS 表示设置成功 + */ SetGpuFreq([in] int freq); + + /** + * @brief 设置电流值 + * + * 通过此接口设置电流值 + * + * @param current 输入参数,设置电流的值 + * + * @return HDF_SUCCESS 表示设置成功 + */ SetBatteryCurrent([in] int current); + + /** + * @brief 获取ThermalZone的信息 + * + * 通过此接口获取ThermalZone的信息 + * + * @param event 输出参数, ThermalZone的信息列表{@link HdfThermalCallbackInfo} + * + * @return HDF_SUCCESS 表示设置成功 + */ GetThermalZoneInfo([out] struct HdfThermalCallbackInfo event); + + /** + * @brief 注册接口 + * + * 通过此接口注册回调 + * + * @param callbackObj 输入参数, 注册回调类型{@link IThermalCallback} + * + * @return HDF_SUCCESS 表示注册成功 + */ Register([in] IThermalCallback callbackObj); + + /** + * @brief 去注册接口 + * + * 通过此接口取消注册 + * + * @return HDF_SUCCESS 表示设置成功 + */ Unregister(); -} \ No newline at end of file +} diff --git a/thermal/v1_0/ThermalTypes.idl b/thermal/v1_0/ThermalTypes.idl index 21cd989a768f5c4b33575fbda2dd2fef7491d271..4a22bfc92e59bd5204450152c1e5c9f45129c37e 100755 --- a/thermal/v1_0/ThermalTypes.idl +++ b/thermal/v1_0/ThermalTypes.idl @@ -13,13 +13,45 @@ * limitations under the License. */ + /** + * @addtogroup thermal + * @{ + * + * @brief Thermal_Manager模块接口定义 + * + * Thermal_Manager提供设备温度管理控制能力,保障整机热安全及热体验 + * + * @since 3.1 + * @version 1.0 + */ + + /** + * @file ThermalTypes.idl + * + * @brief Thermal_Manager模块接口定义中使用的自定义数据类型 + * + * Thermal_Manager模块接口定义中使用的自定义数据类型, 包括ThermalZone的信息、ThermalZone的信息列表 + * + * @since 3.1 + * @version 1.0 + */ + package ohos.hdi.thermal.v1_0; +/** + * @brief ThermalZone的信息 + */ struct ThermalZoneInfo { + /** ThermalZone的类型 */ String type; + /** ThermalZone中的温度值 */ int temp; }; +/** + * @brief ThermalZone的信息列表 + */ struct HdfThermalCallbackInfo { + /** ThermalZone的信息列表 */ List info; -}; \ No newline at end of file +};