Class: Toybox::Ant::BurstPayloadIterator

Inherits:
Lang::Object show all

Overview

An iterator to use with a BurstPayload.

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

Examples:

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:

  • 2.2.0

Instance Method Summary collapse

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Constructor Details

initialize(newBurstPayload) ⇒ BurstPayloadIterator

Constructor for the BurstPayloadIterator object

Since:

  • 2.2.0


1089
1090
# File 'Monkeybrains.rb', line 1089

def initialize(newBurstPayload)
end

Instance Method Details

nextToybox::Lang::Array

Return the next message in the BurstPayload object.

Returns:

Since:

  • 2.2.0


1098
1099
# File 'Monkeybrains.rb', line 1098

def next()
end