diff options
author | Aravind Akella <aakella@google.com> | 2014-09-04 15:36:31 -0700 |
---|---|---|
committer | Aravind Akella <aakella@google.com> | 2014-09-05 14:50:07 -0700 |
commit | 110d2f2713490c8c8ae5ce3d66ac7364eb2002a4 (patch) | |
tree | 09fa7dca7f5ed5d6a19681a759e429ea5cbd8c5e /include | |
parent | 02516c78f372f4ad2b5aef63794f5c08ababbf6b (diff) | |
download | hardware_libhardware-110d2f2713490c8c8ae5ce3d66ac7364eb2002a4.zip hardware_libhardware-110d2f2713490c8c8ae5ce3d66ac7364eb2002a4.tar.gz hardware_libhardware-110d2f2713490c8c8ae5ce3d66ac7364eb2002a4.tar.bz2 |
sensors.h documentation change.
i) on-change sensors should set maxDelay.
ii) Drivers should hold a wake_lock till poll() is called
the next time when delivering events from wake-up sensors.
Change-Id: I4b137843d5c857f04601618548306a710fbfbe5c
Diffstat (limited to 'include')
-rw-r--r-- | include/hardware/sensors.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/include/hardware/sensors.h b/include/hardware/sensors.h index a44c155..f0773d5 100644 --- a/include/hardware/sensors.h +++ b/include/hardware/sensors.h @@ -98,7 +98,12 @@ enum { */ enum { /* - * Whether this sensor wakes up the AP from suspend mode when data is available. + * Whether this sensor wakes up the AP from suspend mode when data is available. Whenever + * sensor events are delivered from a wake_up sensor, the driver needs to hold a wake_lock till + * the events are read by the SensorService i.e till sensors_poll_device_t.poll() is called the + * next time. Once poll is called again it means events have been read by the SensorService, the + * driver can safely release the wake_lock. SensorService will continue to hold a wake_lock till + * the app actually reads the events. */ SENSOR_FLAG_WAKE_UP = 1U << 0, /* @@ -863,15 +868,15 @@ struct sensor_t { */ const char* requiredPermission; - /* This value is defined only for continuous mode sensors. It is the delay between two - * sensor events corresponding to the lowest frequency that this sensor supports. When - * lower frequencies are requested through batch()/setDelay() the events will be generated - * at this frequency instead. It can be used by the framework or applications to estimate - * when the batch FIFO may be full. + /* This value is defined only for continuous mode and on-change sensors. It is the delay between + * two sensor events corresponding to the lowest frequency that this sensor supports. When lower + * frequencies are requested through batch()/setDelay() the events will be generated at this + * frequency instead. It can be used by the framework or applications to estimate when the batch + * FIFO may be full. * * NOTE: 1) period_ns is in nanoseconds where as maxDelay/minDelay are in microseconds. - * continuous: maximum sampling period allowed in microseconds. - * on-change, one-shot, special : 0 + * continuous, on-change: maximum sampling period allowed in microseconds. + * one-shot, special : 0 * 2) maxDelay should always fit within a 32 bit signed integer. It is declared as 64 bit * on 64 bit architectures only for binary compatibility reasons. * Availability: SENSORS_DEVICE_API_VERSION_1_3 |