Class: Toybox::Ant::BurstListener

Inherits:
Lang::Object show all

Overview

A class that provides a set of callback methods to handle the different burst transmission scenarios in the Ant SDK.

Examples:

Shows extending BurstListener class

using Toybox.Ant;

// An extension of BurstListener to handle burst events
class MyBurstListener extends Ant.BurstListener {

    // Callback when a burst transmission completes successfully
    function onTransmitComplete() {
        System.println("onTransmitComplete");
    }

    // Callback when a burst transmission fails over the air.
    // Takes an errorCode parameter which is the type of burst
    // failure that occurred.
    function onTransmitFail(errorCode) {
        System.println("onTransmitFail-" + errorCode);
    }

    // Callback when a burst reception fails over the air.
    // Takes an errorCode parameter which is the type of burst
    // failure that occurred.
    function onReceiveFail(errorCode) {
        System.println("onReceiveFail-" + errorCode);
    }

    // Callback when a burst reception completes successfully.
    // Takes a burstPayload parameter which is the burst data
    // received across the channel.
    function onReceiveComplete(burstPayload) {
        System.println("onReceiveComplete");
    }

}

Since:

  • 2.2.0

Instance Method Summary collapse

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Instance Method Details

onReceiveComplete(burstPayload) ⇒ Object

Callback when a burst reception completes successfully

Parameters:

See Also:

Since:

  • 2.2.0


1154
1155
# File 'Monkeybrains.rb', line 1154

def onReceiveComplete(burstPayload)
end

onReceiveFail(errorCode) ⇒ Object

Callback when a burst reception fails over the air

Parameters:

Since:

  • 2.2.0


1162
1163
# File 'Monkeybrains.rb', line 1162

def onReceiveFail(errorCode)
end

onTransmitCompleteObject

Callback when a burst transmission completes successfully

Since:

  • 2.2.0


1167
1168
# File 'Monkeybrains.rb', line 1167

def onTransmitComplete()
end

onTransmitFail(errorCode) ⇒ Object

Callback when a burst transmission fails over the air

Parameters:

Since:

  • 2.2.0


1175
1176
# File 'Monkeybrains.rb', line 1175

def onTransmitFail(errorCode)
end