Complete
over 4 years ago

WERETECH-9471

Fixed

Sensor.setEnabledSensors exception on Venu, Vivoactive 4

I have been getting numerous reports of app crashes due to the Sensor.setEnabledSensors call. This is occurring on a Venu with the new 4.90 firmware, and I've had reports of possibly the same error on Vivoactive 3 and 4 watches after they received their most recent firmware updates in the past week.

My call is

 Snsr.setEnabledSensors( [Snsr.SENSOR_HEARTRATE,Snsr.SENSOR_BIKECADENCE,Snsr.SENSOR_BIKEPOWER] );

(which has been unchanged for literally years) and this is causing this error:
Error: Array Out Of Bounds Error
Details: 'Failed invoking <symbol>'

Removing Snsr.SENSOR_BIKEPOWER from the array does not make any difference.

  • Hi Jim.

    We I use SENSOR_HEARTRATE ,Snsr.SENSOR_BIKEPOWER. it works fine. Whenever I use Snsr.SENSOR_BIKECADENCE it fails.

    My users are using app with v3.1.9, but a fiemware update the errors started.

    Kees

  • I was able to reproduce this on a 945, but only once.  I removed all sensors I had paired with ANT, and ran an app that does

    Sensor.setEnabledSensors([Sensor.SENSOR_PULSE_OXIMETRY]);

    And got the "Array out of Bounds" error.  So, it doesn't seem to be based on a specific sensor.

    Rebooting the watch and all runs fine.

    Looking through my ERA reports, I see cases of this, but the number of occurrences for each is small.  The specific sensor doesn't matter in those apps, and in one case I was disabling the senors by passing an array of [] (this was really old code that I first added in the CIQ 1.2 days and hasn't been an issue before.)

    Some of the apps were compiled with 3.1, some 3.2, so that doesn't matter.

    And it's happening on different devices, but what's common, is all have CIQ 3.2.x VMs

  • It works fine when I remove the BIKE_CADENCE and use other multiple sensors, so it must have something to do with adding the Sensor.SENSOR_BIKECADENCE

    Best regards, Kees

  • Following statement sometimes fails as well:

    Sensor.setEnabledSensors([]);