mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-06-01 19:06:06 +02:00
1328ce13e1
* Remove the dependency on PredefinedLocalMessage from generic fit parsing code * Standardize toString methods, omit types for known fields * Return null on unknown field number or names, instead of crashing * Map more Global FIT messages (device info, monitoring, sleep stages, sleep stats, stress level) * Prioritize "timestamp" over "253_timestamp" if specified explicitly in the global message definition * Introduce RecordData wrappers for each global message, allowing us to have proper types when getting data. If missing or unknown, the getter returns null. All classes are auto-generated by the FitCodeGen. * Persist a list of RecordData, instead of a Map from RecordDefinition * Fix parsing of compressed timestamps - keep them in computedTimestamp on each data record * Use timestamp16 if available in Monitoring records
33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages;
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.RecordData;
|
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.RecordDefinition;
|
|
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.RecordHeader;
|
|
|
|
//
|
|
// WARNING: This class was auto-generated, please avoid modifying it directly.
|
|
// See nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.codegen.FitCodeGen
|
|
//
|
|
public class FitDeveloperData extends RecordData {
|
|
public FitDeveloperData(final RecordDefinition recordDefinition, final RecordHeader recordHeader) {
|
|
super(recordDefinition, recordHeader);
|
|
|
|
final int globalNumber = recordDefinition.getGlobalFITMessage().getNumber();
|
|
if (globalNumber != 207) {
|
|
throw new IllegalArgumentException("FitFileId expects global messages of " + 207 + ", got " + globalNumber);
|
|
}
|
|
}
|
|
|
|
@Nullable
|
|
public Integer getApplicationId() {
|
|
return (Integer) getFieldByNumber(1);
|
|
}
|
|
|
|
@Nullable
|
|
public Integer getDeveloperDataIndex() {
|
|
return (Integer) getFieldByNumber(3);
|
|
}
|
|
}
|