Ubuntu Platform API  3.0.0
A library helping with tight integration into the Ubuntu platform
haptic.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Ricardo Mendoza <ricardo.mendoza@canonical.com>
17  */
18 
19 #ifndef UBUNTU_APPLICATION_SENSORS_HAPTIC_H_
20 #define UBUNTU_APPLICATION_SENSORS_HAPTIC_H_
21 
22 #include <ubuntu/status.h>
23 #include <ubuntu/visibility.h>
24 
25 #include <stdint.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
35  typedef void UASensorsHaptic;
36 
45 
54 
63  UASensorsHaptic* sensor);
64 
73  UASensorsHaptic* sensor);
74 
84  UASensorsHaptic* sensor,
85  uint32_t duration);
86 
87  #define MAX_PATTERN_SIZE 6
88 
100  UASensorsHaptic* sensor,
101  uint32_t pattern[MAX_PATTERN_SIZE],
102  uint32_t repeat);
103 
104 #ifdef __cplusplus
105 }
106 #endif
107 
108 #endif /* UBUNTU_APPLICATION_SENSORS_HAPTIC_H_ */
ua_sensors_haptic_disable
UBUNTU_DLL_PUBLIC UStatus ua_sensors_haptic_disable(UASensorsHaptic *sensor)
Disables the supplied haptics device.
visibility.h
ua_sensors_haptic_enable
UBUNTU_DLL_PUBLIC UStatus ua_sensors_haptic_enable(UASensorsHaptic *sensor)
Enables the supplied haptics device.
UbuntuStatus
UbuntuStatus
Indicates the status of an operation.
Definition: status.h:26
UBUNTU_DLL_PUBLIC
#define UBUNTU_DLL_PUBLIC
Definition: visibility.h:26
UASensorsHaptic
void UASensorsHaptic
Opaque type that models the haptics device.
Definition: haptic.h:35
ua_sensors_haptic_vibrate_once
UBUNTU_DLL_PUBLIC UStatus ua_sensors_haptic_vibrate_once(UASensorsHaptic *sensor, uint32_t duration)
Run the vibrator for a fixed duration.
ua_sensors_haptic_vibrate_with_pattern
UBUNTU_DLL_PUBLIC UStatus ua_sensors_haptic_vibrate_with_pattern(UASensorsHaptic *sensor, uint32_t pattern[MAX_PATTERN_SIZE], uint32_t repeat)
Run the vibrator with a pattern and repeat a precise number of times.
ua_sensors_haptic_destroy
UBUNTU_DLL_PUBLIC void ua_sensors_haptic_destroy(UASensorsHaptic *sensor)
Destroys the given sensor instance and releases all resources held by the instance.
MAX_PATTERN_SIZE
#define MAX_PATTERN_SIZE
Definition: haptic.h:87
ua_sensors_haptic_new
UBUNTU_DLL_PUBLIC UASensorsHaptic * ua_sensors_haptic_new()
Create a new object for accessing the haptics device. Ownership is transfered to caller.
status.h