I am using the AntPlus BikeSpeedCadence object to return data from the speed/cadence sensor. I not only need the speed, but also the sensor deviceid and state, so I can pass connection info onto a device we are developing.
On the ConnectIQ simulator all works well, but on the Garmin Edge830 the info object returned is always null, and it reports the state as "dead"
i.e. when I have the following initialisation:
m_listener = new antplus_bsc_listener(); m_bsc = new AntPlus.BikeSpeedCadence(m_listener);
Then on polling the sensor use this:
var info = m_bsc.getSpeedCadenceInfo();
var state = m_bsc.getDeviceState();
However, the variable info is null on Edge830 (returns object as expected in simulator), and state.state is always 0 on the Edge830 (state.state = 3 in simulator).
I am on SDK V3.1, haveset ANT and Sensor permissions in the manifest.xml file, and set active sensors in the app initialisation using:
Sensor.setEnabledSensors([Sensor.SENSOR_BIKEPOWER, Sensor.SENSOR_BIKESPEED, Sensor.SENSOR_BIKECADENCE, Sensor.SENSOR_HEARTRATE])