The Haptic API provides functions to control a vibrator.
Required Header
#include <device/haptic.h>
Overview
The Haptic API provides the way to control vibration functionality of a device. It allows the management of the device's vibrator parameters, such as the vibration count and level.
Function Documentation
Closes a haptic-vibration device.
Internally, it disconnects the connection to the vibrator.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/haptic
- Parameters:
-
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- See also:
- device_haptic_open()
Gets the number of vibrators.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/haptic
- Parameters:
-
[in] | device_number | The number of vibrators |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Opens a haptic-vibration device.
Internally, it makes a connection to the vibrator.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/haptic
- Parameters:
-
[in] | device_index | The index of device what you want to vibrate
The index starts from 0 |
[out] | device_handle | The handle of vibrator |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- See also:
- device_haptic_close()
Stops all vibration effects which are being played.
This function can be used to stop all effects started by device_haptic_vibrate().
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/haptic
- Parameters:
-
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- See also:
- device_haptic_vibrate()
Vibrates during the specified time with a constant intensity.
This function can be used to start monotonous vibration for the specified time.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/haptic
- Parameters:
-
[in] | device_handle | The device handle from device_haptic_open() |
[in] | duration | The play duration in milliseconds |
[in] | feedback | The amount of the intensity variation (0 ~ 100 ) |
[out] | effect_handle | The pointer to the variable that will receive a handle to the playing effect |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- See also:
- device_haptic_stop()