Protocol

MWPollable

Sensors natively incapable of continuous output, such as thermistors, can output “streamable” and loggable outputs with the help of onboard timers that fire at reasonable intervals. This protocol organizes the methods and properties for polling such sensors.

Declaration

protocol MWPollable : MWReadable

Overview

To start polling, use the .stream() or .log() operators. These are available on a Publisher whose output is a MetaWear, including:

These operators accept MWPollable instances constructed by autocompletion, such as humidity(oversampling:rate:), or directly, such as init(oversampling:rate:).

Direct construction may be useful for patterns where you persist user selected settings or organize arbitrarily large logging or streaming sessions. Our open-source MetaBase 5 app provides an example in ActionVM.swift of starting logging and streaming sessions with arbitrary mixes of MWPollable, MWStreamable, and MWLoggable sensors with merged outputs.

Unless you construct your own sensor wrappers, this protocol’s details are unlikely to be important to you.

Topics

Instance Properties

Instance Methods

Relationships

Inherits From

Conforming Types

See Also

Interact