From b267db72657c6d84b29a5750746bf9834f97fcad Mon Sep 17 00:00:00 2001 From: cff-gite Date: Sat, 11 May 2024 16:13:52 +0800 Subject: [PATCH] vibrator capi Service exception rectification Signed-off-by: cff-gite Change-Id: I1c6572ae48c4487150bbf4e423cda0da0e013363 --- interfaces/kits/c/vibrator.h | 27 +++++++++++++++++++++------ interfaces/kits/c/vibrator_type.h | 8 ++++---- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/interfaces/kits/c/vibrator.h b/interfaces/kits/c/vibrator.h index e01fe0e..dc9a162 100644 --- a/interfaces/kits/c/vibrator.h +++ b/interfaces/kits/c/vibrator.h @@ -44,8 +44,13 @@ extern "C" { * * @param duration - Vibration duration, in milliseconds. * @param attribute - Vibration attribute. For details, see {@link Vibrator_Attribute}. - * @return Returns 0 if the operation is successful; returns a non-zero value otherwise. - * For details, see {@link Vibrator_ErrorCode}. + * @return Returns 0 if the operation is successful; returns the following error code otherwise. + * {@link PERMISSION_DENIED} Permission verification failed.\n + * {@link PARAMETER_ERROR} Parameter check failed. For example, a mandatory parameter is not passed in, + * or the parameter type passed in is incorrect.\n + * {@link UNSUPPORTED} The API is not supported on the device. The device supports the corresponding SysCap, + * but does not support certain APIs in this SysCap.\n + * {@link DEVICE_OPERATION_FAILED} The operation on the device failed.\n * @permission ohos.permission.VIBRATE * * @since 11 @@ -58,8 +63,13 @@ int32_t OH_Vibrator_PlayVibration(int32_t duration, Vibrator_Attribute attribute * @param fileDescription - File descriptor of the custom vibration effect. * For details, see {@link Vibrator_FileDescription}. * @param vibrateAttribute - Vibration attribute. For details, see {@link Vibrator_Attribute}. - * @return Returns 0 if the operation is successful; returns a non-zero value otherwise. - * For details, see {@link Vibrator_ErrorCode}. + * @return Returns 0 if the operation is successful; returns the following error code otherwise. + * {@link PERMISSION_DENIED} Permission verification failed.\n + * {@link PARAMETER_ERROR} Parameter check failed. For example, a mandatory parameter is not passed in, + * or the parameter type passed in is incorrect.\n + * {@link UNSUPPORTED} The API is not supported on the device. The device supports the corresponding SysCap, + * but does not support certain APIs in this SysCap.\n + * {@link DEVICE_OPERATION_FAILED} The operation on the device failed.\n * @permission ohos.permission.VIBRATE * * @since 11 @@ -71,8 +81,13 @@ int32_t OH_Vibrator_PlayVibrationCustom(Vibrator_FileDescription fileDescription * @brief Stop the motor vibration according to the input mode. * * @permission ohos.permission.VIBRATE - * @return Returns 0 if the operation is successful; returns a non-zero value otherwise. - * For details, see {@link Vibrator_ErrorCode}. + * @return Returns 0 if the operation is successful; returns the following error code otherwise. + * {@link PERMISSION_DENIED} Permission verification failed.\n + * {@link PARAMETER_ERROR} Parameter check failed. For example, a mandatory parameter is not passed in, + * or the parameter type passed in is incorrect.\n + * {@link UNSUPPORTED} The API is not supported on the device. The device supports the corresponding SysCap, + * but does not support certain APIs in this SysCap.\n + * {@link DEVICE_OPERATION_FAILED} The operation on the device failed.\n * @permission ohos.permission.VIBRATE * * @since 11 diff --git a/interfaces/kits/c/vibrator_type.h b/interfaces/kits/c/vibrator_type.h index 93b7b8b..2ba5601 100644 --- a/interfaces/kits/c/vibrator_type.h +++ b/interfaces/kits/c/vibrator_type.h @@ -28,15 +28,15 @@ extern "C" { * @since 11 */ typedef enum Vibrator_ErrorCode : int32_t { - /**< Permission verification failed. */ + /**< @error Permission verification failed. */ PERMISSION_DENIED = 201, - /**< Parameter check failed. For example, a mandatory parameter is not passed in, + /**< @error Parameter check failed. For example, a mandatory parameter is not passed in, * or the parameter type passed in is incorrect. */ PARAMETER_ERROR = 401, - /**< The API is not supported on the device. The device supports the corresponding SysCap, + /**< @error The API is not supported on the device. The device supports the corresponding SysCap, * but does not support certain APIs in this SysCap. */ UNSUPPORTED = 801, - /**< The operation on the device failed. */ + /**< @error The operation on the device failed. */ DEVICE_OPERATION_FAILED = 14600101, } Vibrator_ErrorCode; -- Gitee