1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-09 03:37:03 +01:00

Garmin: Add total steps, avg and max cadence

This commit is contained in:
José Rebelo 2024-09-21 19:08:31 +01:00
parent d1426595e6
commit 4d912cf252
3 changed files with 27 additions and 0 deletions

View File

@ -164,6 +164,9 @@ public class GarminWorkoutParser implements ActivitySummaryParser {
if (session.getTotalDistance() != null) {
summaryData.add(DISTANCE_METERS, session.getTotalDistance() / 100f, UNIT_METERS);
}
if (session.getTotalSteps() != null) {
summaryData.add(STEPS, session.getTotalSteps(), UNIT_STEPS);
}
if (session.getTotalCalories() != null) {
summaryData.add(CALORIES_BURNT, session.getTotalCalories(), UNIT_KCAL);
}
@ -176,6 +179,12 @@ public class GarminWorkoutParser implements ActivitySummaryParser {
if (session.getMaxHeartRate() != null) {
summaryData.add(HR_MAX, session.getMaxHeartRate(), UNIT_BPM);
}
if (session.getAverageCadence() != null) {
summaryData.add(CADENCE_AVG, session.getAverageCadence(), UNIT_SPM);
}
if (session.getMaxCadence() != null) {
summaryData.add(CADENCE_MAX, session.getMaxCadence(), UNIT_SPM);
}
if (session.getTotalAscent() != null) {
summaryData.add(ASCENT_DISTANCE, session.getTotalAscent(), UNIT_METERS);
}

View File

@ -98,9 +98,12 @@ public class GlobalFITMessage {
new FieldDefinitionPrimitive(7, BaseType.UINT32, "total_elapsed_time"), // with pauses
new FieldDefinitionPrimitive(8, BaseType.UINT32, "total_timer_time"), // no pauses
new FieldDefinitionPrimitive(9, BaseType.UINT32, "total_distance"),
new FieldDefinitionPrimitive(10, BaseType.UINT32, "total_steps"),
new FieldDefinitionPrimitive(11, BaseType.UINT16, "total_calories"),
new FieldDefinitionPrimitive(16, BaseType.UINT8, "average_heart_rate"),
new FieldDefinitionPrimitive(17, BaseType.UINT8, "max_heart_rate"),
new FieldDefinitionPrimitive(18, BaseType.UINT8, "average_cadence"),
new FieldDefinitionPrimitive(19, BaseType.UINT8, "max_cadence"),
new FieldDefinitionPrimitive(22, BaseType.UINT16, "total_ascent"),
new FieldDefinitionPrimitive(23, BaseType.UINT16, "total_descent"),
new FieldDefinitionPrimitive(110, BaseType.STRING, 64, "sport_profile_name"),

View File

@ -70,6 +70,11 @@ public class FitSession extends RecordData {
return (Long) getFieldByNumber(9);
}
@Nullable
public Long getTotalSteps() {
return (Long) getFieldByNumber(10);
}
@Nullable
public Integer getTotalCalories() {
return (Integer) getFieldByNumber(11);
@ -85,6 +90,16 @@ public class FitSession extends RecordData {
return (Integer) getFieldByNumber(17);
}
@Nullable
public Integer getAverageCadence() {
return (Integer) getFieldByNumber(18);
}
@Nullable
public Integer getMaxCadence() {
return (Integer) getFieldByNumber(19);
}
@Nullable
public Integer getTotalAscent() {
return (Integer) getFieldByNumber(22);