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


18097
18098
# File 'Monkeybrains.rb', line 18097

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


18149
18150
# File 'Monkeybrains.rb', line 18149

def controlEquipment(setting, data)
end

getEquipmentDataToybox::AntPlus::FitnessEquipmentData

Get the current training data from the FE

Returns:

Since:

  • 2.4.0


18164
18165
# File 'Monkeybrains.rb', line 18164

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


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

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


18120
18121
# File 'Monkeybrains.rb', line 18120

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


18129
18130
# File 'Monkeybrains.rb', line 18129

def getTargetPowerSettings()
end

getTrainerModeToybox::AntPlus::FitnessEquipmentMode

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

Returns:

Since:

  • 2.4.0


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

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


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

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


18158
18159
# File 'Monkeybrains.rb', line 18158

def setTrainerMode(mode)
end