Ticket Created
over 2 years ago

WERETECH-12749

feature-request: enable CIQ apps to indicate no-data/missing-data/incorrect-data in a Fit field.

Native apps have a way to indicate missing/no/invalid data in the FIT data file. For native apps' data GCM and web both are able to display correctly the gaps. For CIQ apps we currently only have the choice to send some data (like 0) that is "incorrectly" rendered on the graphs.

Please add a way for CIQ apps to do the same. Some possible solutions:

- enable Toybox.FitContributor.Field.setData(null) also for non nullable DATA_TYPE_-s.

- add a new parameter to Toybox/WatchUi/DataField.createField to indicate that setData should accept null.

- add a new parameter to Toybox/WatchUi/DataField.createField to indicate what value should be treated as missing/invalid. So for example for HR related data we could set ActivityMonitor.INVALID_HR_SAMPLE as the invalid value and use that to indicate that for a certain period of time we didn't have valid data.

The problem is well documented in https://forums.garmin.com/developer/connect-iq/f/discussion/7509/fitcontributor-field-setdata-should-accept-null-as-a-value/

  • I initialize this FLOAT with 0xFFFFFFFF.

    As I said in the other thread, what you're actually doing is initializing a Float to the numerical value of a Number with all bits 1, which is -1. The constant 0xFFFFFFFF is an integer (Number), not a Float or Double.

    Try using NaN instead. (NaN is all bits 1 in the IEEE floating point standard.

    Also, just some friendly advice - when you use caps, it looks like you're yelling. You could try bold or *asterisks* for emphasis.

  • I initialize this FLOAT with 0xFFFFFFFF. I get "-1" written out to the graph. Since my metric's valid values are negative and positive, a ZERO is meaningful, so I REALLY need the graph to plot nothing when there isn't a valid value. So writing an INVALID valid doesn't seem to work for me for FLOAT types. Have you seen it work for any DATA TYPE? Thanks! - see below you have seen it work for unsigned INTs? Did you try FLOATS?

  • Cool, thanks for confirming!

    Just a nitpick, the invalid value is not "-1" for any of the signed types - if it was, that would obviously cause problems with otherwise valid usages of -1 haha. It's only "-1" for the unsigned data types, if you use the bit pattern for "-1" in the equivalent signed data type (of equal width).

    For each data type, the invalid value is the largest positive value which can represented.

    Anyway, in this case I actually did whine about nothing lol. Seems that the functionality i always wanted has been there since the beginning. It's funny bc I have read the FIT documentation (in other forms) before, and somehow I missed this :/.

  • wow, that's a nice table! I Do know that sending 255 (0xFF) for the heart rate works, because the meaning of 255 == invalid HR is documented better than the others, and when I saw that not sending the invalid HR keeps the last sent value in the graph (flat-line) I tried to send the 255 and it works as expected. I'll try the "-1" values for the other fields...

  • Then again, is that identical to what native apps do when they "write gaps" to the FIT file? I haven't tested it. They could very well be writing nothing, as opposed to writing an invalid value. But it would be interesting to see:

    1) If this approach works

    2) If it's the same thing that native apps do

    But again, I barely care now