I would be grateful if someone could give me some help trying to solve this problem please. The main difficulty I am having is attaching the function to receive events. Also I suspect there is a better way to get the speed from the Fitness Equipment.
Using C#, I am trying to link to a Smart ANT+ Turbo Trainer, reading speed and cadence and setting power. I can't find any examples using the Fitness Equipment (please point me to some if there are any), so I am basing this on the Heart Rate Display Simulator example.
Following the example from the Heart Rate Display, I set up a FitnessEquipmentDisplay
turboTrainerDisplay = new FitnessEquipmentDisplay(channel0, networkAntPlus);
But I can't find a way to I attach a function to recieve the events. I expected something like one of these (neither work) and I am stuck!
turboTrainerDisplay.SpecificStationaryBikePageReceived += turboDisplay_TurboDataReceived;
OR ...
turboTrainerDisplay.DataPageReceived += turboDisplay_TurboDataReceived;
Then turn it on to get the events pumping...
turboTrainerDisplay.TurnOn();
Cadence I expected to come from a broadcast (SpecificStationaryBikePage) page event (in the same way as HeartRate did):
P:AntPlus.Profiles.FitnessEquipment.SpecificStationaryBikePage.Cadence
However I can only see Speed in:
P:AntPlus.Profiles.FitnessEquipment.FitnessEquipmentDisplay.Speed
which is a property rather than a broadcast event so I would have to interrogate for it every time I wanted to look at it. I suspect there is a better way.
With turboTrainerDisplay created above as a FitnessEquipmentDisplay, setting power looks straightforward .. This looks OK but let me know if this is not right.
ushort myPower = 100 * 4; // 0-4000 w units 0.25w - eg set to 100W for testing
ControlTargetPowerPage targetPowerPage = new ControlTargetPowerPage();
targetPowerPage.TargetPower = myPower;
turboTrainerDisplay.SendTargetPower(targetPowerPage);// Sends a Target Power Command (0x31)
Thanks
Steve