Another change in CIQ3.1.8? ANT sensor switching

Hi (again),

I have code that allows me to switch the source of HR/II data between the optical/registered source and an external HRM strap. This used to work prior to CIQ 3.1.8 being available on the device (fenix 6x pro).

What happens now is that going from Ext->Int is ok but switching E->I->E fails. I get 12 broadcast messages after the switch and then nothing from the external strap. At start up of the app ANT sensor is found and connected to and after 12 broadcast messages I get HR data packets. 

Outline of code:

FUNC Initialise ANT sensor:

- Get channel

- Initialise channel

- Set channel config

- open channel

FUNC Stop ANT sensor:

- close then release

FUNC Switch sensor:

- Stop current sensor

- set sensor variable to null

- initialise new sensor (sensor = new AntHandler(...))

I check for null states on various variables to ensure stops valid etc.

Any ideas welcome.

Regards, David

  • Are you paired with the external sensor in Sensors&accessories?  Try again with that pairing removed. 

  • Hi Jim,

    In this case I have it turned off so the watch is unaware of it. The code does allow a known/connected strap to provide the HR as an internal device. ie it can use optical or strap (if connected/enabled) as internal option or an unregistered/off strap as the external source. 

    What is a little frustrating is that this use to work fine.

    What I find odd is the 12 0x40 messages then nothing. The channel is shown as open and messages (those 12) arrive so the handler is set correctly. 

    One option would be to rewrite the code to connect to an external strap at start-up (if present) and leave it connected. then switching back and forth would only mean deciding which stream of HR data to accept.

    Regards,

    David

  • Try again after removing it from Sensors&Accessories, as turning it off isn't honored by CIQ.

    If you enable Sensor.SENSOR_HEARTRATE it will try to connect if you just turn it off.

  • Hi,

    Interesting. Is this something that changed in CIQ3.1.8? 

    This has fixed the issue!!! So it sounds like a connection was made by the watch in internal mode (Sensor.SENSOR_HEARTRATE) which wasn't released properly when sensor.unregisterSensorDataListener() was called. 

    I have tried in the past using sensor.setEnabledSensors( [ ] ) before but this stopped the optical sensor for about 5 secs (no lights).

    Any advice for freeing up the "off" ANT strap when using the above?

    Regards,
    David 

  • Nope.  It's been that way for a long time (ciq 1.0.0?).  I think you may be seeing a timing issue where if you grab the external HR first, it's yours, but if the FW is first, you don't get it.  It could be with this SDK is just the first time you noticed it.

    You'll see the same thing with other sensors.  If the watch is paired to a tempe, you'll have issues using it with ant directly.

    You need to remove it from the FW pairing to use it reliably with ANT.  

  • Thanks for the help. I'll change the user guide to reflect this rather than rewriting the code.

    Regards,David

  • On my watch adding sensor.setEnabledSensors( [ ] ) to the stop code seems to also release the strap which is what I need. I can't check any other devices sadly.