summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUrs Fleisch <urs.fleisch@gmail.com>2010-12-29 17:00:33 +0100
committerJean-Baptiste Queru <jbq@google.com>2011-04-12 17:25:57 -0700
commitd2ed15a6b81a9a2fd95c1a565f72796869545115 (patch)
treee2d57950f4bb99ce79fff891aaeb96f3c10746ea
parent3629275560f4a952cedd69c76b7b96b3b490f6f6 (diff)
downloadlibhardware-d2ed15a6b81a9a2fd95c1a565f72796869545115.tar.gz
support humidity sensor type
Change-Id: I7600d64ea28d2eefc20104cbf81270ddad9d57c0
-rw-r--r--include/hardware/sensors.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h
index 7f9706b9..297d31a7 100644
--- a/include/hardware/sensors.h
+++ b/include/hardware/sensors.h
@@ -61,6 +61,7 @@ __BEGIN_DECLS
#define SENSOR_TYPE_GRAVITY 9
#define SENSOR_TYPE_LINEAR_ACCELERATION 10
#define SENSOR_TYPE_ROTATION_VECTOR 11
+#define SENSOR_TYPE_RELATIVE_HUMIDITY 12
/**
* Values returned by the accelerometer in various locations in the universe.
@@ -267,6 +268,14 @@ __BEGIN_DECLS
* sensors_event_t.data[2] = z*sin(theta/2)
* sensors_event_t.data[3] = cos(theta/2)
*
+ * Relative Humidity
+ * -----------------
+ *
+ * A relative humidity sensor measures relative ambient air humidity and
+ * returns a value in percent.
+ *
+ * Relative humidity sensors report a value only when it changes and each
+ * time the sensor is enabled. setDelay() is ignored.
*/
typedef struct {
@@ -333,6 +342,9 @@ typedef struct sensors_event_t {
/* pressure in hectopascal (hPa) */
float pressure;
+
+ /* relative humidity in percent */
+ float relative_humidity;
};
uint32_t reserved1[4];
} sensors_event_t;