muktihari / fit

A FIT SDK for decoding and encoding Garmin FIT files in Go supporting FIT Protocol V2.
BSD 3-Clause "New" or "Revised" License
42 stars 4 forks source link

feat!: encoder compress timestamp with multiple local message type #439

Closed muktihari closed 2 months ago

muktihari commented 2 months ago

At the beginning, I thought that when using compressed timestamp, we can only use local message type zero, but after a year, I re-read the documentation again, it turns out that we can use 0-3 local message type.

Message (Data) 's Header bit layout: Bit Value Desc
7 1 Compressed Timestamp Header
5 – 6 0 - 3 Local Message Type
0 - 4 0 - 31 Time Offset (seconds)

With this being implemented, I think how FIT SDK handle compressed timestamp is finally completed. This change comes with breaking changes, dropping WithNormalHeader and WithCompressedTimestampHeader encoder options, replaced with WithHeaderOption

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (c5bf0c3) to head (05e4d16).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #439 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 42 42 Lines 3661 3664 +3 ========================================= + Hits 3661 3664 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.