FitnessEquipment Problem

I'm trying to add FEC to one of my existing Apps. I'd like to be able to set the power level on the trainer. I'm getting a symbol not found error when I try to make a new FitnessEquipmentListener where making a BikePowerListener in a parallel way runs without errors.

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
  • Hey roger, I've not look at this new stuff at all, but the developer blog post says:
    ... and the FE-C profile to the Edge® 520, 820, 1000, and 1030.


    https://developer.garmin.com/index.p...-now-available


    There's nothing about specific devices in the api doc though... the RD profile is for the f5x, and maybe the FE-C isn't..
  • Thanks Jim.

    I loaded the Beta firmware for the Fenix5X (6.73). It's readme says it supports CIQ 2.4. It has RD in the sensors list, but not FE-C so I think you are right that it's not supporting FE-C yet.

    The latest firmware for my Edge 1000 (14.40) does allow me to pair to an FE-C trainer. However, the 2.4 CIQ Beta SDK doesn't allow me to build for an Edge yet.

    Looks like I might need to sit tight for a little bit while a few more pieces fall into place.
  • The only beta FW I've seen with 2.4.0 is for the f5/x/s and the vahr, and maybe before the 2.4.1 SDK comes out there will be something for the Edge devices. I remembered the blog post as I was going to ask garmin about FE-C and why it wasn't for wearables.
  • The ANT+ FE-C profile is only supported on certain devices. At this time support is limited to the Edge devices (edge_520, edge_1000, edge820, and edge1030).

    As always, you can use the has operator to tell if the support available at runtime (AntPlus has :FitnessEquipment would work).

    Travis
  • For now, I just brute forced it by creating a second Generic Ant channel to set the target power on the FE-C. I just assumed that the trainer is already calibrated because I didn't want to code up all of that stuff too. This added surprisingly little to the memory footprint (~4K)

    The native FE-C solution would still be more elegant.