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>
Overview ======== Libdivecomputer is a cross-platform and open source library for communication with dive computers from various manufacturers. The official web site is: http://www.libdivecomputer.org/ The sourceforge project page is: http://sourceforge.net/projects/libdivecomputer/ Installation ============ On UNIX-like systems (including Linux, Mac OS X, MinGW), use the autotools based build system. Run the following commands from the top directory (containing this file) to configure, build and install the library and utilities: $ ./configure $ make $ make install If you downloaded the libdivecomputer source code directly from the git source code repository, then you need to create the configure script as the first step: $ autoreconf --install To uninstall libdivecomputer again, run: $ make uninstall Support ======= Please send bug reports, feedback or questions to the mailing list: http://libdivecomputer.org/cgi-bin/mailman/listinfo/devel or contact me directly: jef@libdivecomputer.org License ======= Libdivecomputer is free software, released under the terms of the GNU Lesser General Public License (LGPL). You can find a copy of the license in the file COPYING.
Description
Languages
C
98.3%
M4
1.2%
Makefile
0.5%