According to the documentation in Toybox.Ant.GenericChannel.open (API Level 1.0.0):
"Multitasking: Ant channel connection can not be changed while in inacitve mode and ant channels opened during active mode will be closed when app becomes inactive, and re-opened automatically when is active again. These state changes are denoted by calls to AppBase.onActive() and AppBase.onInactive()."
and in Toybox.Application.AppBase.onInactive (API Level 4.2.3, only on some new devices, like fenix8, venu3):
"Invoked when app enters inactive mode, i.e. hidden by system and not occupying screen. Access to certain system resources will be limited, such as GPS, ANT, Alerts (Vibs tones, flashlight)."
What is multitasking? (I mean I know what it means, but are these devices now have multitasking?) Does this apply to datafields? Or only to watch-apps?
Do I need to save the state (active vs inactive) in a global variable and check it before I call GenericChannel.open? Or is it enough to check whether it returned true or false?
I'm asking this, because I do see some Unhandled Exceptions on the line where I call open(), however what's interesting (besides, that according to the docs open should at worst return false and not throw an exception) is that half of these errors are from older devices, that don't even have onInactive().