Hello:
I'm trying to read the torque effectiveness for a data field and I get the error Failed invoking <symbol>
First of all I declared the class
using Toybox.WatchUi as Ui;
using Toybox.Graphics as Gfx;
using Toybox.UserProfile as Upf;
using Toybox.Application as App;
using Toybox.AntPlus as Apl;
class MyBikePowerListener extends Apl.BikePowerListener
{
//Initializes class variables
function initialize()
{
Apl.BikePowerListener.initialize();
}
}
Then, inside the function initialize() of my class that extends the Ui.DataField I have
var listener = new MyBikePowerListener(); var bikePower = new Apl.BikePower(listener);
And then inside my function compute(info) I have
var torqueData = bikePower.getTorqueEffectivenessPedalSmoothness();
Until here the code works. If I simulate data from the wizard all works well. But the problem comes when I try to extract the data as
var data_left = torqueData.leftTorqueEffectiveness;
If I put this code I obtain the Failed invoking <symbol>. Obviously I'm doing something wrong, but I can't find the source. Could anyone help, please? Or maybe someone could share some code about reading these advanced power metrics?
Thanks