Class: Toybox.Ant.BurstPayloadIterator

Overview

An iterator to use with a BurstPayload.

The BurstPayloadIterator is used to iterate over the BurstPayload and and access each data packet.

Example:

using Toybox.Ant;
// Iterates over a burst payload to print each packet.
// Takes a valid BurstPayload Object as a parameter which
// contains the burst data to display.
function printPayload(burstPayload) {
    var iterator = new Ant.BurstPayloadIterator(burstPayload);
    var payload = iterator.next();
    while (null != payload) {
        System.println("payload " + payload);
        payload = iterator.next();
    }
}

Since:

API Level 2.2.0

Instance Method Summary collapse

Instance Method Details

initialize(newBurstPayload as Ant.BurstPayload)

Constructor

Parameters:

Since:

API Level 2.2.0

next() as Lang.Array<Lang.Number> or Null

Return the next message in the BurstPayload object.

Returns:

  • Lang.Array

    The Array of integers representing the bytes of the BurstPayload, or null if one does not exist.

Since:

API Level 2.2.0


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