OSDN Git Service

GMINL-2659: Keep recent events history for fusion-like processing
[android-x86/hardware-intel-libsensors.git] / common.h
index 48e2124..fd673ac 100644 (file)
--- a/common.h
+++ b/common.h
@@ -101,6 +101,15 @@ struct sample_ops_t
        int (*finalize)(int s, struct sensors_event_t* data);
 };
 
+/*
+ * Whenever we have sensor data recorded for a sensor in the associated
+ * sensor_info cell, its report_pending field is set to a non-zero value
+ * indicating how we got this data.
+ */
+#define DATA_TRIGGER   1       /* From /dev/iio:device fd              */
+#define DATA_SYSFS     2       /* Through polling                      */
+#define DATA_DUPLICATE 3       /* Duplicate of triggered motion sample */
+
 struct sensor_info_t
 {
        char friendly_name[MAX_NAME_SIZE];      /* ex: Accelerometer         */
@@ -149,7 +158,8 @@ struct sensor_info_t
        /*
         * This flag is set if we acquired data from the sensor but did not
         * forward it to upper layers (i.e. Android) yet. If so, report_buffer
-        * contains that data.
+        * contains that data. Valid values are 0: empty, 1: normal, 2: repeat
+        * of last acquired value after timeout.
         */
        int report_pending;