Average Smo2 and tHb in the Lap+Session messages an array

Hi folks,

I'm attempting to extract Smo2 and tHb fields using FIT SDK version 21.141. There are summary (avg, mix, max) values of these fields available in the Lap and Session messages. They are named:

avg_total_hemoglobin_conc
min_total_hemoglobin_conc
max_total_hemoglobin_conc
avg_saturated_hemoglobin_percent
min_saturated_hemoglobin_percent
max_saturated_hemoglobin_percent

Per the FIT profile these are all arrays. I can't find a description of why these are arrays. Does anyone know why, or give any guidance on how to extract this data? I can't figure out why these would be arrays. 

Thank you

  • Update: I wonder if the total_hemoglobin and saturated_hemoglobin summary fields in the Lap and Session messages are arrays because it's possible for athletes to wear multiple sensors simultaneously. I.e. one on each thigh. So each sensor is a different element in the array. If that's the case, then why are the SmO2 and tHb fields in the Record message also arrays?

  • The total_hemoglobin and saturated_hemoglobin summary fields are pretty old, and I was not able to dig up any history on them. More than likely the fields were added to the FIT Profile during development of the ANT+ MO2 Device Profile and before there was a clear intent for them. If the fields were meant to hold the data from multiple sensors, then the corresponding fields in the Record message should have been arrays too. 

    The best practice for Garmin devices is to use the manufacturer's CIQ data field(s) instead of the native integration. That is the only option for Edge bike computers since there is no native integration for MO2 sensors. For other device manufacturers that support MO2 sensors, the native values in the FIT file are typically the only option.

  • Oof, this is really messy. I have 7 sample FIT files that contain SmO2 data, and there are 5 different ways that they're being stored. With the mix of sensor manufacturers and and watch/bike computer manufacturers this could benefit from better definition in the FIT Profile so that it's standardized across all of those manufacturers.

  • On the FIT SDK side of things there are only two ways to store MO2 data in a file. Either using the native fields in the Record, Lap, and Sessions messages; or using CIQ FIT Contributions, aka Developer Data Fields in FIT SDK parlance. There is a third way, which is to use manufacturer specific messages, but that is rare these days. Especially when the native fields exist.
     
    Where it can get messy with Developer Data Fields is that the developer gets to come up with the names for each field. Think about all the ways that heart rate can be used as a field name. 

    But there is a solution for this in both the CIQ and FIT SDKs. When creating the field with the CIQ SDK the developer can provide a native field number for their field.  If the CIQ FIT Contribution field is storing Smo2 data in the Record message, then the native num would be 57. The field nums for a mesg can be looked up in Profile.xlsx.
    https://developer.garmin.com/connect-iq/api-docs/Toybox/ActivityRecording/Session.html#createField-instance_function


    There is more information on encoding and decoding developer data using the FIT SDK on this page. Native overrides are mentioned throughout the page, using heart rate as an example. But it applies to any native field.
    https://developer.garmin.com/fit/cookbook/developer-data/ 

    If you are seeing FIT Contributions from a CIQ app that do not have a native num, but should, I suggest reaching out to the developer and asking them to add them. I have had to do that in the past, for Smo2 and tHb data no less!

  • I didn't know about the NativeOverride field. Very helpful! Thanks.