mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-06-14 09:00:04 +02:00
Garmin: Make fit header crc optional
This commit is contained in:
parent
c13d825322
commit
c63207f7de
|
@ -192,7 +192,7 @@ public class FitFile {
|
||||||
if (hasCRC) {
|
if (hasCRC) {
|
||||||
int incomingCrc = garminByteBufferReader.readShort();
|
int incomingCrc = garminByteBufferReader.readShort();
|
||||||
|
|
||||||
if (incomingCrc != ChecksumCalculator.computeCrc(garminByteBufferReader.asReadOnlyBuffer(), 0, headerSize - 2)) {
|
if (incomingCrc != 0 && incomingCrc != ChecksumCalculator.computeCrc(garminByteBufferReader.asReadOnlyBuffer(), 0, headerSize - 2)) {
|
||||||
throw new IllegalArgumentException("Wrong CRC for header in FIT file");
|
throw new IllegalArgumentException("Wrong CRC for header in FIT file");
|
||||||
}
|
}
|
||||||
// LOG.info("Fit File Header didn't have CRC, no check performed.");
|
// LOG.info("Fit File Header didn't have CRC, no check performed.");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user