Unable to disable Sensor

I tried passing [] as the desired Sensors, but it didn't disable anything. I suppose it's additive, but then I don't see a way to disable a sensor after requesting it.

http://pastebin.com/BDPGxPcG

Also, my initial implementation used one-shot timer callbacks, but I regularly got exceptions with more than 3 timers existing, despite only setting one concurrently (though creating one in the callback might count as 2).
  • Hi,

    if not mistaken..... there is NO way to disable a Sensor once it has been requested.
    I do believe however, that one can explicitly enable a sensor by requesting for it (or put it into an array and then requesting them one-by-one - http://developer.garmin.com/downloads/connect-iq/monkey-c/doc/Toybox/Sensor.html#setEnabledSensors-instance_method)

    Once requested, I don't see a way in the API to disable them.

    Also, I'm making a guess that on the FR235, with Optical and HR Strap, there's no way to determine which is "in-use" (due to the fact that Garmin uses a "pool sensor" concept). Hence, if you are using the optical and you running buddy is loaning your HR Strap and he's standing beside you, your watch would detect both the HR strap and the optical and possibly ask you which one to use etc.

    Travis might chime in as I believe he has a 235 watch.

    As for the timer thing, Ifyou're requested it in the callback, believe it's waiting in the background? Perhaps you can set a flag to see if it's on or off? Not sure if that's any help
  • Former Member
    Former Member over 9 years ago
    Passing an empty sensor list to setEnabledSensors should disable the sensors, but we recently found an issue that prevented that from working properly. We have fixed the issue, so it should start working in one of the next VM releases.
  • Passing an empty sensor list to setEnabledSensors should disable the sensors, but we recently found an issue that prevented that from working properly. We have fixed the issue, so it should start working in one of the next VM releases.


    Good to hear!