Under Review
over 2 years ago

This is not a Connect IQ bug report or feature request. Please refer to this link, https://forums.garmin.com/developer/connect-iq/w/wiki/2/forum-rules, for more information about reporting issues or feature requests regarding Connect IQ.

SDK bug: ANT LightNet data not resetting when LightNet device is disconnected (last values remaining visible)

I'm using

- ANT LightNet Taillight mode

- ANT LightNet Battery

values in order to display the VARIA RTL 516 status in a datafield. The status is displayed correctly when RTL 516 device is (initially) off and then switched on. After switching the RTL 516 device off, the last values keep visible (battery level and light mode on).

There should be a reset of these values by the SDK after ANT connection timeout.

  • According to a Software Engineer that reviewed this forum, this is by design. If a light disconnects from the light network without sending a LightStates1Page, the controller/display will not be made aware of any change in the light's state.

    The best option is most likely to make use of the LightNetworkListerner's onLightNetworkStateUpdate() API callback and watch for any transitions out of the LIGHT_NETWORK_STATE_FORMED state in order to invalidate/depopulate their data as needed.

     

    See https://developer.garmin.com/connect-iq/api-docs/Toybox/AntPlus/LightNetworkListener.html#onLightNetworkStateUpdate-instance_function

  • I agree that things could be implemented badly. But the requirements are nearly the same like with an ANT heartrate, speed, cadence or power meter (I'm in road bikes). If there is no initial or a lost connection, values are resetted quickly there.

  • It would be a nice feature, but don't build on it being added to the apis soon. I don't really work how ANT works on the radio level but I'm not sure it's really possible to detect disconnect, or power off... In the meanwhile if you want your app to work then you can do what I did. Or you can wait a few years. BTW I'm not sure if it's a bug at all. If things would work as you want them to work then probably other developers would complain that just because you ride your bike next to some place where because of the interference you miss a few readings it shouldn't disconnect it... So maybe leaving this decision to the developer is not that bad. Maybe the only thing needs to be done is to add a few sentences to the documentation.

  •  

    So you suggest to solve an identical problem decentralized in each implementation, while it could be solved in a central place? I cannot see any reeason for it, since the requirements are equal in every implementaion - to receive reasonable values from SDK. Returning other than undefined values in case of switched-off devices is not reasonable.

  • I just fixed a similar bug in my datafield. You probably need to do something similar. I am displaying "--" if more than 4 seconds passed since the last update.