Class: Toybox.AntPlus.FitnessEquipment

Overview

Represents a Fitness Equipment Device instance.

Example:

using Toybox.AntPlus;

// Assuming Valid FitnessEquipmentListener object "MyFitnessEquipmentListener"

// Initialize the AntPlus.FitnessEquipmentListener object
listener = new MyFitnessEquipmentListener();

// Initialize the AntPlus.BikePower object with a listener
fitnessEquipment = new AntPlus.FitnessEquipment(listener);

fitnessEquipment.setTrainerMode(TRAINER_MODE_BASIC_RESISTANCE);
fitnessEquipment.controlEquipment(TRAINER_RESISTANCE, 30); //sets basic resistance to 30% of maximum.
// ...etc

Since:

API Level 2.4.0

Supported Devices:

Instance Method Summary collapse

Instance Method Details

controlEquipment(setting as AntPlus.TrainerValue, data as Lang.Float or AntPlus.TrainerMode) as Void

Control the fitness Equipment Note: Setting a value related to a specific training mode will cause the fitness equipment to change to that mode. For example, controlEquipment(TRAINER_TARGET_POWER, 100) will set the fitness equipment to target power mode with target power set to 100W if such mode is supported. Values out of range will be set to within the nearest range boundary value.

Parameters:

Since:

API Level 2.4.0

getEquipmentData() as AntPlus.FitnessEquipmentData

Get the current training data from the FE

Returns:

Since:

API Level 2.4.0

getResistanceSettings() as AntPlus.ResistanceSettings

Get the resistance percentage setting of the fitness equipment for basic resistance training mode. You should set resistance values and be in basic resistance training mode before calling this method, otherwise null or default values may be returned.

Returns:

Since:

API Level 2.4.0

getSimulationSettings() as AntPlus.SimulationSettings

Get the wind and track resistance simulation settings. You should set wind and track settings, as well as be in simulation training mode before calling this method or null or default values may be returned.

Returns:

Since:

API Level 2.4.0

getTargetPowerSettings() as AntPlus.TargetPowerSettings

Get the target power setting of the fitness equipment for target power training mode. You should set the target power and be in target power training mode before calling this method, otherwise null or default values may be returned.

Returns:

Since:

API Level 2.4.0

getTrainerMode() as AntPlus.FitnessEquipmentMode

Get the current training mode and supported modes of the fitness equipment

Returns:

Since:

API Level 2.4.0

getUserSettings() as AntPlus.UserSettings

Get the user configuration settings of the fitness equipment for simulation training mode. You should set user settings values and be in simulation mode before calling this method, otherwise null or default values may be returned.

Returns:

Since:

API Level 2.4.0

initialize(listener as AntPlus.FitnessEquipmentListener or Null)

Constructor

Parameters:

Since:

API Level 2.4.0

setTrainerMode(mode as AntPlus.TrainerMode) as Void

Set the trainer mode. You should check the capable modes of the fitness equipment, as the command will be ignored by the fitness equipment if the mode is not supported.

Parameters:

Since:

API Level 2.4.0


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