Hi
I am having problems getting the batteryStatus from different ANT+ devices.
In my datatfield I have implemented all possible ANT+ devices including listeners.
Except for one power device I do not get any battery status on all other ant+ devices. As far as I know all other values work correctly.
Code looks like this:
if(lstBikeSpeed == null) {
lstBikeSpeed = new MyBikeSpeedListener();
devBikeSpeed = new AntPlus.BikeSpeed(lstBikeSpeed);
}
...
status = lstBikeSpeed.GetBattery();
...
class MyBikeSpeedListener extends AntPlus.BikeSpeedListener {
function initialize() {
BikeSpeedListener.initialize();
}
var mBat = null;
function onBatteryStatusUpdate(data) {
mBat = data;
}
function GetBattery() {
if(mBat != null && mBat.batteryVoltage != null) {
return mBat.batteryVoltage;
} else {
return 0;
}
}
...
I also tried this line before the GetBattery, to update the mBat directly:
lstBikeSpeed.mBat = devBikeSpeed.getBatteryStatus(null);
It works only on one power device. Is there anything I should change or do I just dont get the values from the SDK??
thanks
regards
Erich