ohos-sensors-sys 0.1.0

Rust bindings to the sensors and vibrator modules of OpenHarmony
Documentation
// automatically generated by rust-bindgen 0.71.1

#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
use crate::vibrator_type::*;

extern "C" {
    /// Controls the vibrator to vibrate continuously for a given duration.
    ///
    /// # Arguments
    ///
    /// * `duration` - - Vibration duration, in milliseconds.
    ///
    /// * `attribute` - - Vibration attribute. For details, see [`Vibrator_Attribute`].
    ///
    /// # Returns
    ///
    /// * Returns <b>0</b> if the operation is successful; returns the following error code otherwise.
    /// [`PERMISSION_DENIED`] Permission verification failed.
    ///
    /// [`PARAMETER_ERROR`] Parameter check failed. For example, the parameter is invalid,
    /// or the parameter type passed in is incorrect.
    ///
    /// [`UNSUPPORTED`] The API is not supported on the device. The device supports the corresponding SysCap,
    /// but does not support certain APIs in this SysCap.
    ///
    /// [`DEVICE_OPERATION_FAILED`] The operation on the device failed.
    ///
    /// ohos.permission.VIBRATE
    ///
    ///
    /// Available since API-level: 11
    #[cfg(feature = "api-11")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
    pub fn OH_Vibrator_PlayVibration(duration: i32, attribute: Vibrator_Attribute) -> i32;
    /// Controls the vibrator to vibrate with the custom sequence.
    ///
    /// # Arguments
    ///
    /// * `fileDescription` - - File descriptor of the custom vibration effect.
    /// For details, see [`Vibrator_FileDescription`].
    ///
    /// * `vibrateAttribute` - - Vibration attribute. For details, see [`Vibrator_Attribute`].
    ///
    /// # Returns
    ///
    /// * Returns <b>0</b> if the operation is successful; returns the following error code otherwise.
    /// [`PERMISSION_DENIED`] Permission verification failed.
    ///
    /// [`PARAMETER_ERROR`] Parameter check failed. For example, the parameter is invalid,
    /// or the parameter type passed in is incorrect.
    ///
    /// [`UNSUPPORTED`] The API is not supported on the device. The device supports the corresponding SysCap,
    /// but does not support certain APIs in this SysCap.
    ///
    /// [`DEVICE_OPERATION_FAILED`] The operation on the device failed.
    ///
    /// ohos.permission.VIBRATE
    ///
    ///
    /// Available since API-level: 11
    #[cfg(feature = "api-11")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
    pub fn OH_Vibrator_PlayVibrationCustom(
        fileDescription: Vibrator_FileDescription,
        vibrateAttribute: Vibrator_Attribute,
    ) -> i32;
    /// Stop the motor vibration according to the input mode.
    ///
    /// ohos.permission.VIBRATE
    ///
    /// # Returns
    ///
    /// * Returns <b>0</b> if the operation is successful; returns the following error code otherwise.
    /// [`PERMISSION_DENIED`] Permission verification failed.
    ///
    /// [`UNSUPPORTED`] The API is not supported on the device. The device supports the corresponding SysCap,
    /// but does not support certain APIs in this SysCap.
    ///
    /// [`DEVICE_OPERATION_FAILED`] The operation on the device failed.
    ///
    /// ohos.permission.VIBRATE
    ///
    ///
    /// Available since API-level: 11
    #[cfg(feature = "api-11")]
    #[cfg_attr(docsrs, doc(cfg(feature = "api-11")))]
    pub fn OH_Vibrator_Cancel() -> i32;
}