mirror of
https://gitee.com/openharmony/interface_sdk_c
synced 2024-11-23 06:39:54 +00:00
capi Service exception rectification
Signed-off-by: cff-gite <chenfeifei8@huawei.com>
This commit is contained in:
parent
7c847b7b87
commit
f9ab2f7696
@ -44,8 +44,13 @@ extern "C" {
|
||||
*
|
||||
* @param duration - Vibration duration, in milliseconds.
|
||||
* @param attribute - Vibration attribute. For details, see {@link Vibrator_Attribute}.
|
||||
* @return Returns <b>0</b> if the operation is successful; returns a non-zero value otherwise.
|
||||
* For details, see {@link Vibrator_ErrorCode}.
|
||||
* @return Returns <b>0</b> 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 <b>0</b> if the operation is successful; returns a non-zero value otherwise.
|
||||
* For details, see {@link Vibrator_ErrorCode}.
|
||||
* @return Returns <b>0</b> 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 <b>0</b> if the operation is successful; returns a non-zero value otherwise.
|
||||
* For details, see {@link Vibrator_ErrorCode}.
|
||||
* @return Returns <b>0</b> 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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -45,8 +45,12 @@ extern "C" {
|
||||
* @param infos - Double pointer to the information about all sensors on the device.
|
||||
* For details, see {@link Sensor_Info}.
|
||||
* @param count - Pointer to the number of sensors on the device.
|
||||
* @return Returns <b>SENSOR_SUCCESS</b> if the operation is successful;
|
||||
* returns an error code defined in {@link Sensor_Result} otherwise.
|
||||
* @return Returns <b>SENSOR_SUCCESS</b> if the operation is successful; returns the following error code otherwise.
|
||||
* {@link SENSOR_SUCCESS} The operation is successful.\n
|
||||
* {@link SENSOR_PERMISSION_DENIED} Permission verification failed.\n
|
||||
* {@link SENSOR_PARAMETER_ERROR} Parameter check failed. For example, a mandatory parameter is not passed in,
|
||||
* or the parameter type passed in is incorrect.\n
|
||||
* {@link SENSOR_SERVICE_EXCEPTION} The sensor service is abnormal.\n
|
||||
*
|
||||
* @since 11
|
||||
*/
|
||||
@ -65,8 +69,12 @@ Sensor_Result OH_Sensor_GetInfos(Sensor_Info **infos, uint32_t *count);
|
||||
* For details, see {@link Sensor_SubscriptionAttribute}.
|
||||
* @param subscriber - Pointer to the subscriber information, which is used to specify the callback function for
|
||||
* reporting the sensor data. For details, see {@link Sensor_Subscriber}.
|
||||
* @return Returns <b>SENSOR_SUCCESS</b> if the operation is successful;
|
||||
* returns an error code defined in {@link Sensor_Result} otherwise.
|
||||
* @return Returns <b>SENSOR_SUCCESS</b> if the operation is successful; returns the following error code otherwise.
|
||||
* {@link SENSOR_SUCCESS} The operation is successful.\n
|
||||
* {@link SENSOR_PERMISSION_DENIED} Permission verification failed.\n
|
||||
* {@link SENSOR_PARAMETER_ERROR} Parameter check failed. For example, a mandatory parameter is not passed in,
|
||||
* or the parameter type passed in is incorrect.\n
|
||||
* {@link SENSOR_SERVICE_EXCEPTION} The sensor service is abnormal.\n
|
||||
* @permission ohos.permission.ACCELEROMETER or ohos.permission.GYROSCOPE or
|
||||
* ohos.permission.ACTIVITY_MOTION or ohos.permission.READ_HEALTH_DATA
|
||||
* @since 11
|
||||
@ -85,8 +93,12 @@ Sensor_Result OH_Sensor_Subscribe(const Sensor_SubscriptionId *id,
|
||||
* @param id - Pointer to the sensor subscription ID. For details, see {@link Sensor_SubscriptionId}.
|
||||
* @param subscriber - Pointer to the subscriber information, which is used to specify the callback function for
|
||||
* reporting the sensor data. For details, see {@link Sensor_Subscriber}.
|
||||
* @return Returns <b>SENSOR_SUCCESS</b> if the operation is successful;
|
||||
* returns an error code defined in {@link Sensor_Result} otherwise.
|
||||
* @return Returns <b>SENSOR_SUCCESS</b> if the operation is successful; returns the following error code otherwise.
|
||||
* {@link SENSOR_SUCCESS} The operation is successful.\n
|
||||
* {@link SENSOR_PERMISSION_DENIED} Permission verification failed.\n
|
||||
* {@link SENSOR_PARAMETER_ERROR} Parameter check failed. For example, a mandatory parameter is not passed in,
|
||||
* or the parameter type passed in is incorrect.\n
|
||||
* {@link SENSOR_SERVICE_EXCEPTION} The sensor service is abnormal.\n
|
||||
* @permission ohos.permission.ACCELEROMETER or ohos.permission.GYROSCOPE or
|
||||
* ohos.permission.ACTIVITY_MOTION or ohos.permission.READ_HEALTH_DATA
|
||||
*
|
||||
|
@ -120,23 +120,23 @@ typedef enum Sensor_Type {
|
||||
*/
|
||||
typedef enum Sensor_Result {
|
||||
/**
|
||||
* The operation is successful.
|
||||
* @error The operation is successful.
|
||||
* @since 11
|
||||
*/
|
||||
SENSOR_SUCCESS = 0,
|
||||
/**
|
||||
* Permission verification failed.
|
||||
* @error Permission verification failed.
|
||||
* @since 11
|
||||
*/
|
||||
SENSOR_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.
|
||||
* @since 11
|
||||
*/
|
||||
SENSOR_PARAMETER_ERROR = 401,
|
||||
/**
|
||||
* The sensor service is abnormal.
|
||||
* @error The sensor service is abnormal.
|
||||
* @since 11
|
||||
*/
|
||||
SENSOR_SERVICE_EXCEPTION = 14500101,
|
||||
|
Loading…
Reference in New Issue
Block a user