FIT message fields (C SDK)

Hello

For the C SDK, is there a recommended method to dynamically select which message fields to include in the definition and data records?

For example, FIT_RECORD_MESG has around 50 fields, and I want to use some fields for one sequence, other fields for another sequence, and so on.

Thanks

  • The FIT C SDK does not support dynamic message definitions. But what you can do is configure the messages to only include the fields that are required by your application. You can also create alternate message definitions if there is a predetermined set of configurations.

    See the Optimizing the FIT C SDK section for more info.

    https://developer.garmin.com/fit/cookbook/fitgen/

    If it an an option for your application, dynamic message definitions is the default behavior of the FIT C++ SDK. 

  • I had a similar need for my project, and i modified the c sdk to support dynamic fields via a flag in the FIT_CONVERT_STATE. the modified code is on github https://github.com/roznet/FitFileParser and the code of the modification is quite simple and mainly on fit_convert.c (beside a few header modification) so should be easy to pickup.

    Note the project also add better support for developer field, but that’s quite specific to objc & swift, so not pure c. the dynamic field is pure c.

    hope this helps