CIQ FIT Contribution, AVG/MAX

If you can see the following image (first time trying this image service), notice that a native sensor (HR) in Garmin Connect Mobile, overlays the AVG and MAX metrics on the graph.

However, I wrote my own data (HR2Power) to the FIT file as a native Power value, and it properly writes to the file and displays as a graph in GCM. Using MESG_TYPE_RECORD and nativeNm = 7 for power. Sweet. However, I don't know how to also get the AVG and MAX values to display. I do write the MAX Power and AVG Power using MESG_TYPE_SESSION when I trigger a STOP and RESET event. Using nativeNums 20 and 21. Any ideas? Thanks!

  • Session values don’t display on the graph. And Garmin Connect does not display nativeNum metrics equivalently to native metrics.

    If you’re not seeing the average and max values at all (in the summary where they’re supposed to be), just call setData every second. SetData doesn’t actually write the data, it just sets the next value that will be written at the appropriate time.
  • Thanks!! Too bad they won't overlay nativeNum summary stats in a consistent fashion to native. Oh well. In the numeric summary view, I see 0.0 as values. So I think your idea to write the avg/max every second rather than once at the end, is the solution. Thanks!!
  • You’re welcome! As mentioned before, Garmin Connect basically ignores nativeNum, much to the chagrin of devs and users.
  • Can you explain what you mean by "SetData doesn't write data - it gets written at the appropriate time"?

    I've noticed that in my datafield, where I write to my activity's FIT file, that the last value I send using setData... doesn't actually end up in the FIT file. So, what is "the appropriate time"? How can I force the data I've set with setData to be written out to the FIT file, so that final value gets written before I stop and save the activity.

    Thanks!

  • I don’t know much about the sunmRy values. But I do record and lap and for both of these, you have to write the data or rather feed the data continuously. Every sec that is. So yeah. 

    Try that. 

  • I mean that the watch decides when to write data to the FIT file -- setData only populates an internal field which is read by the process that writes to the FIT file. setData() doesn't write anything, it determines what will be written next.

    For example, if you call setData multiple times while the watch is paused, that won't cause any data to be written. It's possible that the final value you write will be written at the point that the user unpauses the watch.

    You can't force any data you've set with setData to be written. In your case, the last call of setData() before the watch is stopped should be the last thing that's written.

    In any case, the watch is writing so many data points (e.g. one per second), that you probably won't be able to tell if one or two value was dropped at the end of the activity.