Class: Toybox::AntPlus::FitnessEquipment

Inherits:
Device show all

Overview

Represents a Fitness Equipment Device instance.

Examples:

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:

  • 2.4.0

Fitness Equipment Training Setting Type collapse

Methods inherited from Device

getBatteryStatus, getComponentIdentifiers, getDeviceState, getManufacturerInfo, getProductInfo

Methods inherited from Lang::Object

equals, hashCode, method, toString, weak

Constructor Details

initialize(listener) ⇒ FitnessEquipment

The Constructor for the FitnessEquipment object. takes an extension of the FitnessEquipmentListener class as a parameter. null can be passed in instead if the user plans to only poll for data using the get* methods.

Parameters:

Since:

  • 2.4.0


16368
16369
# File 'Monkeybrains.rb', line 16368

def initialize(listener)
end

Instance Method Details

controlEquipment(setting, data) ⇒ Object

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:

  • setting (Toybox::AntPlus::TRAINER_*)

    enum value

  • data (Toybox::Lang::Float)

    The value of the setting to be sent or TRAINER_MODE_* enum value if setting mode.

Since:

  • 2.4.0


16420
16421
# File 'Monkeybrains.rb', line 16420

def controlEquipment(setting, data)
end

getEquipmentDataToybox::AntPlus::FitnessEquipmentData

Get the current training data from the FE

Returns:

Since:

  • 2.4.0


16435
16436
# File 'Monkeybrains.rb', line 16435

def getEquipmentData()
end

getResistanceSettingsToybox::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:

  • 2.4.0


16383
16384
# File 'Monkeybrains.rb', line 16383

def getResistanceSettings()
end

getSimulationSettingsToybox::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:

  • 2.4.0


16391
16392
# File 'Monkeybrains.rb', line 16391

def getSimulationSettings()
end

getTargetPowerSettingsToybox::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:

  • 2.4.0


16400
16401
# File 'Monkeybrains.rb', line 16400

def getTargetPowerSettings()
end

getTrainerModeToybox::AntPlus::FitnessEquipmentMode

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

Returns:

Since:

  • 2.4.0


16374
16375
# File 'Monkeybrains.rb', line 16374

def getTrainerMode()
end

getUserSettingsToybox::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:

  • 2.4.0


16409
16410
# File 'Monkeybrains.rb', line 16409

def getUserSettings()
end

setTrainerMode(mode) ⇒ Object

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:

  • mode (Toybox::Lang::Integer)

    The TRAINER_MODE_* enum value

Since:

  • 2.4.0


16429
16430
# File 'Monkeybrains.rb', line 16429

def setTrainerMode(mode)
end