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, sendManufacturerMessage, sendPageRequest

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


18070
18071
# File 'Monkeybrains.rb', line 18070

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


18122
18123
# File 'Monkeybrains.rb', line 18122

def controlEquipment(setting, data)
end

getEquipmentDataToybox::AntPlus::FitnessEquipmentData

Get the current training data from the FE

Returns:

Since:

  • 2.4.0


18137
18138
# File 'Monkeybrains.rb', line 18137

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


18085
18086
# File 'Monkeybrains.rb', line 18085

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


18093
18094
# File 'Monkeybrains.rb', line 18093

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


18102
18103
# File 'Monkeybrains.rb', line 18102

def getTargetPowerSettings()
end

getTrainerModeToybox::AntPlus::FitnessEquipmentMode

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

Returns:

Since:

  • 2.4.0


18076
18077
# File 'Monkeybrains.rb', line 18076

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


18111
18112
# File 'Monkeybrains.rb', line 18111

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


18131
18132
# File 'Monkeybrains.rb', line 18131

def setTrainerMode(mode)
end