#include <ubuntu/status.h>
#include <ubuntu/visibility.h>
#include <stdint.h>
Go to the source code of this file.
◆ MAX_PATTERN_SIZE
#define MAX_PATTERN_SIZE 6 |
◆ UASensorsHaptic
Opaque type that models the haptics device.
Definition at line 35 of file haptic.h.
◆ ua_sensors_haptic_destroy()
Destroys the given sensor instance and releases all resources held by the instance.
- Parameters
-
[in] | sensor | The instance to be destroyed. |
- Postcondition
- All resources held by the instance are released. The result of any operation invoked on the destroyed instance are undefined.
◆ ua_sensors_haptic_disable()
Disables the supplied haptics device.
- Returns
- U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
- Parameters
-
[in] | sensor | The sensor instance to be disabled. |
◆ ua_sensors_haptic_enable()
Enables the supplied haptics device.
- Returns
- U_STATUS_SUCCESS if successful or U_STATUS_ERROR if an error occured.
- Parameters
-
[in] | sensor | The sensor instance to be enabled. |
◆ ua_sensors_haptic_new()
Create a new object for accessing the haptics device. Ownership is transfered to caller.
- See also
- ua_sensors_haptic_destroy
- Returns
- A new instance or NULL in case of errors.
◆ ua_sensors_haptic_vibrate_once()
Run the vibrator for a fixed duration.
- Returns
- U_STATUS_SUCCESS if pushed correctly, U_STATUS_ERROR if the pattern limit is invalid or the actuator cannot be activated.
- Parameters
-
[in] | sensor | Haptic device to activate. |
[in] | duration | How long should the vibrator stay on. |
◆ ua_sensors_haptic_vibrate_with_pattern()
Run the vibrator with a pattern and repeat a precise number of times.
- Returns
- U_STATUS_SUCCESS if pushed correctly, U_STATUS_ERROR if the pattern limit is invalid or the actuator cannot be activated.
- Parameters
-
[in] | sensor | Haptic device to activate. |
[in] | pattern | An array of uint32_t durations for which to keep the vibrator on or off. The first value indicates how long to keep the vibrator on for, the second value how long to keep it off for, and so on until the end of the array. |
[in] | repeat | How many times to repeat the whole pattern for. |