X-Git-Url: http://git.osdn.net/view?p=android-x86%2Fhardware-intel-libsensors.git;a=blobdiff_plain;f=common.h;h=fd673ac62e09ac1e34ff4fbe155cee6a395e5bfa;hp=48e21243f5e00a1c3ecdc28a692501711494ae6b;hb=f4cb7dc91324cc194d1503743027e8937cd712e8;hpb=7c24cdccf64b4fa47e29841f6d72d8b73d60fa7b diff --git a/common.h b/common.h index 48e2124..fd673ac 100644 --- 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;