diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/GarminWorkoutParser.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/GarminWorkoutParser.java index be815fa17..770ca9352 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/GarminWorkoutParser.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/garmin/GarminWorkoutParser.java @@ -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); } diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/garmin/fit/GlobalFITMessage.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/garmin/fit/GlobalFITMessage.java index 9eff50451..2a49b5e7c 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/garmin/fit/GlobalFITMessage.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/garmin/fit/GlobalFITMessage.java @@ -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"), diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/garmin/fit/messages/FitSession.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/garmin/fit/messages/FitSession.java index ab63e5099..a4b7e0f27 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/garmin/fit/messages/FitSession.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/garmin/fit/messages/FitSession.java @@ -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);