From 6ee3e7ca5307b25d233ffa82de0b84d1a1daf113 Mon Sep 17 00:00:00 2001 From: shijie Date: Mon, 30 May 2022 16:15:14 +0800 Subject: [PATCH] docs: add comment Signed-off-by: shijie --- thermal/v1_0/IThermalCallback.idl | 39 ++++++++++++- thermal/v1_0/IThermalInterface.idl | 94 +++++++++++++++++++++++++++++- thermal/v1_0/ThermalTypes.idl | 34 ++++++++++- 3 files changed, 164 insertions(+), 3 deletions(-) diff --git a/thermal/v1_0/IThermalCallback.idl b/thermal/v1_0/IThermalCallback.idl index dabc30c9..de8133a2 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 30e6942a..627da633 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 21cd989a..4a22bfc9 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 +}; -- Gitee