diff options
author | Mathias Agopian <mathias@google.com> | 2010-07-15 18:29:03 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2010-07-19 14:14:04 -0700 |
commit | cdefccdba52337df41f577d9ebfcfd67c05708cf (patch) | |
tree | 03129c5aa6925aea8353664d8c196227f69bfd03 /include/hardware/sensors.h | |
parent | b1e212e7b6fce2bc5c743b05853129e19760d7a4 (diff) |
new sensor_event_t structure for the new HAL that can handle bigger payloads
Change-Id: I8f21e457c308eea9cb1f73b49b1fed36627ec55e
Diffstat (limited to 'include/hardware/sensors.h')
-rw-r--r-- | include/hardware/sensors.h | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h index 883cb474..a044e47b 100644 --- a/include/hardware/sensors.h +++ b/include/hardware/sensors.h @@ -249,6 +249,53 @@ typedef struct { } sensors_data_t; + +/** + * Union of the various types of sensor data + * that can be returned. + */ +typedef struct sensors_event_t { + /* must be sizeof(struct sensors_event_t) */ + int32_t version; + + /* sensor identifier */ + int32_t sensor; + + /* sensor type */ + int32_t type; + + /* reserved */ + int32_t reserved0; + + /* time is in nanosecond */ + int64_t timestamp; + + union { + float data[16]; + + /* acceleration values are in meter per second per second (m/s^2) */ + sensors_vec_t acceleration; + + /* magnetic vector values are in micro-Tesla (uT) */ + sensors_vec_t magnetic; + + /* orientation values are in degrees */ + sensors_vec_t orientation; + + /* temperature is in degrees centigrade (Celsius) */ + float temperature; + + /* distance in centimeters */ + float distance; + + /* light in SI lux units */ + float light; + }; + uint32_t reserved1[4]; +} sensors_event_t; + + + struct sensor_t; /** @@ -327,7 +374,7 @@ struct sensors_poll_device_t { * */ int (*poll)(struct sensors_poll_device_t *dev, - sensors_data_t* data, int count); + sensors_event_t* data, int count); }; |