Ubuntu Platform API  2.3.0
A library helping with tight integration into the Ubuntu platform
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 
42  UBUNTU_DLL_PUBLIC UASensorsHaptic*
44 
53  UASensorsHaptic* sensor);
54 
63  UASensorsHaptic* sensor);
64 
74  UASensorsHaptic* sensor,
75  uint32_t duration);
76 
77  #define MAX_PATTERN_SIZE 6
78 
90  UASensorsHaptic* sensor,
91  uint32_t pattern[MAX_PATTERN_SIZE],
92  uint32_t repeat);
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* UBUNTU_APPLICATION_SENSORS_HAPTIC_H_ */
UBUNTU_DLL_PUBLIC UStatus ua_sensors_haptic_enable(UASensorsHaptic *sensor)
Enables the supplied haptics device.
UbuntuStatus
Indicates the status of an operation.
Definition: status.h:26
void UASensorsHaptic
Opaque type that models the haptics device.
Definition: haptic.h:35
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.
UBUNTU_DLL_PUBLIC UStatus ua_sensors_haptic_vibrate_once(UASensorsHaptic *sensor, uint32_t duration)
Run the vibrator for a fixed duration.
#define UBUNTU_DLL_PUBLIC
Definition: visibility.h:26
#define MAX_PATTERN_SIZE
Definition: haptic.h:77
UBUNTU_DLL_PUBLIC UASensorsHaptic * ua_sensors_haptic_new()
Create a new object for accessing the haptics device.
UBUNTU_DLL_PUBLIC UStatus ua_sensors_haptic_disable(UASensorsHaptic *sensor)
Disables the supplied haptics device.