Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

hr messages not included in data size?

Rank

Total Posts: 4

Joined 0

PM

Hi, I'm just getting to grips with hr messages (e.g. filtered_bpm, etc) and I'm struggling a little. I'll post a second question as this one relates to the header...

Section 3.3 FIT File Structure (page 13) of the FIT protocol v2.3 defines FIT files as being:
1. FileHeader (14 bytes)
2. Data Records (varying length)
- Definition Messages
- Data Messages
3. CRC (2 bytes)

I had assumed that Data Size, read from the file header, specifies the length of the data records, but it seems to me that it doesn't include everything e.g. hr messages?

I have a PHP project (https://github.com/adriangibbons/php-fit-file-analysis) that is not playing nicely with FIT files from a Fenix 5 that contain hr messages.

The script fails a check where it tests the file size is equal to 14 bytes + data size + 2 bytes. Instead, I have to set data size as file size - 14 - 2, which feels wrong to me...

Can anyone shed light on if there is anything special about hr messages? I see there are plugins for C++ and Java, which I am trying to reverse engineer into my PHP project but with little joy over the past couple of days!

Regards, Adrian.