improved comments and added a minDelay attribute to sensor_t

Change-Id: Ie00fe8260089614e15f1f8035b8392711dff048c
This commit is contained in:
Mathias Agopian
2010-07-29 15:33:22 -07:00
parent 1832f55760
commit 1511e20fbb

View File

@@ -321,8 +321,12 @@ struct sensor_t {
float resolution; float resolution;
/* rough estimate of this sensor's power consumption in mA */ /* rough estimate of this sensor's power consumption in mA */
float power; float power;
/* minimum delay allowed between events in microseconds. A value of zero
* means that this sensor doesn't report events at a constant rate, but
* rather only when a new data is available */
int32_t minDelay;
/* reserved fields, must be zero */ /* reserved fields, must be zero */
void* reserved[9]; void* reserved[8];
}; };
@@ -344,7 +348,10 @@ struct sensors_poll_device_t {
int handle, int enabled); int handle, int enabled);
/** /**
* Set the delay between sensor events in nanoseconds for a given sensor * Set the delay between sensor events in nanoseconds for a given sensor.
* It is an error to set a delay inferior to the value defined by
* sensor_t::minDelay. If sensor_t::minDelay is zero, setDelay() is
* ignored and returns 0.
* *
* @return 0 if successful, < 0 on error * @return 0 if successful, < 0 on error
*/ */
@@ -353,8 +360,10 @@ struct sensors_poll_device_t {
/** /**
* Returns an array of sensor data. * Returns an array of sensor data.
* This function must block until events are available.
* *
* @return the number of events read on success, or -errno in case of an error. * @return the number of events read on success, or -errno in case of an error.
* This function should never return 0 (no event).
* *
*/ */
int (*poll)(struct sensors_poll_device_t *dev, int (*poll)(struct sensors_poll_device_t *dev,