Class: Toybox.Ant.GenericChannel
- Inherits:
-
Toybox.Lang.Object
Overview
A class for controlling an ANT wireless channel.
The GenericChannel provides the methods necessary for initialization, life cycle, and encryption of ANT channels.
Instance Method Summary collapse
-
close() as Void
Close a generic ANT Channel.
-
disableEncryption() as Void
Disable encryption on this channel.
-
enableEncryption(configuration as Ant.CryptoConfig) as Void
Set the encryption configuration and enable encryption on this channel.
-
getDeviceConfig() as Ant.DeviceConfig
Get the current ANT channel configuration.
-
initialize(listener as Lang.Method(msg as Ant.Message) as Void, channelAssignment as Ant.ChannelAssignment)
Constructor.
-
open() as Lang.Boolean
Open a generic ANT Channel.
-
release() as Void
Release the generic ANT Channel back to the system.
-
sendAcknowledge(data as Ant.Message) as Void
Send an acknowledge message.
-
sendBroadcast(data as Ant.Message) as Void
Send a broadcast message.
- sendBurst(burstData as Ant.BurstPayload) as Void
-
setBurstListener(listener as Ant.BurstListener) as Void
Set the BurstListener for burst events.
-
setDeviceConfig(configuration as Ant.DeviceConfig) as Void
Set the current ANT channel configuration.
Instance Method Details
close() as Void
Close a generic ANT Channel.
disableEncryption() as Void
Disable encryption on this channel.
enableEncryption(configuration as Ant.CryptoConfig) as Void
Set the encryption configuration and enable encryption on this channel.
getDeviceConfig() as Ant.DeviceConfig
Get the current ANT channel configuration.
initialize(listener as Lang.Method(msg as Ant.Message) as Void, channelAssignment as Ant.ChannelAssignment)
Constructor
open() as Lang.Boolean
Open a generic ANT Channel.
Multitasking: Ant channel connection can not be changed while in inacitve mode and ant channels opened during active mode will be closed when app becomes inactive, and re-opened automatically when is active again. These state changes are denoted by calls to AppBase.onActive() and AppBase.onInactive().
release() as Void
Release the generic ANT Channel back to the system.
If the channel is open it will be automatically closed.
sendAcknowledge(data as Ant.Message) as Void
Send an acknowledge message.
You can expect to receive either MSG_CODE_EVENT_TRANSFER_TX_COMPLETED or MSG_CODE_EVENT_TRANSFER_TX_FAILED if the message succeeded/failed going to the recipient.
sendBroadcast(data as Ant.Message) as Void
Send a broadcast message.
sendBurst(burstData as Ant.BurstPayload) as Void
Send an Array of Messages as a burst across the ANT channel.
Success or Fail is received by the BurstListener.
setBurstListener(listener as Ant.BurstListener) as Void
Set the BurstListener for burst events.
Failed bursts or those larger than the specified threshold will be discarded.
setDeviceConfig(configuration as Ant.DeviceConfig) as Void
Set the current ANT channel configuration.