Class: Toybox.AntPlus.DeviceState

Overview

The DeviceState object represents the state of the device.

Fields may return null so you should null check values before using them.

Example:

using Toybox.AntPlus;

// Assumes AntPlus.Device.getDeviceState(); already called
var state = deviceState.state;
var deviceNumber = deviceState.deviceNumber;

System.println("Current device state is: " + state);
System.println("Current device number is: " + deviceNumber);

Since:

API Level 2.2.0

Supported Devices:

Instance Member Summary collapse

Instance Attribute Details

var deviceNumber as Lang.Number or Null

The current Device ID being tracked/searched for.

Since:

API Level 2.2.0

Returns:

  • Lang.Number

    The device ID number or null if device state is DEVICE_STATE_DEAD

var state as AntPlus.DeviceCurrentState or Null

The state of the device as an DEVICE_STATE_* value.

Since:

API Level 2.2.0

Returns:

  • Lang.Number

    The device state as DEVICE_STATE_* enum value


Generated Apr 17, 2024 9:40:40 AM