Module: Toybox.AntPlus

Overview

The AntPlus module contains the interface for ANT+ data.

ANT+ is built on top of ANT. It is a set of mutually agreed upon device profiles for what the information sent over ANT represents. For example, a heart rate monitor will send information about your heart rate over ANT as defined in the ANT+ Heart Rate Device Profile. CIQ devices can use the ANT Module to implement ANT+ device profiles and talk to nearby devices that also implement the same ANT+ device profile (such as heart rate, bike power and fitness equipment control). The AntPlus Module provides the APIs to communicate in specific and standard ways with the ANT+ profiles defined in the document available at the link below titled, "ANT+ Device Profiles".

See Also:

Since:

API Level 2.2.0

Supported Devices:

Classes Under Namespace

Classes: AntPlusNotAllowedException, BatteryStatus, BikeCadence, BikeCadenceInfo, BikeCadenceListener, BikeLight, BikePower, BikePowerListener, BikeRadar, BikeRadarListener, BikeSpeed, BikeSpeedCadence, BikeSpeedCadenceInfo, BikeSpeedCadenceListener, BikeSpeedInfo, BikeSpeedListener, CalculatedCadence, CalculatedPower, CalculatedWheelDistance, CalculatedWheelSpeed, CommonData, DerailleurStatus, Device, DeviceListener, DeviceState, FitnessEquipment, FitnessEquipmentData, FitnessEquipmentListener, FitnessEquipmentMode, LightNetwork, LightNetworkListener, ManufacturerInfo, PedalPowerBalance, ProductInfo, RadarTarget, ResistanceSettings, RunningDynamics, RunningDynamicsData, RunningDynamicsListener, SensorPosition, Shifting, ShiftingListener, ShiftingStatus, SimulationSettings, TargetPowerSettings, TorqueEffectivenessPedalSmoothness, UserSettings

Constant Summary

Constant Variables

Type Name Value Since Description
Type FRONT_GEAR_INVALID 7

API Level 3.1.0

Invalid front gear index

Type INVALID_CADENCE -1

API Level 3.0.0

Type INVALID_SPEED -1

API Level 3.0.0

Represents an invalid speed value

Type MAX_GEARS_INVALID 0

API Level 3.1.0

Invalid max gears value

Type REAR_GEAR_INVALID 31

API Level 3.1.0

Invalid rear gear index

BatteryStatusValue

Since:

API Level 2.2.0

Name Value Since Description See Also
BATT_STATUS_NEW 1

API Level 2.2.0

BATT_STATUS_GOOD 2

API Level 2.2.0

BATT_STATUS_OK 3

API Level 2.2.0

BATT_STATUS_LOW 4

API Level 2.2.0

BATT_STATUS_CRITICAL 5

API Level 2.2.0

BATT_STATUS_INVALID 7

API Level 2.2.0

BATT_STATUS_CNT 8

API Level 2.2.0

MessageSendStatus

Since:

API Level 2.2.0

Name Value Since Description See Also
MESSAGE_SENT_SUCCESS 0

API Level 3.1.0

Message sent successfully

MESSAGE_SENT_FAILED 1

API Level 3.1.0

Message sent failed

MESSAGE_SENT_COUNT 2

API Level 3.1.0

MessageType

Since:

API Level 2.2.0

Name Value Since Description See Also
MESSAGE_TYPE_MANUFACTURER 0

API Level 3.1.0

Manufacturer specific message sent

MESSAGE_TYPE_PAGE_REQUEST 1

API Level 3.1.0

Page request sent

MESSAGE_TYPE_COUNT 2

API Level 3.1.0

DeviceCurrentState

Since:

API Level 2.2.0

Name Value Since Description See Also
DEVICE_STATE_DEAD 0

API Level 2.2.0

Device is not usable (not paired or disabled)

DEVICE_STATE_CLOSED 1

API Level 2.2.0

Device's channel is closed

DEVICE_STATE_SEARCHING 2

API Level 2.2.0

Device's channel is open and searching

DEVICE_STATE_TRACKING 3

API Level 2.2.0

Device's channel is open and tracking

DEVICE_STATE_CNT 4

API Level 2.2.0

LightNetworkState

Since:

API Level 2.2.0

Name Value Since Description See Also
LIGHT_NETWORK_STATE_NOT_FORMED 0

API Level 2.2.0

Light network is not yet formed

LIGHT_NETWORK_STATE_FORMING 1

API Level 2.2.0

Light network is forming

LIGHT_NETWORK_STATE_FORMED 2

API Level 2.2.0

Light network is formed

LightNetworkMode

Since:

API Level 2.2.0

