From d1e2562a798004cdf495fa7168ef1f6950301a07 Mon Sep 17 00:00:00 2001 From: Ashutosh Joshi Date: Tue, 10 Jan 2017 18:33:53 -0800 Subject: [PATCH] Add an uncalibrated accelerometer type. Add an uncalibrated accelerometer sensor type. Test: Build compiles. Change-Id: Iddc3b03abf0ba9beeec542eecf138b06d08355f2 --- include/hardware/sensors-base.h | 1 + include/hardware/sensors.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/hardware/sensors-base.h b/include/hardware/sensors-base.h index 465b85d5..330cbc42 100644 --- a/include/hardware/sensors-base.h +++ b/include/hardware/sensors-base.h @@ -49,6 +49,7 @@ enum { SENSOR_TYPE_DYNAMIC_SENSOR_META = 32, SENSOR_TYPE_ADDITIONAL_INFO = 33, SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34, + SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35, SENSOR_TYPE_DEVICE_PRIVATE_BASE = 65536, // 0x10000 }; diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h index 08a65f8b..b3da5870 100644 --- a/include/hardware/sensors.h +++ b/include/hardware/sensors.h @@ -164,6 +164,7 @@ enum { #define SENSOR_STRING_TYPE_DYNAMIC_SENSOR_META "android.sensor.dynamic_sensor_meta" #define SENSOR_STRING_TYPE_ADDITIONAL_INFO "android.sensor.additional_info" #define SENSOR_STRING_TYPE_LOW_LATENCY_OFFBODY_DETECT "android.sensor.low_latency_offbody" +#define SENSOR_STRING_TYPE_ACCELEROMETER_UNCALIBRATED "android.sensor.accelerometer_uncalibrated" /** * Values returned by the accelerometer in various locations in the universe. @@ -202,7 +203,7 @@ typedef struct { } sensors_vec_t; /** - * uncalibrated gyroscope and magnetometer event data + * uncalibrated accelerometer, gyroscope and magnetometer event data */ typedef struct { union { @@ -326,6 +327,9 @@ typedef struct sensors_event_t { /* uncalibrated magnetometer values are in micro-Teslas */ uncalibrated_event_t uncalibrated_magnetic; + /* uncalibrated accelerometer values are in meter per second per second (m/s^2) */ + uncalibrated_event_t uncalibrated_accelerometer; + /* heart rate data containing value in bpm and status */ heart_rate_event_t heart_rate;