Constructors

Link copied to clipboard
constructor(context: Context, stopWhenFilledBuffer: Boolean, staleOffsetNanos: Long, staleDetectionEnabled: Boolean, skipWhenProcessing: Boolean, accuracyChangedListener: SensorMeasurementSyncer.OnAccuracyChangedListener<M, S>?, bufferFilledListener: SensorMeasurementSyncer.OnBufferFilledListener<M, S>?, syncedMeasurementListener: SensorMeasurementSyncer.OnSyncedMeasurementsListener<M, S>?, staleDetectedMeasurementsListener: SensorMeasurementSyncer.OnStaleDetectedMeasurementsListener<M, S>?)

Types

Link copied to clipboard

Interface to notify when sensor accuracy changes.

Link copied to clipboard

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).

Link copied to clipboard

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.

Link copied to clipboard

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

Link copied to clipboard

listener to notify changes in accuracy.

Link copied to clipboard

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.

Link copied to clipboard

Android context.

Link copied to clipboard

Gets most recent timestamp of all measurements processed so far. Timestamp is expressed in nanoseconds by a monotonic clock based on SystemClock.elapsedRealtimeNanos.

Link copied to clipboard

Gets number of processed measurements since this syncer started.

Link copied to clipboard

Gets oldest timestamp in the buffer.

Link copied to clipboard

Indicates whether syncer is processing measurements.

Link copied to clipboard

Indicates whether syncer is running and processing measurements.

Link copied to clipboard

true to skip new measurements while processing a measurement.

Link copied to clipboard

listener to notify when stale measurements are found. This might indicate that buffers are too small and data is not being properly synced.

Link copied to clipboard

true to enable stale measurement detection, false otherwise.

Link copied to clipboard

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.

Link copied to clipboard

Timestamp when collector started expressed as a monotonically increasing timestamp in nanoseconds as indicated by SystemClock.elapsedRealtimeNanos.

Link copied to clipboard

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.

Link copied to clipboard

listener to notify the generation of a new synced measurement.

Functions

Link copied to clipboard
abstract fun start(startTimestamp: Long = SystemClock.elapsedRealtimeNanos()): Boolean

Starts collecting and syncing sensor measurements.

Link copied to clipboard
abstract fun stop()

Stops processing and syncing sensor measurements.