summaryrefslogtreecommitdiff
path: root/tilt/clockwork_sensor.h
blob: 150b741532c97732cf22291d8deb923859c7362a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
 * Copyright (C) 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_CLOCKWORK_SENSOR_INTERFACE_H
#define ANDROID_CLOCKWORK_SENSOR_INTERFACE_H

#include <hardware/sensors.h>

__BEGIN_DECLS

/*
 * SENSOR_TYPE_WRIST_TILT
 * trigger-mode: special
 * wake-up sensor: yes
 *
 * A sensor of this type triggers an event each time a tilt of the device
 * is detected.
 *
 * Upon detecting a tilt event, a single event is returned containing the
 * value of the 3 accelerometer axes when the tilt event was detected.
 *
 *  All values are in SI units (m/s^2) and measure the acceleration of the
 *  device minus the force of gravity.
 *
 *  x: Acceleration on the x-axis
 *  y: Acceleration on the y-axis
 *  z: Acceleration on the z-axis
 *
 * Note that the readings from the accelerometer include the acceleration
 * due to gravity (which is opposite to the direction of the gravity vector).
 *
 * See "SENSOR_TYPE_ACCELEROMETER" for more detail on returned accelerometer
 * data.
 *
 * setDelay() has no impact on this sensor type
 *
 *  IMPORTANT NOTE: this sensor type is very different from other types
 *  in that it must work when the screen is off without the need of
 *  holding a partial wake-lock and MUST allow the SoC to go into suspend.
 *  When a tilt event is detected, the sensor must awaken the SoC and
 *  the event be reported.
 *
 *  When the sensor is not activated, it must also be deactivated in the
 *  hardware: it must not wake up the SoC anymore, even in case of
 *  a tilt event.
 */
#define SENSOR_TYPE_WRIST_TILT        (SENSOR_TYPE_DEVICE_PRIVATE_BASE)
#define SENSOR_STRING_TYPE_WRIST_TILT "com.google.android_wear.wrist.tilt"

__END_DECLS

#endif  /* ANDROID_CLOCKWORK_SENSOR_INTERFACE_H */