I have the 2.4.0.beta1 version of the SDK with the 2.4.0.beta1 version of the plugin in eclipse. I'm targeting a Fenix5X which should support the 2.4.0.beta1.
Can anyone see what I'm doing wrong here? Is there something else I need to do to get access to the FEC functionality?
The following code gives the following console output when run on the simulator.
using Toybox.Application as App;
using Toybox.WatchUi as Ui;
using Toybox.AntPlus;
using Toybox.System as Sys;
class testApp extends App.AppBase {
var listener;
var fitnessEquipment;
function initialize() {
Sys.println("Here 1");
AppBase.initialize();
Sys.println("Here 2");
listener = new MyFitnessEquipmentListener();
Sys.println("Here 3");
fitnessEquipment = new AntPlus.FitnessEquipment(listener);
Sys.println("Here 4");
//fitnessEquipment.setTrainerMode(TRAINER_MODE_BASIC_RESISTANCE);
//fitnessEquipment.controlEquipment(TRAINER_RESISTANCE, 30); //sets basic resistance to 30% of maximum.
}
// Return the initial view of your application here
function getInitialView() {
return [ new testView(), new testDelegate() ];
}
}
class MyFitnessEquipmentListener extends AntPlus.FitnessEquipmentListener {
function initialize() {
Sys.println("Going to Initialize");
FitnessEquipmentListener.initialize();
}
}Here 1
Here 2
Failed invoking <symbol>
Symbol Not Found Error
The following code runs without errors by just changing from a FitnessEquipmentListener to a BikePowerListener.
using Toybox.Application as App;
using Toybox.WatchUi as Ui;
using Toybox.AntPlus;
using Toybox.System as Sys;
class testApp extends App.AppBase {
var listener;
var fitnessEquipment;
function initialize() {
Sys.println("Here 1");
AppBase.initialize();
Sys.println("Here 2");
listener = new MyFitnessEquipmentListener();
Sys.println("Here 3");
fitnessEquipment = new AntPlus.BikePower(listener);
Sys.println("Here 4");
//fitnessEquipment.setTrainerMode(TRAINER_MODE_BASIC_RESISTANCE);
//fitnessEquipment.controlEquipment(TRAINER_RESISTANCE, 30); //sets basic resistance to 30% of maximum.
}
// Return the initial view of your application here
function getInitialView() {
return [ new testView(), new testDelegate() ];
}
}
class MyFitnessEquipmentListener extends AntPlus.BikePowerListener {
function initialize() {
Sys.println("Going to Initialize");
BikePowerListener.initialize();
}
}Console Output
Here 1
Here 2
Going to Initialize
Here 3
Here 4