Class: Toybox::Ant::BurstPayload

Inherits:
Lang::Object show all

Overview

A class containing Burst payload data.

The payload data is provided in the form of Ant.Message objects. The default max size of a BurstPayload is 8192 bytes, or 1024 Message objects. However, this can vary by device.

Examples:

using Toybox.Ant;
var burst = Ant.BurstPayload();

burst.initialize();     // Initialize the payload
burst.add(message);     // Add a message to payload
burst.getSize();        // The number of messages

Since:

  • 2.2.0

Instance Method Summary collapse

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Constructor Details

initializeBurstPayload

Constructor for the BurstPayload object

Since:

  • 2.2.0


1072
1073
# File 'Monkeybrains.rb', line 1072

def initialize()
end

Instance Method Details

add(message) ⇒ Object

Add a Message object to the end of the burst data.

Parameters:

  • message (Toybox::Lang::Array)

    An Array of integers representing the bytes of the data payload

Since:

  • 2.2.0


1060
1061
# File 'Monkeybrains.rb', line 1060

def add(message)
end

getSizeToybox::Lang::Number

Return the number of burst Message objects contained in the payload.

Returns:

Since:

  • 2.2.0


1067
1068
# File 'Monkeybrains.rb', line 1067

def getSize()
end