Module: Toybox.Ant

Overview

This module provide the interface for the ANT wireless protocol.

The ANT wireless protocol is a low level communications protocol that provides very efficient transfer of data by directly controlling the radio on the device. The ANT module provides a list of constants to be used with different Class objects and Methods provided within the module. These include:

  • MSG_ID_* Constants - Message IDs

  • MSG_CODE_* Constants - Message Codes for the response event

  • NETWORK_* Constants - Network Types

  • CHANNEL_TYPE_* Constants - Channel Types

  • BURST_ERROR_* Constants - Burst Error types

ANT resources and documentation can be found at the links below.

See Also:

Since:

API Level 1.0.0

App Types:

  • Watch App

  • Audio Content Provider

  • Background

  • Data Field

  • Widget

Supported Devices:

Requires Permission:

  • Ant

Classes Under Namespace

Classes: BurstListener, BurstPayload, BurstPayloadIterator, ChannelAssignment, CryptoConfig, DeviceConfig, EncryptionInvalidSettingsException, GenericChannel, Message, UnableToAcquireChannelException, UnableToAcquireEncryptedChannelException

Constant Summary

MessageId

Since:

API Level 1.0.0

Name Value Since Description See Also
MSG_ID_RF_EVENT 0x01

API Level 1.0.0

MSG_ID_UNASSIGN_CHANNEL 0x41

API Level 1.0.0

MSG_ID_ASSIGN_CHANNEL 0x42

API Level 1.0.0

MSG_ID_CHANNEL_ID 0x51

API Level 1.0.0

MSG_ID_CHANNEL_PERIOD 0x43

API Level 1.0.0

MSG_ID_SEARCH_TIMEOUT 0x44

API Level 1.0.0

MSG_ID_CHANNEL_RF_FREQUENCY 0x45

API Level 1.0.0

MSG_ID_NETWORK_KEY 0x46

API Level 1.0.0

MSG_ID_TRANSMIT_POWER 0x47

API Level 1.0.0

MSG_ID_CHANNEL_TRANSMIT_POWER 0x60

API Level 1.0.0

MSG_ID_LOW_PRIORITY_SEARCH_TIMEOUT 0x63

API Level 1.0.0

MSG_ID_LIB_CONFIG 0x6E

API Level 1.0.0

MSG_ID_PROXIMITY_SEARCH 0x71

API Level 1.0.0

MSG_ID_RESET_SYSTEM 0x4A

API Level 1.0.0

MSG_ID_OPEN_CHANNEL 0x4B

API Level 1.0.0

MSG_ID_CLOSE_CHANNEL 0x4C

API Level 1.0.0

MSG_ID_BROADCAST_DATA 0x4E

API Level 1.0.0

MSG_ID_ACKNOWLEDGED_DATA 0x4F

API Level 1.0.0

MSG_ID_CHANNEL_RESPONSE_EVENT 0x40

API Level 1.0.0

MessageCode

Since:

API Level 1.0.0

Name Value Since Description See Also
MSG_CODE_RESPONSE_NO_ERROR 0x00

API Level 1.0.0

MSG_CODE_EVENT_RX_SEARCH_TIMEOUT 0x01

API Level 1.0.0

MSG_CODE_EVENT_RX_FAIL 0x02

API Level 1.0.0

MSG_CODE_EVENT_TX 0x03

API Level 1.0.0

MSG_CODE_EVENT_TRANSFER_RX_FAILED 0x04

API Level 1.0.0

MSG_CODE_EVENT_TRANSFER_TX_COMPLETED 0x05

API Level 1.0.0

MSG_CODE_EVENT_TRANSFER_TX_FAILED 0x06

API Level 1.0.0

MSG_CODE_EVENT_CHANNEL_CLOSED 0x07

API Level 1.0.0

MSG_CODE_EVENT_RX_FAIL_GO_TO_SEARCH 0x08

API Level 1.0.0

MSG_CODE_CHANNEL_IN_WRONG_STATE 0x15

API Level 1.0.0

MSG_CODE_CHANNEL_ID_NOT_SET 0x18

API Level 1.0.0

MSG_CODE_TRANSFER_IN_PROGRESS 0x1F

API Level 1.0.0

MSG_CODE_INVALID_MESSAGE 0x28

API Level 1.0.0

MSG_CODE_EVENT_QUE_OVERFLOW 0x35

API Level 1.0.0

MSG_CODE_EVENT_CRYPTO_NEGOTIATION_SUCCESS 0x38

API Level 2.3.0

MSG_CODE_EVENT_CRYPTO_NEGOTIATION_FAIL 0x39

API Level 2.3.0

NetworkType

Since:

API Level 1.0.0

Name Value Since Description See Also
NETWORK_PUBLIC 0

API Level 1.0.0

NETWORK_PLUS 1

API Level 1.0.0

NETWORK_PRIVATE 2

API Level 1.2.0

ChannelType

Since:

API Level 1.0.0

Name Value Since Description See Also
CHANNEL_TYPE_TX_NOT_RX 0x10

API Level 1.0.0

Bidirectional Transmit (Master)

CHANNEL_TYPE_RX_NOT_TX 0x00

API Level 1.0.0

Bidirectional Receive (Slave)

CHANNEL_TYPE_RX_ONLY 0x40

API Level 1.2.0

Receive Only (Slave)

CHANNEL_TYPE_SHARED_BIDIRECTIONAL_RECEIVE 0x20

API Level 3.1.0

Shared Bidirectional Receive (Slave)

CHANNEL_TYPE_SHARED_BIDIRECTIONAL_TRANSMIT 0x30

API Level 3.1.0

Shared Bidirectional Transmit (Master)

BurstError

Error codes passed to the failure functions in the BurstListener

Since:

API Level 1.0.0

Name Value Since Description See Also
BURST_ERROR_OUT_OF_MEMORY 0

API Level 2.2.0

There was not enough memory available to send/receive a burst message

BURST_ERROR_SEQUENCE_NUMBER_FAIL 1

API Level 2.2.0

A burst packet was received out of order and the entire message was dropped

BURST_ERROR_RF_FAIL 2

API Level 2.2.0

A burst failed over the air

BURST_ERROR_TRANSFER_IN_PROGRESS 3

API Level 2.2.0

Burst was blocked by another burst from the native system code


Generated Apr 17, 2024 9:40:36 AM