summaryrefslogtreecommitdiffstats
path: root/sensors/1.0
diff options
context:
space:
mode:
authorAshutosh Joshi <ashutoshj@google.com>2017-01-13 17:47:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-01-13 17:47:30 +0000
commit497b587941e434677dcfd317014240b4585f37ac (patch)
treeed8c3c6369be1d2dec3c910d098017d7157e6d86 /sensors/1.0
parent6a324feba52529ee702b9ad9d6b554c258ff178f (diff)
parent4faa8c70be85c7d24c269aba905fb0ac366bcca7 (diff)
downloadplatform_hardware_interfaces-497b587941e434677dcfd317014240b4585f37ac.tar.gz
platform_hardware_interfaces-497b587941e434677dcfd317014240b4585f37ac.tar.bz2
platform_hardware_interfaces-497b587941e434677dcfd317014240b4585f37ac.zip
Merge "Add the uncalibrated accelerometer sensor type."
Diffstat (limited to 'sensors/1.0')
-rw-r--r--sensors/1.0/default/convert.cpp2
-rw-r--r--sensors/1.0/types.hal15
2 files changed, 16 insertions, 1 deletions
diff --git a/sensors/1.0/default/convert.cpp b/sensors/1.0/default/convert.cpp
index 18725e7104..68fb75c786 100644
--- a/sensors/1.0/default/convert.cpp
+++ b/sensors/1.0/default/convert.cpp
@@ -105,6 +105,7 @@ void convertFromSensorEvent(const sensors_event_t &src, Event *dst) {
case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
+ case SensorType::SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED:
{
dst->u.uncal.x = src.uncalibrated_gyro.x_uncalib;
dst->u.uncal.y = src.uncalibrated_gyro.y_uncalib;
@@ -243,6 +244,7 @@ void convertToSensorEvent(const Event &src, sensors_event_t *dst) {
case SensorType::SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED:
case SensorType::SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
+ case SensorType::SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED:
{
dst->uncalibrated_gyro.x_uncalib = src.u.uncal.x;
dst->uncalibrated_gyro.y_uncalib = src.u.uncal.y;
diff --git a/sensors/1.0/types.hal b/sensors/1.0/types.hal
index 3527106778..27c9e9c5db 100644
--- a/sensors/1.0/types.hal
+++ b/sensors/1.0/types.hal
@@ -126,7 +126,7 @@ enum SensorType : int32_t {
* reporting-mode: continuous
*
* All values are in SI units (m/s^2) and measure the acceleration of the
- * device minus the force of gravity.
+ * device minus the acceleration due to gravity.
*
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
@@ -697,6 +697,18 @@ enum SensorType : int32_t {
SENSOR_TYPE_LOW_LATENCY_OFFBODY_DETECT = 34,
/*
+ * SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED
+ * reporting-mode: continuous
+ *
+ * All values are in SI units (m/s^2) and measure the acceleration of the
+ * device minus the acceleration due to gravity.
+ *
+ * Implement the non-wake-up version of this sensor and implement the
+ * wake-up version if the system possesses a wake up fifo.
+ */
+ SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED = 35,
+
+ /*
* Base for device manufacturers private sensor types.
* These sensor types can't be exposed in the SDK.
*/
@@ -1059,6 +1071,7 @@ union EventPayload {
/* SENSOR_TYPE_MAGNETIC_FIELD_UNCALIBRATED,
* SENSOR_TYPE_GYROSCOPE_UNCALIBRATED
+ * SENSOR_TYPE_ACCELEROMETER_UNCALIBRATED
*/
Uncal uncal;