Class: Toybox.Ant.BurstListener

Overview

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

Example:

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() as Void {
        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 as BurstError) as Void {
        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 as BurstError) as Void {
        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 as BurstPayload) as Void {
        System.println("onReceiveComplete");
    }

}

Since:

API Level 2.2.0

Instance Method Summary collapse

Instance Method Details

onReceiveComplete(burstPayload as Ant.BurstPayload) as Void

Callback when a burst reception completes successfully

Parameters:

See Also:

Since:

API Level 2.2.0

onReceiveFail(errorCode as Ant.BurstError) as Void

Callback when a burst reception fails over the air

Parameters:

Since:

API Level 2.2.0

onTransmitComplete() as Void

Callback when a burst transmission completes successfully

Since:

API Level 2.2.0

onTransmitFail(errorCode as Ant.BurstError) as Void

Callback when a burst transmission fails over the air

Parameters:

Since:

API Level 2.2.0


Generated Sep 23, 2024, 3:32:48 PM