Class: Toybox.Ant.DeviceConfig

Inherits:
Toybox.Lang.Object show all

Overview

A class to define the ANT wireless channel device configuration.

See Also:

Example:

// Set the configuration
deviceCfg = new Ant.DeviceConfig({
    :deviceNumber => 0,                 // Wild card our search
    :deviceType => 31,                  // 1 byte type identifier
    :transmissionType => 0,             // Manufacturer-specific transport type
    :messagePeriod => 8192,             // The message period
    :radioFrequency => 57,              // Ant+ Frequency
    :searchTimeoutLowPriority => 10,    // Timeout in 25s
    :searchThreshold => 0               // Pair to all transmitting sensors
});
genericChannel.setDeviceConfig(deviceCfg);

Since:

API Level 1.0.0

Constant Summary

Constant Variables

Type Name Value Since Description
Type DEFAULT_DEVICE_NUMBER 123

API Level 1.0.0

The default values for a device configuration

Type DEFAULT_DEVICE_TYPE 1

API Level 1.0.0

Type DEFAULT_MESSAGE_PERIOD 8192

API Level 1.0.0

Type DEFAULT_NETWORK_KEY 0

API Level 1.2.0

Type DEFAULT_RADIO_FREQUENCY 10

API Level 1.0.0

Type DEFAULT_SEARCH_TIMEOUT_HIGH 0

API Level 1.0.0

Type DEFAULT_SEARCH_TIMEOUT_LOW 6

API Level 1.0.0

Type DEFAULT_THRESHOLD 0

API Level 1.0.0

Type DEFAULT_TRANSMISSION_TYPE 0

API Level 1.0.0

Type NETWORK_KEY_LENGTH_128BIT 16

API Level 1.2.0

Type NETWORK_KEY_LENGTH_64BIT 8

API Level 1.2.0

Network key lengths

Typedef Summary collapse

Instance Member Summary collapse

Instance Method Summary collapse

Instance Attribute Details

var deviceNumber as Lang.Number

The unique device number (ANT-id)

Since:

API Level 1.0.0

var deviceType as Lang.Number

A 1-Byte device type identifier

Since:

API Level 1.0.0

var messagePeriod as Lang.Number

The Message period that the sensor uses

Since:

API Level 1.0.0

var networkKey128Bit as DeviceConfig.NetworkKey128Bit or Null

A 128 bit network key

Since:

API Level 1.2.0

var networkKey64Bit as DeviceConfig.NetworkKey64Bit or Null

A 64 bit network key

Since:

API Level 1.2.0

var radioFrequency as Lang.Number

The radio frequency that the sensor operates on

Since:

API Level 1.0.0

var searchThreshold as Lang.Number

The proximity threshold bin

Since:

API Level 1.0.0

var searchTimeoutHighPriority as Lang.Number

High Priority search timeout that a receiving channel will wait for in order to start tracking a master

  • Measured in 2.5s increments

  • Limited to a maximum of 5 seconds (Range of 0 to 2)

Since:

API Level 1.0.0

var searchTimeoutLowPriority as Lang.Number

The low Priority search timeout that a receiving channel will wait for in order to start tracking a master

  • Measured in 2.5s increments

  • Limited to a maximum of 30 seconds (Range of 0 to 12)

Since:

API Level 1.0.0

var transmissionType as Lang.Number

The manufacturer-specific transport type and extended device number

Since:

API Level 1.0.0

Instance Method Details

initialize(options as { :deviceNumber as Lang.Number, :deviceType as Lang.Number, :transmissionType as Lang.Number, :messagePeriod as Lang.Number, :radioFrequency as Lang.Number, :searchTimeoutLowPriority as Lang.Number, :searchTimeoutHighPriority as Lang.Number, :searchThreshold as Lang.Number, :networkKey64Bit as DeviceConfig.NetworkKey64Bit, :networkKey128Bit as DeviceConfig.NetworkKey128Bit })

Constructor

Parameters:

  • options(Lang.Dictionary)

    The initialization options

    • :deviceNumber(Lang.Number)

      The ANT-id of the device to search for. Not setting enables a wild card search

    • :deviceType(Lang.Number)

      1-Byte device type identifier

    • :transmissionType(Lang.Number)

      The manufacturer-specific transport type and extended device number

    • :messagePeriod(Lang.Number)

      The message period that the sensor uses

    • :radioFrequency(Lang.Number)

      The radio frequency that the sensor operates on. Range of 2 to 80.

    • :searchTimeoutLowPriority(Lang.Number)

      The Low Priority search timeout that a receiving channel will wait for in order to start tracking a master

      • Low Priority search provides the capability of searching for a master without interrupting other channels on the device

      • Range of 0 to 12 (2.5s increments)

      • Default 6 (15s)

    • :searchTimeoutHighPriority(Lang.Number)

      The High Priority search timeout that a receiving channel will wait for in order to start tracking a master

      • Is triggered after the Low Priority search mode times out

      • Will interrupt other channels

      • Will take priority over any other open channels on that device

      • If it overlaps another channel the High Priority search takes priority and that other channel is blocked

      • Keeping this search type disabled unless you have great difficulty acquiring a master through Low Priority search is recommended

      • High Priority searches are disabled in data-fields, and will be ignored for that application type

      • Range of 0 to 2 (2.5s increments)

      • Default 0 (disabled)

    • :searchThreshold(Lang.Number)

      A proximity threshold bin as a Number

      • Configures the RSSI threshold a slave channel will search for which is effectively the distance at which a slave is willing to be from a master

      • Values are 0 (disabled), 1 (closest), 10 (farthest)

    • :networkKey64Bit(Lang.Number)

      64 bit network key

    • :networkKey128Bit(Lang.Number)

      128 bit network key

      • Set this when NETWORK_PRIVATE was chosen in the channel assignment

See Also:

Since:

API Level 1.2.0


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