diff --git a/light/v1_0/ILightInterface.idl b/light/v1_0/ILightInterface.idl
index fe124dd5ac04c90966bb36efdb6fe1d35344c639..ac97619e2806ef062bff042a1547ce9de86ac3f9 100755
--- a/light/v1_0/ILightInterface.idl
+++ b/light/v1_0/ILightInterface.idl
@@ -13,11 +13,74 @@
* limitations under the License.
*/
+/**
+ * @addtogroup HdfLight
+ * @{
+ *
+ * @brief Provides APIs for the light service.
+ *
+ * The light module provides a unified interface for the light service to access the light driver.
+ * After obtaining the driver object or proxy, the light service distinguishes light devices by type
+ * and call related APIs to obtain light information, turn on or off a light, or set the blinking mode.
+ * @since 3.1
+ */
+
+/**
+ * @file ILightInterface.idl
+ *
+ * @brief Declares common APIs of the light module. These APIs can be used to obtain the light type,
+ * turn on or off a light, and set the light brightness and blinking mode.
+ * @since 3.1
+ */
+
+/**
+ * @brief Defines the basic operations that can be performed on lights.
+ *
+ * The operations include obtaining light information, turning on or off a light,
+ * and setting the light brightness or blinking mode.
+ */
+
package ohos.hdi.light.v1_0;
import ohos.hdi.light.v1_0.LightTypes;
interface ILightInterface {
+ /**
+ * @brief Obtains information about all the lights in the system.
+ *
+ * @param info Indicates the vector of the light information. For details, see {@link HdfLightInfo}.
+ *
+ * @return Returns 0 if the operation is successful.
+ * @return Returns a negative value if the operation fails.
+ *
+ * @since 3.1
+ */
GetLightInfo([out] struct HdfLightInfo[] info);
+
+ /**
+ * @brief Turns on available lights in the list based on the specified light type.
+ *
+ * @param lightId Indicates the light type. For details, see {@link HdfLightType}.
+ *
+ * @param effect Indicates the pointer to the lighting effect. For details, see {@link HdfLightEffect}.
+ *
+ * @return Returns 0 if the operation is successful.
+ * @return Returns -1 if the light type is not supported.
+ * @return Returns -2 if the blinking setting is not supported.
+ * @return Returns -3 if the brightness setting is not supported.
+ *
+ * @since 3.1
+ */
TurnOnLight([in] int lightId, [in] struct HdfLightEffect effect);
- TurnOffLight([in] int LightId);
-}
\ No newline at end of file
+
+ /**
+ * @brief Turns off available lights in the list based on the specified light type.
+ *
+ * @param lightId Indicates the light type. For details, see {@link HdfLightType}.
+ *
+ * @return Returns 0 if the operation is successful.
+ * @return Returns a negative value if the operation fails.
+ *
+ * @since 3.1
+ */
+ TurnOffLight([in] int lightId);
+}
diff --git a/light/v1_0/LightTypes.idl b/light/v1_0/LightTypes.idl
index 8ff6b5221f0778a9721fba9448a58fb89afa57cc..bbe19da3e55f4e1a551458589a9f234a881df1a9 100755
--- a/light/v1_0/LightTypes.idl
+++ b/light/v1_0/LightTypes.idl
@@ -13,8 +13,33 @@
* limitations under the License.
*/
+/**
+ * @addtogroup HdfLight
+ * @{
+ *
+ * @brief Provides APIs for the light service.
+ *
+ * The light module provides a unified interface for the light service to access the light driver.
+ * After obtaining the light driver object or proxy, the service can call related APIs to obtain light information,
+ * turn on or off a light, and set the light blinking mode based on the light type.
+ * @since 3.1
+ */
+
+/**
+ * @file LightTypes.idl
+ *
+ * @brief Defines the light data structure, including the light type, lighting mode,
+ * blinking mode and duration, return values, and lighting effect.
+ * @since 3.1
+ */
+
package ohos.hdi.light.v1_0;
+/**
+ * @brief Enumerates the light types.
+ *
+ * @since 3.1
+ */
enum HdfLighType {
HDF_LIGHT_TYPE_BATTERY = 1,
HDF_LIGHT_TYPE_NOTIFICATIONS = 2,
@@ -22,24 +47,51 @@ enum HdfLighType {
HDF_LIGHT_ID_BUTT = 4,
};
+/**
+ * @brief Defines the basic light information.
+ *
+ * Basic light information includes the light type and custom extended information.
+ *
+ * @since 3.1
+ */
struct HdfLightInfo {
- int lightId;
- int reserved;
+ int lightId; /** Light type. For details, see {@link HdfLighType}. */
+ int reserved; /** Custom extended information. */
};
+/**
+ * @brief Enumerates the lighting modes.
+ *
+ * @since 3.1
+ */
enum HdfLightFlashMode {
HDF_LIGHT_FLASH_NONE = 0,
HDF_LIGHT_FLASH_TIMED = 1,
HDF_LIGHT_FLASH_BUTT = 2,
};
+/**
+ * @brief Defines the blinking parameters.
+ *
+ * The parameters include the blinking mode and the on and off time for the light in a blinking period.
+ *
+ * @since 3.1
+ */
struct HdfLightFlashEffect {
- int flashMode;
- int onTime;
- int offTime;
+ int flashMode; /** Blinking mode. For details, see {@link HdfLightFlashMode}. */
+ int onTime; /** Duration (in ms) for which the light is on in a blinking period. */
+ int offTime; /** Duration (in ms) for which the light is off in a blinking period. */
};
+/**
+ * @brief Defines the lighting effect parameters.
+ *
+ * The parameters include the brightness and blinking mode.
+ *
+ * @since 3.1
+ */
struct HdfLightEffect {
- int lightBrightness;
- struct HdfLightFlashEffect flashEffect;
-};
\ No newline at end of file
+ int lightBrightness; /** Brightness value. The value 1 of the most significant bit indicates a color.
+ Bits 16–31 for red, bits 8–15 for green, and bits 0–7 for blue. */
+ struct HdfLightFlashEffect flashEffect; /** Blinking mode. For details, see {@link LightFlashEffect}. */
+};
diff --git a/sensor/v1_0/ISensorInterface.idl b/sensor/v1_0/ISensorInterface.idl
index 31e9f51376e58b1242c401e50250a40fdf9906fe..599042094ec2e0523379588bba1a950d0b159d90 100644
--- a/sensor/v1_0/ISensorInterface.idl
+++ b/sensor/v1_0/ISensorInterface.idl
@@ -130,6 +130,10 @@ interface ISensorInterface {
* @brief Registers the callback for reporting sensor data to the subscriber.
*
* @param groupId Indicates the sensor group ID.
+ * The sensorId enumeration value range is 128-160, which means that the medical sensor service is subscribed.
+ * It only needs to be subscribed once successfully, and there is no need to subscribe repeatedly.
+ * The sensorId enumeration value range is not within 128-160, which means that the traditional sensor
+ * is subscribed, and the subscription is successful once.
* @param callbackObj Indicates the callback to register. For details, see {@link ISensorCallback}.
* @return Returns 0 if the callback is successfully registered; returns a negative value otherwise.
*
@@ -140,7 +144,13 @@ interface ISensorInterface {
/**
* @brief Deregisters the callback for reporting sensor data.
+ *
* @param groupId Indicates the sensor group ID.
+ * The sensorId enumeration value range is 128-160, which means that the medical sensor service is subscribed.
+ * It only needs to cancel the subscription once successfully, and there is no need to
+ * cancel the subscription repeatedly. The sensorId enumeration value range is not within 128-160,
+ * which means that the traditional sensor is subscribed. You can cancel the subscription once successfully.
+ * @param callbackObj Indicates the callback to deregister. For details, see {@link ISensorCallback}.
* @return Returns 0 if the callback is successfully deregistered; returns a negative value otherwise.
*
* @since 2.2