Name Value Since Description See Also
LIGHT_NETWORK_MODE_INDIVIDUAL 0

API Level 2.2.0

Light modes are set by the user

LIGHT_NETWORK_MODE_AUTO 1

API Level 2.2.0

Light modes are automatically set based on ambient light (or time of day if there is no ambient light sensor available)

LIGHT_NETWORK_MODE_HIGH_VIS 2

API Level 2.2.0

Light modes are automatically placed in their highest-visibility mode

LightMode

Since:

API Level 2.2.0

Name Value Since Description See Also
LIGHT_MODE_OFF 0

API Level 2.2.0

LIGHT_MODE_ST_81_100 1

API Level 2.2.0

Steady beam 81-100% intensity

LIGHT_MODE_ST_61_80 2

API Level 2.2.0

Steady beam 61-80% intensity

LIGHT_MODE_ST_41_60 3

API Level 2.2.0

Steady beam 41-60% intensity

LIGHT_MODE_ST_21_40 4

API Level 2.2.0

Steady beam 21-40% intensity

LIGHT_MODE_ST_0_20 5

API Level 2.2.0

Steady beam 0-20% intensity

LIGHT_MODE_SLOW_FLASH 6

API Level 2.2.0

Slow flash mode

LIGHT_MODE_FAST_FLASH 7

API Level 2.2.0

Fast flash mode

LIGHT_MODE_RANDOM_FLASH 8

API Level 2.2.0

Randomly timed flash mode

LIGHT_MODE_AUTO 9

API Level 2.2.0

LIGHT_MODE_SIGNAL_LEFT_SC 10

API Level 2.2.0

Turn signal left self-cancelling

LIGHT_MODE_SIGNAL_LEFT 11

API Level 2.2.0

Turn signal left

LIGHT_MODE_SIGNAL_RIGHT_SC 12

API Level 2.2.0

Turn signal right self-cancelling

LIGHT_MODE_SIGNAL_RIGHT 13

API Level 2.2.0

Turn signal right

LIGHT_MODE_HAZARD 14

API Level 2.2.0

Hazard - right and left signals flash

LIGHT_MODE_CUSTOM_5 59

API Level 2.2.0

Custom mode (manufacturer-defined)

LIGHT_MODE_CUSTOM_4 60

API Level 2.2.0

Custom mode (manufacturer-defined)

LIGHT_MODE_CUSTOM_3 61

API Level 2.2.0

Custom mode (manufacturer-defined)

LIGHT_MODE_CUSTOM_2 62

API Level 2.2.0

Custom mode (manufacturer-defined)

LIGHT_MODE_CUSTOM_1 63

API Level 2.2.0

Custom mode (manufacturer-defined)

LightType

Since:

API Level 2.2.0

Name Value Since Description See Also
LIGHT_TYPE_HEADLIGHT 0

API Level 2.2.0

Headlight light type

LIGHT_TYPE_TAILLIGHT 2

API Level 2.2.0

Taillight light type

LIGHT_TYPE_SIGNAL_CONFIG 3

API Level 2.2.0

Configurable signal light type

LIGHT_TYPE_SIGNAL_LEFT 4

API Level 2.2.0

Left turn signal light type

LIGHT_TYPE_SIGNAL_RIGHT 5

API Level 2.2.0

Right turn signal light type

LIGHT_TYPE_OTHER 7

API Level 2.2.0

Undefined light type

BikePowerSensorType

Since:

API Level 2.2.0

Name Value Since Description See Also
BIKE_POWER_SENSOR_TYPE_NONE 0

API Level 2.2.0

None

BIKE_POWER_SENSOR_TYPE_POWER_ONLY 1

API Level 2.2.0

Power output directly in Watts

BIKE_POWER_SENSOR_TYPE_WHEEL_TORQUE 2

API Level 2.2.0

Power output from torque on rear wheel

BIKE_POWER_SENSOR_TYPE_CRANK_TORQUE 3

API Level 2.2.0

Power output from torque at crank

BIKE_POWER_SENSOR_TYPE_CRANK_TORQUE_FREQUENCY 4

API Level 2.2.0

Power output from torque frequency at crank

BIKE_POWER_SENSOR_TYPE_CNT 5

API Level 2.2.0

ThreatLevel

Since:

API Level 2.2.0

Name Value Since Description See Also
THREAT_LEVEL_NO_THREAT 0

API Level 3.0.0

No threat

THREAT_LEVEL_VEHICLE_APPROACHING 1

API Level 3.0.0

Vehicle is approaching

THREAT_LEVEL_VEHICLE_FAST_APPROACHING 2

API Level 3.0.0

Vehicle is approaching fast

ThreatSide

Since:

