forked from subsurface/libdc
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
garmin: relax file name length rules
We end up using the FIT file name as the "fingerprint" for the dive, and include it at the beginning of the dive data as such. And because of how Garmin encoded the FIT files, we ended up having a fixed 24-byte length for this, which is normally the date encoding: YYYY-MM-DD-HH-MM-SS.FIT with the terminating NUL character. Of course, then Garmin started using a short-form encoding too (presumably due to FAT filesystem limits), and we have magic code to sort the dates properly, using the name format YMDHMMSS.FIT with the numbers encoded in a shorter format (eg "C4ND0302.fit" is equivalent to "2022-04-23-13-03-02.fit"). See name_cmp() and parse_short_name() for details. Anyway, because we use the (zero-padded) 24 characters of the name as the fingerprint, we used a fixed-size buffer for the filename that was limited to that maximum size Garmin creates. But then you download those things, and have multiple vendors, and suddenly that 24-character limit on the filename is very annoying. Instead of fixing this in some clean and generic way, let's just raise the namelength limit to something bigger, and continue to use the first 24 characters of the name for the fingerprint. Pretty it isn't, but it makes it slightly easier to import random FIT files that don't conform exactly to the traditional Garmin format. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
- Loading branch information
Showing
3 changed files
with
24 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters