Sensor Measurement Syncer
Syncs measurements collected from multiple sensors. Collected measurements are buffered to ensure they can be synced, if any measurement arrives out of order, it is notified by this class.
Inheritors
Constructors
Types
Interface to notify when sensor accuracy changes.
Interface to notify when a buffer gets completely filled. When a buffer completely fills, internal collectors will stop if stopWhenFilledBuffer is true. If stopWhenFilledBuffer is false, internal collectors will continue collection at the expense of loosing old data. Consumers of this listener should decide what to do at this point (which might require stopping this syncer).
Interface to notify when stale measurements were in the buffer but could not be synced against other measurements after elapsing a certain amount of time.
Interface to notify when a nw synced measurement is available. Measurements notified by this listener are guaranteed to be ordered and synced. Notice that notified measurement i reused for memory efficiency.
Properties
listener to notify changes in accuracy.
listener to notify that some buffer has been filled. This usually happens when consumer of measurements cannot keep up with the rate at which measurements are generated.
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 syncer started.
Gets oldest timestamp in the buffer.
Indicates whether syncer is processing measurements.
true to skip new measurements while processing a measurement.
listener to notify when stale measurements are found. This might indicate that buffers are too small and data is not being properly synced.
true to enable stale measurement detection, false otherwise.
offset respect most recent received timestamp of a measurement to consider the measurement as stale so that it is skipped from synced measurement processing and returned back from buffer to cache of measurements.
Timestamp when collector started expressed as a monotonically increasing timestamp in nanoseconds as indicated by SystemClock.elapsedRealtimeNanos.
true to stop syncer when any buffer completely fills, false to continue processing measurements at the expense of loosing old data. This will be notified using bufferFilledListener.
listener to notify the generation of a new synced measurement.