Class: Toybox.Sensor.SensorInfoIterator

Overview

A class encapsulating a collection of Sensors

The SensorIterator describes a collection of SensorInfo objects that describe actual sensors. Such an iterator is retrieved using the appropriate "get*Sensors' methods found in Sensor at the module level.

Example:

Gets a SensorIterator object for all registered external heart rate sensors on the device

using Toybox.Sensor;

function getHeartRateSensorIterator() {
    if (Sensor has :getRegisteredSensors) {
        return Sensor.getRegisteredSensors(Sensor.SENSOR_HEARTRATE);
    }
    return null;
}

Since:

API Level 3.2.0

Instance Method Summary collapse

Instance Method Details

next() as Sensor.SensorInfo or Null

Get the current SensorInfo and advance.

Get the current SensorInfo and advance self to refer to the next.

Returns:

Since:

API Level 3.2.0


Generated Dec 11, 2024, 8:58:43 AM