There are multiple file formats which Strava supports for uploading activities: * FIT * GPX * TCX
Of the three, the FIT format is the only binary format. The other two use XML.
I’m working on uploading data to Strava which is collected using a program
written in Ada. I figured I might as well try writing all the related programs
in Ada as well. Since Ada does not have an XML library built-in and I didn’t
want to use a 3rd party library for this, I figured I would use the FIT format.
Then I could define Read
and Write
attributes for all the types that my FIT
file uses and upload it. The task wasn’t as simple as I thought it would be.
It is tedious to figure out what data I need to support and even more so, it’s tedious to write out all the definitions (especially if I end up refactoring things a couple times like I tend to do).
I had some trouble figuring out how optional fields work. Are they zeroed out? Is there some indication of which fields are excluded from the data?
It is going to be slow to test, especially on Linux…because I suck at Linux.
The FIT SDK contains all the information needed to decipher the binary format. The first thing I would like to do is create some tests which validate conversion to and from CSV/FIT because that’s what an example program in the FIT SDK does.
First, let’s document what comes in that zip file
D00001384 FIT SDK Introductory Guide Rev 2.5.pdf – This covers what the SDK provides. I don’t plan on using this too much.
D00001275 Flexible & Interoperable Data Transfer (FIT) Protocol Rev 2.4.pdf – This describes the FIT format in detail but does not go into the binary representation of the different data types.
Profile.xlsx – Binary values associated with fields in a FIT file.