summaryrefslogtreecommitdiffstats
path: root/include/hardware/sensors.h
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-07-08 14:00:54 -0700
committerMathias Agopian <mathias@google.com>2013-07-08 15:30:54 -0700
commit27e16688ec7496e72304d093a24d9c1d4fd37be5 (patch)
tree6799de041f006f98447bbb3f59ecf7069e200f06 /include/hardware/sensors.h
parentc6bf2f291ddca5e8807268f89733e9f6637b4303 (diff)
downloadhardware_libhardware-27e16688ec7496e72304d093a24d9c1d4fd37be5.zip
hardware_libhardware-27e16688ec7496e72304d093a24d9c1d4fd37be5.tar.gz
hardware_libhardware-27e16688ec7496e72304d093a24d9c1d4fd37be5.tar.bz2
be more explicit about 64 bits values in sensor events
Change-Id: I61e4832ff2c721987c38897924b1b50b758384da
Diffstat (limited to 'include/hardware/sensors.h')
-rw-r--r--include/hardware/sensors.h58
1 files changed, 32 insertions, 26 deletions
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index 7778e8f..f938d1b 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -761,45 +761,51 @@ typedef struct sensors_event_t {
int64_t timestamp;
union {
- float data[16];
+ union {
+ float data[16];
- /* acceleration values are in meter per second per second (m/s^2) */
- sensors_vec_t acceleration;
+ /* 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;
+ /* magnetic vector values are in micro-Tesla (uT) */
+ sensors_vec_t magnetic;
- /* orientation values are in degrees */
- sensors_vec_t orientation;
+ /* orientation values are in degrees */
+ sensors_vec_t orientation;
- /* gyroscope values are in rad/s */
- sensors_vec_t gyro;
+ /* gyroscope values are in rad/s */
+ sensors_vec_t gyro;
- /* temperature is in degrees centigrade (Celsius) */
- float temperature;
+ /* temperature is in degrees centigrade (Celsius) */
+ float temperature;
- /* distance in centimeters */
- float distance;
+ /* distance in centimeters */
+ float distance;
- /* light in SI lux units */
- float light;
+ /* light in SI lux units */
+ float light;
- /* pressure in hectopascal (hPa) */
- float pressure;
+ /* pressure in hectopascal (hPa) */
+ float pressure;
- /* relative humidity in percent */
- float relative_humidity;
+ /* relative humidity in percent */
+ float relative_humidity;
- /* step-counter */
- uint64_t step_counter;
+ /* uncalibrated gyroscope values are in rad/s */
+ uncalibrated_event_t uncalibrated_gyro;
- /* uncalibrated gyroscope values are in rad/s */
- uncalibrated_event_t uncalibrated_gyro;
+ /* uncalibrated magnetometer values are in micro-Teslas */
+ uncalibrated_event_t uncalibrated_magnetic;
+ };
+
+ union {
+ uint64_t data[8];
- /* uncalibrated magnetometer values are in micro-Teslas */
- uncalibrated_event_t uncalibrated_magnetic;
+ /* step-counter */
+ uint64_t step_counter;
+ } u64;
};
- uint32_t reserved1[4];
+ uint32_t reserved1[4];
} sensors_event_t;