Fit SDK Missing Global Message Number

In preparation for processing Activity FIT files from my watch app I am making good progress developing a server side decoder in PHP.

I know it sounds like re-inventing the wheel, but the only code provided in the SDK is either Java or C#, which aren't really compatible with a Ubuntu web server (and I haven't done any Java coding for 5 years).

I have successfully used my decoder to parse the Example file in the Fit SDK (FitSDKRelease_20.96.00, Activity.fit) and am now trying it against a FIT file from my app.

It fails early on, being unable to decode a a Global Message Number of 22 which I can't locate in the Profile.xlsx, which appears to be the spec for the FIT file  constants.

As you can see from the screenshot below, 22 is missing from between 21 and 23.

Here's the Definition record: 44000016000a

Is Profile.xlsx the correct reference, and if so, where do I find a definition of 22?

  • There are some message numbers that are used by Garmin for debugging data, which are not published. If any message numbers that are not in the specification are encountered, you should be able to read the message size and skip over it. This is an important part of the parser even if these unpublished records didn't exist to support parsing files that may contain newly added messages.

    If you look through the Java or C# code, you should find code that does this. I would recommend at least using these provided codebases as a reference if you are attempting to implement your own parser.

  • Yes, I have since been able to use the message size to skip over these records, but now I'm stuck decoding the compressed timestamp messages...

  • I am building the fit file decoder to explore the use of FitContributor createField() in my watch app to record some application data into the Fit file. For example,  to encode some user data into the "session" record, and also add a text field to the lap record.

    However  the documentation is a little obscure, and in particular on the specification of the "fieldId" in the parameters for createField().

    On first reading I assumed "unique Field Identifier" referred to a "Field Definition Number", but now I'm not sure that's the case, as I can't find any further reference to fieldId.

    I thought I'd build the decoder to explore further, but it's complicated by undefined Message Types and undefined Field Definition Numbers.

    Could I request some clarification on

    1. the usage of the fieldId parameter in the createField() function and
    2. how a field defined in the session record would be presented.