From eeffc33adcfe1fca0e7fe219b297703e681fc825 Mon Sep 17 00:00:00 2001 From: aqxyjay Date: Thu, 30 Jun 2022 15:03:52 +0800 Subject: [PATCH] doc: update api docs to en Signed-off-by: aqxyjay --- battery/v1_0/IBatteryCallback.idl | 25 ++++- battery/v1_0/IBatteryInterface.idl | 144 +++++++++++++++++++---------- battery/v1_0/Types.idl | 89 ++++++++++-------- power/v1_0/IPowerHdiCallback.idl | 29 +++++- power/v1_0/IPowerInterface.idl | 70 +++++++++----- power/v1_0/PowerTypes.idl | 46 +++++---- thermal/v1_0/IThermalCallback.idl | 31 +++++-- thermal/v1_0/IThermalInterface.idl | 61 ++++++++---- thermal/v1_0/ThermalTypes.idl | 25 +++-- 9 files changed, 344 insertions(+), 176 deletions(-) diff --git a/battery/v1_0/IBatteryCallback.idl b/battery/v1_0/IBatteryCallback.idl index 5f1eed9c..39dfe707 100755 --- a/battery/v1_0/IBatteryCallback.idl +++ b/battery/v1_0/IBatteryCallback.idl @@ -17,7 +17,11 @@ * @addtogroup battery * @{ * - * @brief 提供获取、订阅电池信息的接口。 + * @brief Provides APIs for obtaining and subscribing to battery information. + * + * The battery module provides APIs for the battery service to obtain and subscribe to battery information. + * After obtaining an object or proxy of this module, the battery service can invoke related APIs to obtain and + * subscribe to battery information. * * @since 3.1 * @version 1.0 @@ -26,7 +30,9 @@ /** * @file IBatteryCallback.idl * - * @brief 订阅电池信息的回调接口。 + * @brief Provides the callback of battery information. + * + * The battery module provides a callback for the battery service to subscribe to battery information changes. * * @since 3.1 * @version 1.0 @@ -37,15 +43,24 @@ package ohos.hdi.battery.v1_0; import ohos.hdi.battery.v1_0.Types; /** - * @brief 订阅电池信息的回调。 + * @brief Represents the callback of battery information. + * + * After creating a callback object, the battery service can call {@link IBatteryInterface} to register a callback to + * subscribe to battery information changes. + * + * @since 3.1 */ [callback] interface IBatteryCallback { /** - * @brief 订阅电池信息回调方法。 + * @brief Callback of battery information changes. + * + * * - * @param event 电池信息,如电量,电压,健康状态等。 + * @param event Battery information, such as the battery level, voltage, and health status. * @see BatteryInfo + * + * @since 3.1 */ Update([in] struct BatteryInfo event); } diff --git a/battery/v1_0/IBatteryInterface.idl b/battery/v1_0/IBatteryInterface.idl index 356552a7..20fbb1fc 100755 --- a/battery/v1_0/IBatteryInterface.idl +++ b/battery/v1_0/IBatteryInterface.idl @@ -17,7 +17,10 @@ * @addtogroup battery * @{ * - * @brief 提供获取、订阅电池信息的接口。 + * @brief Provides APIs for obtaining and subscribing to battery information. + * + * After obtaining an object or proxy of this module, the battery service can invoke related APIs to obtain and + * subscribe to battery information. * * @since 3.1 * @version 1.0 @@ -26,7 +29,10 @@ /** * @file IBatteryInterface.idl * - * @brief 获取、订阅电池信息的接口。 + * @brief Provides APIs for obtaining and subscribing to battery information. + * + * After obtaining an object or proxy of this module, the battery service can invoke related APIs to obtain and + * subscribe to battery information. * * @since 3.1 * @version 1.0 @@ -37,151 +43,189 @@ import ohos.hdi.battery.v1_0.Types; import ohos.hdi.battery.v1_0.IBatteryCallback; /** - * @brief 获取、订阅电池信息的接口。 + * @brief Represents APIs for obtaining and subscribing to battery information. + * + * + * + * @since 3.1 */ interface IBatteryInterface { /** - * @brief 订阅电池信息变化。 + * @brief Registers the callback of battery information. + * + * @param event Callback to register. * - * @param event 输入参数, 注册回调类型{@link IBatteryCallback}。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示注册成功。 + * @since 3.1 */ Register([in] IBatteryCallback event); /** - * @brief 取消订阅电池信息变化。 + * @brief Unregisters the callback of battery information. * - * @return HDF_SUCCESS 表示取消订阅成功。 + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 3.1 */ UnRegister(); /** - * @brief 设置电池信息节点的路径。 + * @brief Sets the path of the battery information node. + * + * @param path Path of the battery information node. * - * @param path 输入参数, 电池信息节点的路径。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示路径设置成功。 + * @since 3.1 */ ChangePath([in] String path); /** - * @brief 获取电池的电量百分比。 + * @brief Obtains the battery percentage. + * + * @param capacity Battery percentage. * - * @param capacity 输出参数, 表示电量的百分比值。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示获取成功。 + * @since 3.1 */ GetCapacity([out] int capacity); /** - * @brief 获取电池的电压,单位微伏。 + * @brief Obtains the battery voltage. * - * @param voltage 输出参数, 表示电池的电压。 + * @param voltage Battery voltage, in microvolts. * - * @return HDF_SUCCESS 表示获取成功。 + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 3.1 */ GetVoltage([out] int voltage); /** - * @brief 获取电池的充电温度,单位0.1摄氏度。 + * @brief Obtains the battery temperature during charging. The unit is 0.1°C. + * + * @param temperature Battery temperature. * - * @param temperature 输出参数, 表示电池温度。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示获取成功。 + * @since 3.1 */ GetTemperature([out] int temperature); /** - * @brief 获取电池的健康状态。 + * @brief Obtains the battery health status. * - * @param healthState 输出参数, 表示电池健康状态。 + * @param healthState Battery health status. * - * @return HDF_SUCCESS 表示获取成功。 + * @return Returns HDF_SUCCESS if the operation is successful. * @see BatteryHealthState + * + * @since 3.1 */ GetHealthState([out] enum BatteryHealthState healthState); /** - * @brief 获取充电设备类型。 + * @brief Obtains the type of the charging device. * - * @param pluggedType 输出参数, 表示充电设备类型。 + * @param pluggedType Type of the charging device. * - * @return HDF_SUCCESS 表示获取成功。 + * @return Returns HDF_SUCCESS if the operation is successful. * @see BatteryPluggedType + * + * @since 3.1 */ GetPluggedType([out] enum BatteryPluggedType pluggedType); /** - * @brief 获取充电状态。 + * @brief Obtains the charging status. * - * @param chargeState 输出参数, 表示充电状态。 + * @param chargeState Battery charging status. * - * @return HDF_SUCCESS 表示获取成功。 + * @return Returns HDF_SUCCESS if the operation is successful. * @see BatteryChargeState + * + * @since 3.1 */ GetChargeState([out] enum BatteryChargeState chargeState); /** - * @brief 获取是否支持电池或者电池是否在位。 + * @brief Checks whether the battery is supported or present. * - * @param present 输出参数, 表示是否支持电池或者电池是否在位。true表示支持或在位,false表示不支持或不在位。 + * @param present Whether battery is supported or present. The value **true** indicates that the battery is + * supported or present, and the value **false** indicates the opposite. * - * @return HDF_SUCCESS 表示获取成功。 + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 3.1 */ GetPresent([out] boolean present); /** - * @brief 获取当前电池的技术型号。 + * @brief Obtains the battery technology of the current device. + * + * @param technology Battery technology of the current device. * - * @param technology 输出参数, 当前电池技术型号。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示获取成功。 + * @since 3.1 */ GetTechnology([out] String technology); /** - * @brief 获取当前电池的总容量,单位毫安时。 + * @brief Obtains the total battery capacity. * - * @param totalEnergy 输出参数,表示电池的总容量。 + * @param totalEnergy Total battery capacity, in mA. * - * @return HDF_SUCCESS 表示获取成功。 + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 3.1 */ GetTotalEnergy([out] int totalEnergy); /** - * @brief 获取当前电池的平均电流,单位毫安。 + * @brief Obtains the average battery current. + * + * @param totalEnergy Average battery current, in mA. * - * @param totalEnergy 输出参数,表示电池的平均电流。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示获取成功。 + * @since 3.1 */ GetCurrentAverage([out] int curAverage); /** - * @brief 获取当前电池的电流,单位毫安。 + * @brief Obtains the battery current. + * + * @param curNow Battery current, in mA. * - * @param curNow 输出参数,表示电池的实时电流。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示获取成功。 + * @since 3.1 */ GetCurrentNow([out] int curNow); /** - * @brief 获取当前电池的剩余容量,单位毫安时。 + * @brief Obtains the remaining battery capacity. * - * @param remainEnergy 输出参数,表示电池的剩余容量。 + * @param remainEnergy Remaining battery capacity, in mA. * - * @return HDF_SUCCESS 表示获取成功。 + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 3.1 */ GetRemainEnergy([out] int remainEnergy); /** - * @brief 获取当前电池的全部信息。 + * @brief Obtains all battery information. + * + * @param info Battery information. * - * @param info 输出参数,电池的全部信息。 + * @return Returns HDF_SUCCESS if the operation is successful. + * @see BatteryInfo * - * @return HDF_SUCCESS 表示获取成功。 + * @since 3.1 */ GetBatteryInfo([out] struct BatteryInfo info); } diff --git a/battery/v1_0/Types.idl b/battery/v1_0/Types.idl index 1ae95aab..ecd44d88 100755 --- a/battery/v1_0/Types.idl +++ b/battery/v1_0/Types.idl @@ -17,7 +17,10 @@ * @addtogroup battery * @{ * - * @brief 提供获取、订阅电池信息的接口。 + * @brief Provides APIs for obtaining and subscribing to battery information. + * + * After obtaining an object or proxy of this module, the battery service can invoke related APIs to obtain and + * subscribe to battery information. * * @since 3.1 * @version 1.0 @@ -26,9 +29,9 @@ /** * @file Types.idl * - * @brief 电池信息相关数据类型。 + * @brief Enumerates data types related to battery information. * - * 电池信息中使用的数据类型, 包括健康状态,充电状态,充电设备类型和电池信息结构。 + * Such data types include the health status, charging status, charging device type, and battery information structure. * * @since 3.1 * @version 1.0 @@ -37,93 +40,101 @@ package ohos.hdi.battery.v1_0; /** - * @brief 电池的健康状态 + * @brief Enumerates the battery health status. + * + * @since 3.1 */ enum BatteryHealthState { - /** 表示电池健康状态未知 */ + /** Unknown state */ BATTERY_HEALTH_UNKNOWN = 0, - /** 表示电池健康状态为正常 */ + /** Normal state */ BATTERY_HEALTH_GOOD, - /** 表示电池健康状态为过热 */ + /** Overheated state */ BATTERY_HEALTH_OVERHEAT, - /** 表示电池健康状态为过压 */ + /** Overvoltage state */ BATTERY_HEALTH_OVERVOLTAGE, - /** 表示电池健康状态为低温 */ + /** Cool state */ BATTERY_HEALTH_COLD, - /** 表示电池健康状态为僵死 */ + /** Exhausted state */ BATTERY_HEALTH_DEAD, - /** 保留位 */ + /** Reserved */ BATTERY_HEALTH_RESERVED, }; /** - * @brief 电池的充电状态 + * @brief Enumerates the battery charging status. + * + * @since 3.1 */ enum BatteryChargeState { - /** 表示电池充电状态未知 */ + /** Unknown state */ CHARGE_STATE_NONE = 0, - /** 表示电池充电状态为使能状态 */ + /** Charging enabled state */ CHARGE_STATE_ENABLE, - /** 表示电池充电状态为停止状态 */ + /** Charging disabled state */ CHARGE_STATE_DISABLE, - /** 表示电池充电状态为已充满状态 */ + /** Battery full state */ CHARGE_STATE_FULL, - /** 保留位 */ + /** Reserved */ CHARGE_STATE_RESERVED, }; /** - * @brief 电池的充电设备类型 + * @brief Enumerates the charging device type. + * + * @since 3.1 */ enum BatteryPluggedType { - /** 表示连接充电器类型未知 */ + /** Unknown type */ PLUGGED_TYPE_NONE = 0, - /** 表示连接的充电器类型为交流充电器 */ + /** AC charger */ PLUGGED_TYPE_AC, - /** 表示连接的充电器类型为USB */ + /** USB charger */ PLUGGED_TYPE_USB, - /** 表示连接的充电器类型为无线充电器 */ + /** Wireless charger */ PLUGGED_TYPE_WIRELESS, - /** 截止位 */ + /** Reserved */ PLUGGED_TYPE_BUTT }; /** - * @brief 电池相关信息 + * @brief Defines the battery information. + * + * @since 3.1 */ struct BatteryInfo { - /** 表示电池的电量百分比 */ + /** Battery percentage */ int capacity; - /** 表示电池的电压 */ + /** Battery voltage */ int voltage; - /** 表示电池的温度 */ + /** Battery temperature */ int temperature; - /** 表示电池的健康状态 */ + /** Battery health status */ int healthState; - /** 表示电池的充电设备类型 */ + /** Charging device type */ int pluggedType; - /** 表示电池的最大充电电流 */ + /** Maximum charging current */ int pluggedMaxCurrent; - /** 表示电池的最大充电电压 */ + /** Maximum charging voltage */ int pluggedMaxVoltage; - /** 表示电池的充电状态 */ + /** Charging status */ int chargeState; - /** 表示电池的充电次数 */ + /** Number of battery charging times */ int chargeCounter; - /** 表示电池的总容量 */ + /** Total battery capacity */ int totalEnergy; - /** 表示电池的平均电流 */ + /** Average battery current */ int curAverage; - /** 表示电池的实时电流 */ + /** Real-time battery current */ int curNow; - /** 表示电池的剩余容量 */ + /** Remaining battery capacity */ int remainEnergy; - /** 表示是否支持电池或者电池是否在位 */ + /** Whether the battery is supported or whether the battery is present */ byte present; - /** 表示电池的技术型号 */ + /** Battery technology */ String technology; }; /** @} */ diff --git a/power/v1_0/IPowerHdiCallback.idl b/power/v1_0/IPowerHdiCallback.idl index 4a2ce13a..36db0426 100755 --- a/power/v1_0/IPowerHdiCallback.idl +++ b/power/v1_0/IPowerHdiCallback.idl @@ -17,7 +17,11 @@ * @addtogroup power * @{ * - * @brief 提供休眠唤醒操作、订阅休眠唤醒状态、运行锁管理的接口。 + * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status, + * and managing running locks. + * + * After obtaining an object or proxy of this module, the power service can invoke related APIs to perform + * hibernation/wakeup operations, subscribe to the hibernation/wakeup status, and manage running locks. * * @since 3.1 * @version 1.0 @@ -26,7 +30,9 @@ /** * @file IPowerHdiCallback.idl * - * @brief 订阅休眠唤醒状态的回调。 + * @brief Provides the callbacks of the hibernation/wakeup status. + * + * The power module provides callbacks for the power service to obtain the hibernation/wakeup status. * * @since 3.1 * @version 1.0 @@ -35,16 +41,29 @@ package ohos.hdi.power.v1_0; /** - * @brief 订阅休眠唤醒状态的回调。 + * @brief Represents the callbacks of the hibernation/wakeup status. + * + * After creating a callback object, the power service can call {@link IPowerInterface} to register a callback to + * subscribe to hibernation/wakeup status changes. + * + * @since 3.1 */ [callback] interface IPowerHdiCallback { /** - * @brief 休眠状态的回调接口。 + * @brief Callback of the hibernation state. + * + * This callback is used to notify the power service when the device enters the hibernation state. + * + * @since 3.1 */ OnSuspend(); /** - * @brief 唤醒状态的回调接口。 + * @brief Callback of the wakeup state. + * + * This callback is used to notify the power service when the device enters the wakeup state. + * + * @since 3.1 */ OnWakeup(); } diff --git a/power/v1_0/IPowerInterface.idl b/power/v1_0/IPowerInterface.idl index 406d2ab9..79a7e3fa 100755 --- a/power/v1_0/IPowerInterface.idl +++ b/power/v1_0/IPowerInterface.idl @@ -17,16 +17,23 @@ * @addtogroup power * @{ * - * @brief 提供休眠唤醒操作、订阅休眠唤醒状态、运行锁管理的接口。 + * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status, + * and managing running locks. + * + * After obtaining an object or proxy of this module, the power service can invoke related APIs to perform + * hibernation/wakeup operations, subscribe to the hibernation/wakeup status, and manage running locks. * * @since 3.1 * @version 1.0 */ - /** +/** * @file IPowerInterface.idl * - * @brief 休眠唤醒操作、订阅休眠唤醒状态、运行锁管理的接口。 + * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status, + * and managing running locks. + * + * * * @since 3.1 * @version 1.0 @@ -38,64 +45,83 @@ import ohos.hdi.power.v1_0.IPowerHdiCallback; import ohos.hdi.power.v1_0.PowerTypes; /** - * @brief 休眠唤醒操作、订阅休眠唤醒状态、运行锁管理的接口。 + * @brief Represents APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status, + * and managing running locks. + * + * + * + * @since 3.1 */ interface IPowerInterface { /** - * @brief 订阅休眠唤醒状态。 + * @brief Registers the callback of the hibernation/wakeup status. * - * @param ipowerHdiCallback 输入参数, 注册的回调。 + * @param ipowerHdiCallback Callback to register. * - * @return HDF_SUCCESS 表示注册成功。 + * @return Returns HDF_SUCCESS if the operation is successful. * @see IPowerHdiCallback + * + * @since 3.1 */ RegisterCallback([in] IPowerHdiCallback ipowerHdiCallback); /** - * @brief 执行设备休眠操作。 + * @brief Hibernates a device. * - * @return HDF_SUCCESS 表示操作成功。 + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 3.1 */ StartSuspend(); /** - * @brief 执行设备唤醒操作。 + * @brief Wakes up a device. + * + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示操作成功。 + * @since 3.1 */ StopSuspend(); /** - * @brief 执行设备强制休眠操作。 + * @brief Forcibly hibernates a device. + * + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示操作成功。 + * @since 3.1 */ ForceSuspend(); /** - * @brief 打开运行锁,阻止休眠。 + * @brief Enables the running lock to block device hibernation. * - * @param name 输入参数, 运行锁的名称。 + * @param name Name of the running lock. * - * @return HDF_SUCCESS 表示操作成功。 + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 3.1 */ SuspendBlock([in] String name); /** - * @brief 关闭运行锁,取消阻止休眠。 + * @brief Disables the running lock to unblock device hibernation. + * + * @param name Name of the running lock. * - * @param name 输入参数, 运行锁的名称。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示操作成功。 + * @since 3.1 */ SuspendUnblock([in] String name); /** - * @brief 获取电源的Dump信息。 + * @brief Obtains the power dump information. + * + * @param info Power dump information. * - * @param info 输出参数, 电源的Dump信息。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示操作成功。 + * @since 3.1 */ PowerDump([out] String info); } diff --git a/power/v1_0/PowerTypes.idl b/power/v1_0/PowerTypes.idl index 841916e9..3665e0bc 100755 --- a/power/v1_0/PowerTypes.idl +++ b/power/v1_0/PowerTypes.idl @@ -17,7 +17,11 @@ * @addtogroup power * @{ * - * @brief 提供休眠唤醒操作、订阅休眠唤醒状态、运行锁管理的接口。 + * @brief Provides APIs for performing hibernation/wakeup operations, subscribing to the hibernation/wakeup status, + * and managing running locks. + * + * After obtaining an object or proxy of this module, the power service can invoke related APIs to perform + * hibernation/wakeup operations, subscribe to the hibernation/wakeup status, and manage running locks. * * @since 3.1 * @version 1.0 @@ -26,9 +30,9 @@ /** * @file PowerTypes.idl * - * @brief 电源相关的数据类型。 + * @brief Enumerates data types related to power management. * - * 电源管理中使用的数据类型, 包括命令参数、回调参数和系统状态。 + * Such data types include command parameters, callback parameters, and system status. * * @since 3.1 * @version 1.0 @@ -37,44 +41,50 @@ package ohos.hdi.power.v1_0; /** - * @brief 电源的枚举命令参数。 + * @brief Enumerates command parameters for power management. + * + * @since 3.1 */ enum PowerHdfCmd { - /** 订阅状态的命令参数 */ + /** Command parameter for registering a callback of the power status */ CMD_REGISTER_CALLBCK = 0, - /** 休眠的命令参数 */ + /** Command parameter for hibernating the device */ CMD_START_SUSPEND, - /** 唤醒的命令参数 */ + /** Command parameter for waking up the device */ CMD_STOP_SUSPEND, - /** 强制休眠的命令参数 */ + /** Command parameter for forcibly hibernating the device */ CMD_FORCE_SUSPEND, - /** 打开运行锁的命令参数 */ + /** Command parameter for opening the running lock */ CMD_SUSPEND_BLOCK, - /** 关闭运行锁的命令参数 */ + /** Command parameter for closing the running lock*/ CMD_SUSPEND_UNBLOCK, - /** Dump的命令参数 */ + /** Command parameter for dumping */ CMD_DUMP, }; /** - * @brief 电源状态回调的枚举参数。 + * @brief Enumerates command parameters for the power status callback. + * + * @since 3.1 */ enum PowerHdfCallbackCmd { - /** 休眠回调的命令参数 */ + /** Command parameter for the hibernation callback */ CMD_ON_SUSPEND = 0, - /** 唤醒回调的命令参数 */ + /** Command parameter for the wakeup callback */ CMD_ON_WAKEUP, }; /** - * @brief 电源的状态。 + * @brief Enumerates the power status. + * + * @since 3.1 */ enum PowerHdfState { - /** 唤醒状态 */ + /** Awake state */ AWAKE = 0, - /** 非活动状态 */ + /** Inactive state */ INACTIVE, - /** 休眠状态 */ + /** Sleep state */ SLEEP, }; /** @} */ diff --git a/thermal/v1_0/IThermalCallback.idl b/thermal/v1_0/IThermalCallback.idl index 0f9c5d4a..7d1b801b 100755 --- a/thermal/v1_0/IThermalCallback.idl +++ b/thermal/v1_0/IThermalCallback.idl @@ -17,16 +17,22 @@ * @addtogroup thermal * @{ * - * @brief 提供设备温度管理、控制及订阅接口。 + * @brief Provides APIs for managing, controlling, and subscribing to the device temperature. + * + * The thermal module provides APIs for the thermal service to manage, control, and subscribe to the device temperature. + * After obtaining an object or proxy of this module, the thermal service can invoke related APIs to manage, control, + * and subscribe to the device temperature. * * @since 3.1 * @version 1.0 */ - /** +/** * @file IThermalCallback.idl * - * @brief 订阅设备发热状态的回调。 + * @brief Provides the callback of device temperature changes. + * + * The thermal module provides the callback for the thermal service to obtain device temperature changes. * * @since 3.1 * @version 1.0 @@ -37,15 +43,22 @@ package ohos.hdi.thermal.v1_0; import ohos.hdi.thermal.v1_0.ThermalTypes; /** - * @brief 订阅设备发热状态的回调。 + * @brief Represents the callback of thermal status changes. + * + * After creating a callback object, the thermal service can call {@link IThermalInterface} to register a callback to + * subscribe to thermal status changes. + * + * @since 3.1 */ [callback] interface IThermalCallback { /** - * @brief 设备发热状态变化的回调接口。 - * - * @param event 输入参数, 设备发热信息。 - * @see HdfThermalCallbackInfo - */ + * @brief Callback of thermal status changes. + * + * @param event Thermal information of the device, including the device type and temperature. + * @see HdfThermalCallbackInfo + * + * @since 3.1 + */ OnThermalDataEvent([in] struct HdfThermalCallbackInfo event); } /** @} */ diff --git a/thermal/v1_0/IThermalInterface.idl b/thermal/v1_0/IThermalInterface.idl index e2395513..455fedab 100755 --- a/thermal/v1_0/IThermalInterface.idl +++ b/thermal/v1_0/IThermalInterface.idl @@ -17,7 +17,10 @@ * @addtogroup thermal * @{ * - * @brief 提供设备温度管理、控制及订阅接口。 + * @brief Provides APIs for managing, controlling, and subscribing to the device temperature. + * + * After obtaining an object or proxy of this module, the thermal service can invoke related APIs to manage, control, + * and subscribe to the device temperature. * * @since 3.1 * @version 1.0 @@ -26,7 +29,9 @@ /** * @file IThermalInterface.idl * - * @brief 温度管理、控制及订阅接口。 + * @brief Provides APIs for managing, controlling, and subscribing to the device temperature. + * + * * * @since 3.1 * @version 1.0 @@ -38,60 +43,76 @@ import ohos.hdi.thermal.v1_0.ThermalTypes; import ohos.hdi.thermal.v1_0.IThermalCallback; /** - * @brief 温度管理、控制及订阅接口。 + * @brief Represents APIs for managing, controlling, and subscribing to the device temperature. + * + * + * + * @since 3.1 */ interface IThermalInterface { /** - * @brief 设置CPU频率。 + * @brief Sets the CPU frequency. + * + * @param freq CPU frequency to set. * - * @param freq 输入参数,设置CPU频率的值。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示设置成功。 + * @since 3.1 */ SetCpuFreq([in] int freq); /** - * @brief 设置GPU频率。 + * @brief Sets the GPU frequency. * - * @param freq 输入参数,设置GPU频率的值。 + * @param freq GPU frequency to set. * - * @return HDF_SUCCESS 表示设置成功。 + * @return Returns HDF_SUCCESS if the operation is successful. + * + * @since 3.1 */ SetGpuFreq([in] int freq); /** - * @brief 设置充电电流,单位毫安。 + * @brief Sets the charging current. + * + * @param current Charging current, in mA. * - * @param current 输入参数,充电电流。 + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示设置成功 + * @since 3.1 */ SetBatteryCurrent([in] int current); /** - * @brief 获取设备发热的信息。 + * @brief Obtains the thermal information of the device. * - * @param event 输出参数, 设备发热信息。 + * @param event Thermal information of the device, including the device type and temperature. * - * @return HDF_SUCCESS 表示获取成功。 + * @return Returns HDF_SUCCESS if the operation is successful. * @see HdfThermalCallbackInfo + * + * @since 3.1 */ GetThermalZoneInfo([out] struct HdfThermalCallbackInfo event); /** - * @brief 订阅设备发热状态。 + * @brief Registers the callback of the device thermal status. * - * @param callbackObj 输入参数, 发热状态回调。 + * @param callbackObj Callback to register. * - * @return HDF_SUCCESS 表示注册成功。 + * @return Returns HDF_SUCCESS if the operation is successful. * @see IThermalCallback + * + * @since 3.1 */ Register([in] IThermalCallback callbackObj); /** - * @brief 取消订阅设备发热状态。 + * @brief Registers the callback of the device thermal status. + * + * @return Returns HDF_SUCCESS if the operation is successful. * - * @return HDF_SUCCESS 表示取消成功 + * @since 3.1 */ Unregister(); } diff --git a/thermal/v1_0/ThermalTypes.idl b/thermal/v1_0/ThermalTypes.idl index a151c68d..ac323dee 100755 --- a/thermal/v1_0/ThermalTypes.idl +++ b/thermal/v1_0/ThermalTypes.idl @@ -17,16 +17,21 @@ * @addtogroup thermal * @{ * - * @brief 提供设备温度管理、控制及订阅接口。 + * @brief Provides APIs for managing, controlling, and subscribing to the device temperature. + * + * After obtaining an object or proxy of this module, the thermal service can invoke related APIs to manage, control, + * and subscribe to the device temperature. * * @since 3.1 * @version 1.0 */ - /** +/** * @file ThermalTypes.idl * - * @brief 设备发热状态相关的数据类型。 + * @brief Enumerates data types related to thermal management. + * + * Such data types include thermal information and thermal information list. * * @since 3.1 * @version 1.0 @@ -35,20 +40,24 @@ package ohos.hdi.thermal.v1_0; /** - * @brief 设备发热的信息。 + * @brief Defines the device thermal information. + * + * @since 3.1 */ struct ThermalZoneInfo { - /** 发热器件的类型 */ + /** Device type */ String type; - /** 期间的温度值 */ + /** Device temperature */ int temp; }; /** - * @brief 设备发热的信息列表。 + * @brief Defines the device thermal information list. + * + * @since 3.1 */ struct HdfThermalCallbackInfo { - /** 设备发热的信息列表 */ + /** Device thermal information list */ List info; }; /** @} */ -- Gitee