1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2025-01-13 11:17:33 +01:00

Garmin: Map more fit session fields

This commit is contained in:
José Rebelo 2024-10-02 22:01:24 +01:00
parent 577b636f5c
commit 10da6a27ce
2 changed files with 61 additions and 1 deletions

View File

@ -106,8 +106,18 @@ public class GlobalFITMessage {
new FieldDefinitionPrimitive(19, BaseType.UINT8, "max_cadence"),
new FieldDefinitionPrimitive(22, BaseType.UINT16, "total_ascent"),
new FieldDefinitionPrimitive(23, BaseType.UINT16, "total_descent"),
new FieldDefinitionPrimitive(25, BaseType.UINT16, "first_lap_index"),
new FieldDefinitionPrimitive(26, BaseType.UINT16, "num_laps"),
new FieldDefinitionPrimitive(29, BaseType.SINT32, "nec_latitude", FieldDefinitionFactory.FIELD.COORDINATE),
new FieldDefinitionPrimitive(30, BaseType.SINT32, "nec_longitude", FieldDefinitionFactory.FIELD.COORDINATE),
new FieldDefinitionPrimitive(31, BaseType.SINT32, "swc_latitude", FieldDefinitionFactory.FIELD.COORDINATE),
new FieldDefinitionPrimitive(32, BaseType.SINT32, "swc_longitude", FieldDefinitionFactory.FIELD.COORDINATE),
new FieldDefinitionPrimitive(38, BaseType.SINT32, "end_latitude", FieldDefinitionFactory.FIELD.COORDINATE),
new FieldDefinitionPrimitive(39, BaseType.SINT32, "end_longitude", FieldDefinitionFactory.FIELD.COORDINATE),
new FieldDefinitionPrimitive(110, BaseType.STRING, 64, "sport_profile_name"),
new FieldDefinitionPrimitive(178, BaseType.UINT16, "estimated_sweat_loss"),
new FieldDefinitionPrimitive(124, BaseType.UINT32, "enhanced_avg_speed", 1000, 0), // m/s
new FieldDefinitionPrimitive(125, BaseType.UINT32, "enhanced_max_speed", 1000, 0), // m/s
new FieldDefinitionPrimitive(178, BaseType.UINT16, "estimated_sweat_loss"), // ml
new FieldDefinitionPrimitive(253, BaseType.UINT32, "timestamp", FieldDefinitionFactory.FIELD.TIMESTAMP)
));

View File

@ -110,11 +110,61 @@ public class FitSession extends RecordData {
return (Integer) getFieldByNumber(23);
}
@Nullable
public Integer getFirstLapIndex() {
return (Integer) getFieldByNumber(25);
}
@Nullable
public Integer getNumLaps() {
return (Integer) getFieldByNumber(26);
}
@Nullable
public Double getNecLatitude() {
return (Double) getFieldByNumber(29);
}
@Nullable
public Double getNecLongitude() {
return (Double) getFieldByNumber(30);
}
@Nullable
public Double getSwcLatitude() {
return (Double) getFieldByNumber(31);
}
@Nullable
public Double getSwcLongitude() {
return (Double) getFieldByNumber(32);
}
@Nullable
public Double getEndLatitude() {
return (Double) getFieldByNumber(38);
}
@Nullable
public Double getEndLongitude() {
return (Double) getFieldByNumber(39);
}
@Nullable
public String getSportProfileName() {
return (String) getFieldByNumber(110);
}
@Nullable
public Double getEnhancedAvgSpeed() {
return (Double) getFieldByNumber(124);
}
@Nullable
public Double getEnhancedMaxSpeed() {
return (Double) getFieldByNumber(125);
}
@Nullable
public Integer getEstimatedSweatLoss() {
return (Integer) getFieldByNumber(178);