Buffered Gyroscope Sensor Collector
Manages and collects gyroscope sensor measurements using a buffer. A buffered collector allows proper synchronization of events from multiple collectors by colling getMeasurementsBeforeTimestamp periodically to obtain measurements in the buffer prior to a certain timestamp.
Throws
if provided capacity is zero or negative.
Constructors
Properties
listener to notify changes in accuracy.
Gets a copy of the buffer containing ordered measurements by ascending timestamp.
listener to notify that buffer has been filled. This usually happens when consumer of measurements cannot keep up with the rate at which measurements are generated.
listener to notify new measurements. It must be noticed that measurements notification might be delayed.
Gets most recent timestamp of all measurements processed so far. Timestamp is expressed in nanoseconds by a monotonic clock based on SystemClock.elapsedRealtimeNanos.
Gets number of processed measurements since this collector started.
Gets oldest timestamp within buffered measurements, if any is available. Timestamp is expressed in nanoseconds by a monotonic clock based on SystemClock.elapsedRealtimeNanos.
Indicates whether collector is processing a measurement.
Indicates whether requested sensor is available or not.
Delay of sensor between samples.
One of the supported gyroscope sensor types.
true to skip new measurements when processing a measurement.
Initial offset expressed in nano seconds between first received measurement timestamp and start time expressed in the monotonically increasing system clock obtained by SystemClock.elapsedRealtimeNanos.
indicates whether startOffset will be computed when first measurement is received or not. True indicates that offset is computed, false assumes that offset is null.
Timestamp when collector started expressed as a monotonically increasing timestamp in nanoseconds as indicated by SystemClock.elapsedRealtimeNanos.
true to stop collector when buffer completely fills, false to continue collection at the expense of loosing old data. This will be notified using bufferFilledListener.
Gets current usage of this collector as a value between 0.0 and 1.0. 0.0 indicates that buffer is empty and no measurement has yet been received. 1.0 indicates that buffer is full and getMeasurementsBeforeTimestamp or getMeasurementsBeforePosition must be called to release some measurements from buffer or otherwise collector will stop or old measurements will be lost.
Functions
Method to be called periodically to remove from buffer measurements matching requested buffer position. Failing to call this method or getMeasurementsBeforeTimestamp with required frequency, will result in a full buffer, which will be notified and stop this sensor collector or lead to loss of oldest measurements. Notice that returned list and measurements will be reused for memory efficiency purposes.
Method to be called periodically to remove from buffer measurements matching requested timestamp. Failing to call this method or getMeasurementsBeforePosition with required frequency, will result in a full buffer, which will be notified and stop this sensor collector or lead to loss of oldest measurements. Notice that returned list and measurements will be reused for memory efficiency purposes.