summaryrefslogtreecommitdiffstats
path: root/include/hardware/sensors.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-02-06 19:06:57 -0800
committerMathias Agopian <mathias@google.com>2013-02-06 19:06:57 -0800
commitfbe985ca9c8cd502ce9b8b0332dbdd639e9b723e (patch)
treed323f8a5b8234a7908958d94ae0cef5132f58314 /include/hardware/sensors.h
parent1144bea332fb24789712062bb35fe762f2f17505 (diff)
downloadhardware_libhardware-fbe985ca9c8cd502ce9b8b0332dbdd639e9b723e.zip
hardware_libhardware-fbe985ca9c8cd502ce9b8b0332dbdd639e9b723e.tar.gz
hardware_libhardware-fbe985ca9c8cd502ce9b8b0332dbdd639e9b723e.tar.bz2
only orientation and geomagnetic field sensors support the "status" field
enforce this in the HAL API. Change-Id: I54d2fde84a852482a96140f8f1945cc6044e628a
Diffstat (limited to 'include/hardware/sensors.h')
-rw-r--r--include/hardware/sensors.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index 7b5b7c9..0421a4b 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -664,6 +664,22 @@ typedef struct {
float roll;
};
};
+} sensors_data_t;
+
+typedef struct {
+ union {
+ float v[3];
+ struct {
+ float x;
+ float y;
+ float z;
+ };
+ struct {
+ float azimuth;
+ float pitch;
+ float roll;
+ };
+ };
int8_t status;
uint8_t reserved[3];
} sensors_vec_t;
@@ -692,7 +708,7 @@ typedef struct sensors_event_t {
float data[16];
/* acceleration values are in meter per second per second (m/s^2) */
- sensors_vec_t acceleration;
+ sensors_data_t acceleration;
/* magnetic vector values are in micro-Tesla (uT) */
sensors_vec_t magnetic;
@@ -701,7 +717,7 @@ typedef struct sensors_event_t {
sensors_vec_t orientation;
/* gyroscope values are in rad/s */
- sensors_vec_t gyro;
+ sensors_data_t gyro;
/* temperature is in degrees centigrade (Celsius) */
float temperature;