API Level 2.2.0

Name Value Since Description See Also
THREAT_SIDE_NO_SIDE 0

API Level 3.0.0

Threat not on right or left

THREAT_SIDE_RIGHT 1

API Level 3.0.0

Threat is on the right side

THREAT_SIDE_LEFT 2

API Level 3.0.0

Threat is on the left side

TrainerMode

Since:

API Level 2.2.0

Name Value Since Description See Also
TRAINER_MODE_BASIC_RESISTANCE 0

API Level 2.4.0

Basic resistance fitness equipment training mode In this mode the user may set the percentage of maximum resistance on the equipment

TRAINER_MODE_TARGET_POWER 1

API Level 2.4.0

Target power fitness equipment training mode In this mode the user may set the target wattage output of the equipment

TRAINER_MODE_SIMULATION 2

API Level 2.4.0

Simulation fitness equipment training mode In this mode the user may set various fields to adjust resistance

TrainerValue

Since:

API Level 2.2.0

Name Value Since Description See Also
TRAINER_MODE 7

API Level 2.4.0

The training mode the fitness equipment is currently in. See TRAINER_MODE_* enum for values

TRAINER_RESISTANCE 8

API Level 2.4.0

Basic resistance value of the fitness equipment. Percent of max resistance 0 - 100 input range, unit 0.5%.

TRAINER_TARGET_POWER 9

API Level 2.4.0

Target power setting of the fitness equipment. 0 - 4000W input range, unit 0.25W.

TRAINER_SLOPE 10

API Level 2.4.0

The simulated Slope/Grade setting of simulation training mode. -200% - 200% input range, unit 0.01%.

TRAINER_SURFACE 11

API Level 2.4.0

The simulated surface resistance coefficient setting of simulation training mode. 0 - 0.0127 input range, 5x10^-5 scale. Default value is set to 0xFF.

TRAINER_WIND_COEFF 12

API Level 2.4.0

The simulated wind resistance coefficient setting of simulation training mode. 0.0 - 1.86 kg/m input range, 0.01 scale. Wind Resistance Coefficient [kg/m] = Frontal Surface Area [m2] x Drag Coefficient x Air Density [kg/m3] Default value is set to 0xFF.

TRAINER_WIND_SPEED 13

API Level 2.4.0

The simulated wind speed setting of simulation training mode. -127 - +127 km/hr input range, (+)Head wind (-)Tail wind. 1 km/hr units. Simulated Wind Speed (km/h) = Raw Wind Speed Value – 127 km/h Default value is set to 0xFF.

TRAINER_WIND_DRAFT_FACTOR 14

API Level 2.4.0

The simulated wind drafting scale factor setting of simulation training mode. 0 - 1.0 input range, 0.01 scale. A draft factor of 0 removes all wind resistance, and 1.0 indicates no drafting effects.

TRAINER_USER_WEIGHT 15

API Level 2.4.0

The user weight setting of simulation training mode. 0 - 655.34 kg input range, unit 0.01kg.

TRAINER_BIKE_WEIGHT 16

API Level 2.4.0

The bike weight setting of simulation training mode. 0 - 50kg input range, unit 0.05kg

TRAINER_WHEEL_DIAMETER 17

API Level 2.4.0

The wheel diameter setting of the fitness equipment. 0 - 2.54m input range, unit 0.01m

TRAINER_GEAR_RATIO 18

API Level 2.4.0

The gear ratio setting of the fitness equipment. 0.03 - 7.65 input range, unit 0.03. gear ratio = value * 0.03

BodyLocation

Since:

API Level 2.2.0

Name Value Since Description See Also
BODY_LOCATION_LEFT_LEG 0

API Level 2.4.0

Left leg body location

BODY_LOCATION_RIGHT_LEG 1

API Level 2.4.0

Right leg body location

BODY_LOCATION_TORSO_FRONT 17

API Level 2.4.0

Front torso body location

BODY_LOCATION_WAIST_MID_BACK 36

API Level 2.4.0

Waist, mid back body location

BODY_LOCATION_WAIST_FRONT 37

API Level 2.4.0

Waist, front body location

BODY_LOCATION_WAIST_LEFT 38

API Level 2.4.0

Waist, left body location

BODY_LOCATION_WAIST_RIGHT 39

API Level 2.4.0

Waist, right body location

SensorOrientation

Since:

API Level 2.2.0

Name Value Since Description See Also
SENSOR_ORIENTATION_RIGHT_SIDE_UP 0

API Level 2.4.0

Right side up sensor orientation

SENSOR_ORIENTATION_UPSIDE_DOWN 1

API Level 2.4.0

Upside down sensor orientation


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