mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Garmin: extend FIT file parsing 2
This commit is contained in:
committed by
José Rebelo
parent
c2a32ce42f
commit
b1323b6fd1
+122
-17
@@ -97,7 +97,7 @@ public class GlobalFITMessage {
|
||||
));
|
||||
|
||||
public static GlobalFITMessage HRM_PROFILE = new GlobalFITMessage(4, "HRM_PROFILE", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(0, BaseType.ENUM, "enabled"),
|
||||
new FieldDefinitionPrimitive(0, BaseType.UINT8, "enabled"),
|
||||
new FieldDefinitionPrimitive(1, BaseType.UINT16Z, "hrm_ant_id"),
|
||||
new FieldDefinitionPrimitive(2, BaseType.ENUM, "log_hrv"),
|
||||
new FieldDefinitionPrimitive(3, BaseType.UINT8Z, "hrm_ant_id_trans_type"),
|
||||
@@ -128,15 +128,15 @@ public class GlobalFITMessage {
|
||||
new FieldDefinitionPrimitive(9, BaseType.UINT16, "auto_wheelsize", 1000, 0), // m
|
||||
new FieldDefinitionPrimitive(10, BaseType.UINT16, "bike_weight", 10, 0), // kg
|
||||
new FieldDefinitionPrimitive(11, BaseType.UINT16, "power_cal_factor", 10, 0), // %
|
||||
new FieldDefinitionPrimitive(12, BaseType.ENUM, "auto_wheel_cal"),
|
||||
new FieldDefinitionPrimitive(13, BaseType.ENUM, "auto_power_zero"),
|
||||
new FieldDefinitionPrimitive(12, BaseType.UINT8, "auto_wheel_cal"),
|
||||
new FieldDefinitionPrimitive(13, BaseType.UINT8, "auto_power_zero"),
|
||||
new FieldDefinitionPrimitive(14, BaseType.UINT8, "id"),
|
||||
new FieldDefinitionPrimitive(15, BaseType.ENUM, "spd_enabled"),
|
||||
new FieldDefinitionPrimitive(16, BaseType.ENUM, "cad_enabled"),
|
||||
new FieldDefinitionPrimitive(17, BaseType.ENUM, "spdcad_enabled"),
|
||||
new FieldDefinitionPrimitive(18, BaseType.ENUM, "power_enabled"),
|
||||
new FieldDefinitionPrimitive(15, BaseType.UINT8, "spd_enabled"),
|
||||
new FieldDefinitionPrimitive(16, BaseType.UINT8, "cad_enabled"),
|
||||
new FieldDefinitionPrimitive(17, BaseType.UINT8, "spdcad_enabled"),
|
||||
new FieldDefinitionPrimitive(18, BaseType.UINT8, "power_enabled"),
|
||||
new FieldDefinitionPrimitive(19, BaseType.UINT8, "crank_length", 2, -100), // mm
|
||||
new FieldDefinitionPrimitive(20, BaseType.ENUM, "enabled"),
|
||||
new FieldDefinitionPrimitive(20, BaseType.UINT8, "enabled"),
|
||||
new FieldDefinitionPrimitive(21, BaseType.UINT8Z, "bike_spd_ant_id_trans_type"),
|
||||
new FieldDefinitionPrimitive(22, BaseType.UINT8Z, "bike_cad_ant_id_trans_type"),
|
||||
new FieldDefinitionPrimitive(23, BaseType.UINT8Z, "bike_spdcad_ant_id_trans_type"),
|
||||
@@ -227,8 +227,8 @@ public class GlobalFITMessage {
|
||||
new FieldDefinitionPrimitive(19, BaseType.UINT8, "max_cadence"), // rpm
|
||||
new FieldDefinitionPrimitive(20, BaseType.UINT16, "avg_power"), // watt
|
||||
new FieldDefinitionPrimitive(21, BaseType.UINT16, "max_power"), // watt
|
||||
new FieldDefinitionPrimitive(22, BaseType.UINT16, "total_ascent"),
|
||||
new FieldDefinitionPrimitive(23, BaseType.UINT16, "total_descent"),
|
||||
new FieldDefinitionPrimitive(22, BaseType.UINT16, "total_ascent"), // m
|
||||
new FieldDefinitionPrimitive(23, BaseType.UINT16, "total_descent"), // m
|
||||
new FieldDefinitionPrimitive(24, BaseType.UINT8, "total_training_effect", 10, 0),
|
||||
new FieldDefinitionPrimitive(25, BaseType.UINT16, "first_lap_index"),
|
||||
new FieldDefinitionPrimitive(26, BaseType.UINT16, "num_laps"),
|
||||
@@ -253,8 +253,8 @@ public class GlobalFITMessage {
|
||||
new FieldDefinitionPrimitive(46, BaseType.ENUM, "pool_length_unit"),
|
||||
new FieldDefinitionPrimitive(47, BaseType.UINT16, "num_active_lengths"),
|
||||
new FieldDefinitionPrimitive(48, BaseType.UINT32, "total_work"), // joule
|
||||
new FieldDefinitionPrimitive(49, BaseType.UINT32, "avg_altitude", 5, 500), // m
|
||||
new FieldDefinitionPrimitive(50, BaseType.UINT32, "max_altitude", 5, 500), // m
|
||||
new FieldDefinitionPrimitive(49, BaseType.UINT16, "avg_altitude", 5, 500), // m
|
||||
new FieldDefinitionPrimitive(50, BaseType.UINT16, "max_altitude", 5, 500), // m
|
||||
new FieldDefinitionPrimitive(51, BaseType.UINT8, "gps_accuracy"), // m
|
||||
new FieldDefinitionPrimitive(52, BaseType.SINT16, "avg_grade", 100, 0), // %
|
||||
new FieldDefinitionPrimitive(53, BaseType.SINT16, "avg_pos_grade", 100, 0), // %
|
||||
@@ -416,6 +416,7 @@ public class GlobalFITMessage {
|
||||
new FieldDefinitionPrimitive(55, BaseType.SINT16, "max_pos_vertical_speed", 1000, 0), // m/s
|
||||
new FieldDefinitionPrimitive(56, BaseType.SINT16, "max_neg_vertical_speed", 1000, 0), // m/s
|
||||
new FieldDefinitionPrimitive(57, BaseType.UINT32, "time_in_hr_zone", 1000, 0), // s
|
||||
new FieldDefinitionPrimitive(62, BaseType.UINT16, "min_altitude", 5, 500), // m
|
||||
new FieldDefinitionPrimitive(71, BaseType.UINT16, "wkt_step_index"),
|
||||
new FieldDefinitionPrimitive(73, BaseType.UINT16, "avg_swolf"),
|
||||
new FieldDefinitionPrimitive(80, BaseType.UINT8, "avg_fractional_cadence", 128, 0), // rpm
|
||||
@@ -432,6 +433,10 @@ public class GlobalFITMessage {
|
||||
new FieldDefinitionPrimitive(109, BaseType.UINT8, "max_cadence_position"), // rpm
|
||||
new FieldDefinitionPrimitive(110, BaseType.UINT32, "enhanced_avg_speed", 100, 0), // m/s
|
||||
new FieldDefinitionPrimitive(111, BaseType.UINT32, "enhanced_max_speed", 100, 0), // m/s
|
||||
new FieldDefinitionPrimitive(124, BaseType.SINT8, "min_temperature"), // °C
|
||||
new FieldDefinitionPrimitive(158, BaseType.UINT16, "avg_core_temperature", 100, 0), // °C
|
||||
new FieldDefinitionPrimitive(159, BaseType.UINT16, "min_core_temperature", 100, 0), // °C
|
||||
new FieldDefinitionPrimitive(160, BaseType.UINT16, "max_core_temperature", 100, 0), // °C
|
||||
new FieldDefinitionPrimitive(253, BaseType.UINT32, "timestamp", FieldDefinitionFactory.FIELD.TIMESTAMP),
|
||||
new FieldDefinitionPrimitive(254, BaseType.UINT16, "message_index")
|
||||
));
|
||||
@@ -597,7 +602,20 @@ public class GlobalFITMessage {
|
||||
|
||||
public static GlobalFITMessage COURSE = new GlobalFITMessage(31, "COURSE", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(4, BaseType.ENUM, "sport"),
|
||||
new FieldDefinitionPrimitive(5, BaseType.STRING, 16, "name")
|
||||
new FieldDefinitionPrimitive(5, BaseType.STRING, 16, "name"),
|
||||
new FieldDefinitionPrimitive(6, BaseType.UINT32Z, "capabilities"),
|
||||
new FieldDefinitionPrimitive(7, BaseType.ENUM, "sub_sport")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage COURSE_POINT = new GlobalFITMessage(32, "COURSE_POINT", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(1, BaseType.UINT32, "timestamp", FieldDefinitionFactory.FIELD.TIMESTAMP),
|
||||
new FieldDefinitionPrimitive(2, BaseType.SINT32, "position_lat", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(3, BaseType.SINT32, "position_long", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(4, BaseType.UINT32, "distance", 100, 0), // m
|
||||
new FieldDefinitionPrimitive(5, BaseType.ENUM, "type"),
|
||||
new FieldDefinitionPrimitive(6, BaseType.STRING, 16, "name"),
|
||||
new FieldDefinitionPrimitive(8, BaseType.ENUM, "favorite"),
|
||||
new FieldDefinitionPrimitive(254, BaseType.UINT16, "message_index")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage TOTALS = new GlobalFITMessage(33, "TOTALS", Arrays.asList(
|
||||
@@ -835,6 +853,37 @@ public class GlobalFITMessage {
|
||||
new FieldDefinitionPrimitive(253, BaseType.UINT32, "timestamp", FieldDefinitionFactory.FIELD.TIMESTAMP)
|
||||
));
|
||||
|
||||
public static GlobalFITMessage SEGMENT_LAP = new GlobalFITMessage(142, "SEGMENT_LAP", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(3, BaseType.SINT32, "start_position_lat", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(4, BaseType.SINT32, "start_position_long", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(5, BaseType.SINT32, "end_position_lat", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(6, BaseType.SINT32, "end_position_long", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(9, BaseType.UINT32, "total_distance", 100, 0), // m
|
||||
new FieldDefinitionPrimitive(21, BaseType.UINT16, "total_ascent"), // m
|
||||
new FieldDefinitionPrimitive(22, BaseType.UINT16, "total_descent"), // m
|
||||
new FieldDefinitionPrimitive(23, BaseType.ENUM, "sport"),
|
||||
new FieldDefinitionPrimitive(25, BaseType.SINT32, "nec_lat", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(26, BaseType.SINT32, "nec_long", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(27, BaseType.SINT32, "swc_lat", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(28, BaseType.SINT32, "swc_long", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(29, BaseType.STRING, 50, "name"),
|
||||
new FieldDefinitionPrimitive(42, BaseType.SINT8, "avg_temperature"), // °C
|
||||
new FieldDefinitionPrimitive(43, BaseType.SINT8, "max_temperature"), // °C
|
||||
new FieldDefinitionPrimitive(65, BaseType.STRING, 33, "uuid"),
|
||||
new FieldDefinitionPrimitive(89, BaseType.UINT8, "total_fractional_ascent", 100, 0), // m
|
||||
new FieldDefinitionPrimitive(90, BaseType.UINT8, "total_fractional_descent", 100, 0), // m
|
||||
new FieldDefinitionPrimitive(253, BaseType.UINT32, "timestamp", FieldDefinitionFactory.FIELD.TIMESTAMP),
|
||||
new FieldDefinitionPrimitive(254, BaseType.UINT16, "message_index")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage MEMO_GLOB = new GlobalFITMessage(145, "MEMO_GLOB", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(1, BaseType.UINT16, "mesg_num"),
|
||||
new FieldDefinitionPrimitive(2, BaseType.UINT16, "parent_index"),
|
||||
new FieldDefinitionPrimitive(3, BaseType.UINT8, "field_num"),
|
||||
new FieldDefinitionPrimitive(4, BaseType.UINT8Z, "data"),
|
||||
new FieldDefinitionPrimitive(250, BaseType.UINT32, "part_index")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage SENSOR_SETTINGS = new GlobalFITMessage(147, "SENSOR_SETTINGS", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(0, BaseType.UINT32Z, "ant_id"),
|
||||
new FieldDefinitionPrimitive(2, BaseType.STRING, "name"),
|
||||
@@ -844,6 +893,37 @@ public class GlobalFITMessage {
|
||||
new FieldDefinitionPrimitive(254, BaseType.UINT16, "message_index")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage SEGMENT_ID = new GlobalFITMessage(148, "SEGMENT_ID", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(0, BaseType.STRING, 50, "name"),
|
||||
new FieldDefinitionPrimitive(1, BaseType.STRING, 33, "uuid"),
|
||||
new FieldDefinitionPrimitive(2, BaseType.ENUM, "sport"),
|
||||
new FieldDefinitionPrimitive(3, BaseType.ENUM, "enabled"),
|
||||
new FieldDefinitionPrimitive(4, BaseType.UINT32, "user_profile_primary_key"),
|
||||
new FieldDefinitionPrimitive(5, BaseType.UINT32, "device_id"),
|
||||
new FieldDefinitionPrimitive(6, BaseType.UINT8, "default_race_leader"),
|
||||
new FieldDefinitionPrimitive(7, BaseType.ENUM, "delete_status"),
|
||||
new FieldDefinitionPrimitive(8, BaseType.ENUM, "selection_type")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage SEGMENT_LEADERBOARD_ENTRY = new GlobalFITMessage(149, "SEGMENT_LEADERBOARD_ENTRY", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(0, BaseType.STRING, 100, "name"),
|
||||
new FieldDefinitionPrimitive(1, BaseType.ENUM, "type"),
|
||||
new FieldDefinitionPrimitive(2, BaseType.UINT32, "group_primary_key"),
|
||||
new FieldDefinitionPrimitive(3, BaseType.UINT32, "activity_id"),
|
||||
new FieldDefinitionPrimitive(4, BaseType.UINT32, "segment_time", 1000, 0), // s
|
||||
new FieldDefinitionPrimitive(5, BaseType.STRING, 22, "activity_id_string"),
|
||||
new FieldDefinitionPrimitive(254, BaseType.UINT16, "message_index")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage SEGMENT_POINT = new GlobalFITMessage(150, "SEGMENT_POINT", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(1, BaseType.SINT32, "position_lat", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(2, BaseType.SINT32, "position_long", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(3, BaseType.UINT32, "distance", 100, 0), // m
|
||||
new FieldDefinitionPrimitive(5, BaseType.UINT32, 6,"leader_time", FieldDefinitionFactory.FIELD.ARRAY, 1000, 0), // s
|
||||
new FieldDefinitionPrimitive(6, BaseType.UINT32, "enhanced_altitude", 5, 500), // m
|
||||
new FieldDefinitionPrimitive(254, BaseType.UINT16, "message_index")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage SEGMENT_FILE = new GlobalFITMessage(151, "SEGMENT_FILE", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(1, BaseType.STRING, "file_uuid"),
|
||||
new FieldDefinitionPrimitive(3, BaseType.ENUM, "enabled"),
|
||||
@@ -1144,10 +1224,10 @@ public class GlobalFITMessage {
|
||||
new FieldDefinitionPrimitive(9, BaseType.UINT32, "start_time"),
|
||||
new FieldDefinitionPrimitive(13, BaseType.UINT16, "total_ascent"), // meter
|
||||
new FieldDefinitionPrimitive(14, BaseType.UINT16, "total_descent"), // meter
|
||||
new FieldDefinitionPrimitive(21, BaseType.SINT32, "start_position_lat"),
|
||||
new FieldDefinitionPrimitive(22, BaseType.SINT32, "start_position_long"),
|
||||
new FieldDefinitionPrimitive(23, BaseType.SINT32, "end_position_lat"),
|
||||
new FieldDefinitionPrimitive(24, BaseType.SINT32, "end_position_long"),
|
||||
new FieldDefinitionPrimitive(21, BaseType.SINT32, "start_position_lat", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(22, BaseType.SINT32, "start_position_long", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(23, BaseType.SINT32, "end_position_lat", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(24, BaseType.SINT32, "end_position_long", FieldDefinitionFactory.FIELD.COORDINATE),
|
||||
new FieldDefinitionPrimitive(25, BaseType.UINT32, "max_speed", 1000, 0), // meter / second
|
||||
new FieldDefinitionPrimitive(26, BaseType.SINT32, "avg_vert_speed", 1000, 0), // meter / second
|
||||
new FieldDefinitionPrimitive(27, BaseType.UINT32, "end_time"),
|
||||
@@ -1157,6 +1237,24 @@ public class GlobalFITMessage {
|
||||
new FieldDefinitionPrimitive(254, BaseType.UINT16, "message_index")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage SPLIT_SUMMARY = new GlobalFITMessage(313, "SPLIT_SUMMARY", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(0, BaseType.ENUM, "split_type"),
|
||||
new FieldDefinitionPrimitive(3, BaseType.UINT16, "num_splits"),
|
||||
new FieldDefinitionPrimitive(4, BaseType.UINT32, "total_timer_time", 1000, 0), // s
|
||||
new FieldDefinitionPrimitive(5, BaseType.UINT32, "total_distance", 100, 0), // m
|
||||
new FieldDefinitionPrimitive(6, BaseType.UINT32, "avg_speed", 1000, 0), // m/s
|
||||
new FieldDefinitionPrimitive(7, BaseType.UINT32, "max_speed", 1000, 0), // m/s
|
||||
new FieldDefinitionPrimitive(8, BaseType.UINT16, "total_ascent"), // m
|
||||
new FieldDefinitionPrimitive(9, BaseType.UINT16, "total_descent"), // m
|
||||
new FieldDefinitionPrimitive(10, BaseType.UINT8, "avg_heart_rate"), // bpm
|
||||
new FieldDefinitionPrimitive(11, BaseType.UINT8, "max_heart_rate"), // bpm
|
||||
new FieldDefinitionPrimitive(12, BaseType.SINT32, "avg_vert_speed", 1000, 0), // m/s
|
||||
new FieldDefinitionPrimitive(13, BaseType.UINT32, "total_calories"), // kcal
|
||||
new FieldDefinitionPrimitive(77, BaseType.UINT32, "total_moving_time", 1000, 0), // s
|
||||
new FieldDefinitionPrimitive(253, BaseType.UINT32, "timestamp", FieldDefinitionFactory.FIELD.TIMESTAMP),
|
||||
new FieldDefinitionPrimitive(254, BaseType.UINT16, "message_index")
|
||||
));
|
||||
|
||||
public static GlobalFITMessage HSA_BODY_BATTERY_DATA = new GlobalFITMessage(314, "HSA_BODY_BATTERY_DATA", Arrays.asList(
|
||||
new FieldDefinitionPrimitive(0, BaseType.UINT16, "processing_interval"), // seconds
|
||||
new FieldDefinitionPrimitive(1, BaseType.SINT8, "level", FieldDefinitionFactory.FIELD.ARRAY), // %
|
||||
@@ -1331,6 +1429,7 @@ public class GlobalFITMessage {
|
||||
put(27, WORKOUT_STEP);
|
||||
put(30, WEIGHT_SCALE);
|
||||
put(31, COURSE);
|
||||
put(32, COURSE_POINT);
|
||||
put(33, TOTALS);
|
||||
put(34, ACTIVITY);
|
||||
put(35, SOFTWARE);
|
||||
@@ -1352,7 +1451,12 @@ public class GlobalFITMessage {
|
||||
put(132, HR);
|
||||
put(140, PHYSIOLOGICAL_METRICS);
|
||||
put(141, EPO_STATUS);
|
||||
put(142, SEGMENT_LAP);
|
||||
put(145, MEMO_GLOB);
|
||||
put(147, SENSOR_SETTINGS);
|
||||
put(148, SEGMENT_ID);
|
||||
put(149, SEGMENT_LEADERBOARD_ENTRY);
|
||||
put(150, SEGMENT_POINT);
|
||||
put(151, SEGMENT_FILE);
|
||||
put(158, WORKOUT_SESSION);
|
||||
put(159, WATCHFACE_SETTINGS);
|
||||
@@ -1384,6 +1488,7 @@ public class GlobalFITMessage {
|
||||
put(307, HSA_RESPIRATION_DATA);
|
||||
put(308, HSA_HEART_RATE_DATA);
|
||||
put(312, SPLIT);
|
||||
put(313, SPLIT_SUMMARY);
|
||||
put(314, HSA_BODY_BATTERY_DATA);
|
||||
put(315, HSA_EVENT);
|
||||
put(319, TANK_UPDATE);
|
||||
|
||||
+20
@@ -48,6 +48,16 @@ public class FitCourse extends RecordData {
|
||||
return (String) getFieldByNumber(5);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getCapabilities() {
|
||||
return (Long) getFieldByNumber(6);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getSubSport() {
|
||||
return (Integer) getFieldByNumber(7);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
@@ -66,6 +76,16 @@ public class FitCourse extends RecordData {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setCapabilities(final Long value) {
|
||||
setFieldByNumber(6, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSubSport(final Integer value) {
|
||||
setFieldByNumber(7, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FitCourse build() {
|
||||
return (FitCourse) super.build();
|
||||
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
/* Copyright (C) 2025 Freeyourgadget
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.FitRecordDataBuilder;
|
||||
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 {@link nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.codegen.FitCodeGen}
|
||||
* @noinspection unused
|
||||
*/
|
||||
public class FitCoursePoint extends RecordData {
|
||||
public FitCoursePoint(final RecordDefinition recordDefinition, final RecordHeader recordHeader) {
|
||||
super(recordDefinition, recordHeader);
|
||||
|
||||
final int globalNumber = recordDefinition.getGlobalFITMessage().getNumber();
|
||||
if (globalNumber != 32) {
|
||||
throw new IllegalArgumentException("FitCoursePoint expects global messages of " + 32 + ", got " + globalNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getTimestamp() {
|
||||
return (Long) getFieldByNumber(1);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getPositionLat() {
|
||||
return (Double) getFieldByNumber(2);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getPositionLong() {
|
||||
return (Double) getFieldByNumber(3);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getDistance() {
|
||||
return (Double) getFieldByNumber(4);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getType() {
|
||||
return (Integer) getFieldByNumber(5);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getName() {
|
||||
return (String) getFieldByNumber(6);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getFavorite() {
|
||||
return (Integer) getFieldByNumber(8);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getMessageIndex() {
|
||||
return (Integer) getFieldByNumber(254);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
public static class Builder extends FitRecordDataBuilder {
|
||||
public Builder() {
|
||||
super(32);
|
||||
}
|
||||
|
||||
public Builder setTimestamp(final Long value) {
|
||||
setFieldByNumber(1, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPositionLat(final Double value) {
|
||||
setFieldByNumber(2, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPositionLong(final Double value) {
|
||||
setFieldByNumber(3, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDistance(final Double value) {
|
||||
setFieldByNumber(4, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setType(final Integer value) {
|
||||
setFieldByNumber(5, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setName(final String value) {
|
||||
setFieldByNumber(6, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setFavorite(final Integer value) {
|
||||
setFieldByNumber(8, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessageIndex(final Integer value) {
|
||||
setFieldByNumber(254, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FitCoursePoint build() {
|
||||
return (FitCoursePoint) super.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
+50
@@ -299,6 +299,11 @@ public class FitLap extends RecordData {
|
||||
return (Double) getFieldByNumber(57);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Float getMinAltitude() {
|
||||
return (Float) getFieldByNumber(62);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getWktStepIndex() {
|
||||
return (Integer) getFieldByNumber(71);
|
||||
@@ -379,6 +384,26 @@ public class FitLap extends RecordData {
|
||||
return (Double) getFieldByNumber(111);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getMinTemperature() {
|
||||
return (Integer) getFieldByNumber(124);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Float getAvgCoreTemperature() {
|
||||
return (Float) getFieldByNumber(158);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Float getMinCoreTemperature() {
|
||||
return (Float) getFieldByNumber(159);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Float getMaxCoreTemperature() {
|
||||
return (Float) getFieldByNumber(160);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getTimestamp() {
|
||||
return (Long) getFieldByNumber(253);
|
||||
@@ -657,6 +682,11 @@ public class FitLap extends RecordData {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMinAltitude(final Float value) {
|
||||
setFieldByNumber(62, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setWktStepIndex(final Integer value) {
|
||||
setFieldByNumber(71, value);
|
||||
return this;
|
||||
@@ -737,6 +767,26 @@ public class FitLap extends RecordData {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMinTemperature(final Integer value) {
|
||||
setFieldByNumber(124, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAvgCoreTemperature(final Float value) {
|
||||
setFieldByNumber(158, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMinCoreTemperature(final Float value) {
|
||||
setFieldByNumber(159, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMaxCoreTemperature(final Float value) {
|
||||
setFieldByNumber(160, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTimestamp(final Long value) {
|
||||
setFieldByNumber(253, value);
|
||||
return this;
|
||||
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
/* Copyright (C) 2025 Freeyourgadget
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.FitRecordDataBuilder;
|
||||
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 {@link nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.codegen.FitCodeGen}
|
||||
* @noinspection unused
|
||||
*/
|
||||
public class FitMemoGlob extends RecordData {
|
||||
public FitMemoGlob(final RecordDefinition recordDefinition, final RecordHeader recordHeader) {
|
||||
super(recordDefinition, recordHeader);
|
||||
|
||||
final int globalNumber = recordDefinition.getGlobalFITMessage().getNumber();
|
||||
if (globalNumber != 145) {
|
||||
throw new IllegalArgumentException("FitMemoGlob expects global messages of " + 145 + ", got " + globalNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getMesgNum() {
|
||||
return (Integer) getFieldByNumber(1);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getParentIndex() {
|
||||
return (Integer) getFieldByNumber(2);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getFieldNum() {
|
||||
return (Integer) getFieldByNumber(3);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getData() {
|
||||
return (Integer) getFieldByNumber(4);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getPartIndex() {
|
||||
return (Long) getFieldByNumber(250);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
public static class Builder extends FitRecordDataBuilder {
|
||||
public Builder() {
|
||||
super(145);
|
||||
}
|
||||
|
||||
public Builder setMesgNum(final Integer value) {
|
||||
setFieldByNumber(1, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setParentIndex(final Integer value) {
|
||||
setFieldByNumber(2, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setFieldNum(final Integer value) {
|
||||
setFieldByNumber(3, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setData(final Integer value) {
|
||||
setFieldByNumber(4, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPartIndex(final Long value) {
|
||||
setFieldByNumber(250, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FitMemoGlob build() {
|
||||
return (FitMemoGlob) super.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
@@ -39,6 +39,7 @@ public class FitRecordDataFactory {
|
||||
case 27 -> new FitWorkoutStep(recordDefinition, recordHeader);
|
||||
case 30 -> new FitWeightScale(recordDefinition, recordHeader);
|
||||
case 31 -> new FitCourse(recordDefinition, recordHeader);
|
||||
case 32 -> new FitCoursePoint(recordDefinition, recordHeader);
|
||||
case 33 -> new FitTotals(recordDefinition, recordHeader);
|
||||
case 34 -> new FitActivity(recordDefinition, recordHeader);
|
||||
case 35 -> new FitSoftware(recordDefinition, recordHeader);
|
||||
@@ -60,7 +61,12 @@ public class FitRecordDataFactory {
|
||||
case 132 -> new FitHr(recordDefinition, recordHeader);
|
||||
case 140 -> new FitPhysiologicalMetrics(recordDefinition, recordHeader);
|
||||
case 141 -> new FitEpoStatus(recordDefinition, recordHeader);
|
||||
case 142 -> new FitSegmentLap(recordDefinition, recordHeader);
|
||||
case 145 -> new FitMemoGlob(recordDefinition, recordHeader);
|
||||
case 147 -> new FitSensorSettings(recordDefinition, recordHeader);
|
||||
case 148 -> new FitSegmentId(recordDefinition, recordHeader);
|
||||
case 149 -> new FitSegmentLeaderboardEntry(recordDefinition, recordHeader);
|
||||
case 150 -> new FitSegmentPoint(recordDefinition, recordHeader);
|
||||
case 151 -> new FitSegmentFile(recordDefinition, recordHeader);
|
||||
case 158 -> new FitWorkoutSession(recordDefinition, recordHeader);
|
||||
case 159 -> new FitWatchfaceSettings(recordDefinition, recordHeader);
|
||||
@@ -92,6 +98,7 @@ public class FitRecordDataFactory {
|
||||
case 307 -> new FitHsaRespirationData(recordDefinition, recordHeader);
|
||||
case 308 -> new FitHsaHeartRateData(recordDefinition, recordHeader);
|
||||
case 312 -> new FitSplit(recordDefinition, recordHeader);
|
||||
case 313 -> new FitSplitSummary(recordDefinition, recordHeader);
|
||||
case 314 -> new FitHsaBodyBatteryData(recordDefinition, recordHeader);
|
||||
case 315 -> new FitHsaEvent(recordDefinition, recordHeader);
|
||||
case 319 -> new FitTankUpdate(recordDefinition, recordHeader);
|
||||
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
/* Copyright (C) 2025 Freeyourgadget
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.FitRecordDataBuilder;
|
||||
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 {@link nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.codegen.FitCodeGen}
|
||||
* @noinspection unused
|
||||
*/
|
||||
public class FitSegmentId extends RecordData {
|
||||
public FitSegmentId(final RecordDefinition recordDefinition, final RecordHeader recordHeader) {
|
||||
super(recordDefinition, recordHeader);
|
||||
|
||||
final int globalNumber = recordDefinition.getGlobalFITMessage().getNumber();
|
||||
if (globalNumber != 148) {
|
||||
throw new IllegalArgumentException("FitSegmentId expects global messages of " + 148 + ", got " + globalNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getName() {
|
||||
return (String) getFieldByNumber(0);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getUuid() {
|
||||
return (String) getFieldByNumber(1);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getSport() {
|
||||
return (Integer) getFieldByNumber(2);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getEnabled() {
|
||||
return (Integer) getFieldByNumber(3);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getUserProfilePrimaryKey() {
|
||||
return (Long) getFieldByNumber(4);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getDeviceId() {
|
||||
return (Long) getFieldByNumber(5);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getDefaultRaceLeader() {
|
||||
return (Integer) getFieldByNumber(6);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getDeleteStatus() {
|
||||
return (Integer) getFieldByNumber(7);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getSelectionType() {
|
||||
return (Integer) getFieldByNumber(8);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
public static class Builder extends FitRecordDataBuilder {
|
||||
public Builder() {
|
||||
super(148);
|
||||
}
|
||||
|
||||
public Builder setName(final String value) {
|
||||
setFieldByNumber(0, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setUuid(final String value) {
|
||||
setFieldByNumber(1, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSport(final Integer value) {
|
||||
setFieldByNumber(2, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setEnabled(final Integer value) {
|
||||
setFieldByNumber(3, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setUserProfilePrimaryKey(final Long value) {
|
||||
setFieldByNumber(4, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDeviceId(final Long value) {
|
||||
setFieldByNumber(5, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDefaultRaceLeader(final Integer value) {
|
||||
setFieldByNumber(6, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDeleteStatus(final Integer value) {
|
||||
setFieldByNumber(7, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSelectionType(final Integer value) {
|
||||
setFieldByNumber(8, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FitSegmentId build() {
|
||||
return (FitSegmentId) super.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
+254
@@ -0,0 +1,254 @@
|
||||
/* Copyright (C) 2025 Freeyourgadget
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.FitRecordDataBuilder;
|
||||
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 {@link nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.codegen.FitCodeGen}
|
||||
* @noinspection unused
|
||||
*/
|
||||
public class FitSegmentLap extends RecordData {
|
||||
public FitSegmentLap(final RecordDefinition recordDefinition, final RecordHeader recordHeader) {
|
||||
super(recordDefinition, recordHeader);
|
||||
|
||||
final int globalNumber = recordDefinition.getGlobalFITMessage().getNumber();
|
||||
if (globalNumber != 142) {
|
||||
throw new IllegalArgumentException("FitSegmentLap expects global messages of " + 142 + ", got " + globalNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getStartPositionLat() {
|
||||
return (Double) getFieldByNumber(3);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getStartPositionLong() {
|
||||
return (Double) getFieldByNumber(4);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getEndPositionLat() {
|
||||
return (Double) getFieldByNumber(5);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getEndPositionLong() {
|
||||
return (Double) getFieldByNumber(6);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getTotalDistance() {
|
||||
return (Double) getFieldByNumber(9);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getTotalAscent() {
|
||||
return (Integer) getFieldByNumber(21);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getTotalDescent() {
|
||||
return (Integer) getFieldByNumber(22);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getSport() {
|
||||
return (Integer) getFieldByNumber(23);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getNecLat() {
|
||||
return (Double) getFieldByNumber(25);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getNecLong() {
|
||||
return (Double) getFieldByNumber(26);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getSwcLat() {
|
||||
return (Double) getFieldByNumber(27);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getSwcLong() {
|
||||
return (Double) getFieldByNumber(28);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getName() {
|
||||
return (String) getFieldByNumber(29);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getAvgTemperature() {
|
||||
return (Integer) getFieldByNumber(42);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getMaxTemperature() {
|
||||
return (Integer) getFieldByNumber(43);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getUuid() {
|
||||
return (String) getFieldByNumber(65);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Float getTotalFractionalAscent() {
|
||||
return (Float) getFieldByNumber(89);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Float getTotalFractionalDescent() {
|
||||
return (Float) getFieldByNumber(90);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getTimestamp() {
|
||||
return (Long) getFieldByNumber(253);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getMessageIndex() {
|
||||
return (Integer) getFieldByNumber(254);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
public static class Builder extends FitRecordDataBuilder {
|
||||
public Builder() {
|
||||
super(142);
|
||||
}
|
||||
|
||||
public Builder setStartPositionLat(final Double value) {
|
||||
setFieldByNumber(3, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setStartPositionLong(final Double value) {
|
||||
setFieldByNumber(4, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setEndPositionLat(final Double value) {
|
||||
setFieldByNumber(5, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setEndPositionLong(final Double value) {
|
||||
setFieldByNumber(6, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalDistance(final Double value) {
|
||||
setFieldByNumber(9, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalAscent(final Integer value) {
|
||||
setFieldByNumber(21, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalDescent(final Integer value) {
|
||||
setFieldByNumber(22, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSport(final Integer value) {
|
||||
setFieldByNumber(23, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNecLat(final Double value) {
|
||||
setFieldByNumber(25, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNecLong(final Double value) {
|
||||
setFieldByNumber(26, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSwcLat(final Double value) {
|
||||
setFieldByNumber(27, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSwcLong(final Double value) {
|
||||
setFieldByNumber(28, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setName(final String value) {
|
||||
setFieldByNumber(29, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAvgTemperature(final Integer value) {
|
||||
setFieldByNumber(42, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMaxTemperature(final Integer value) {
|
||||
setFieldByNumber(43, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setUuid(final String value) {
|
||||
setFieldByNumber(65, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalFractionalAscent(final Float value) {
|
||||
setFieldByNumber(89, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalFractionalDescent(final Float value) {
|
||||
setFieldByNumber(90, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTimestamp(final Long value) {
|
||||
setFieldByNumber(253, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessageIndex(final Integer value) {
|
||||
setFieldByNumber(254, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FitSegmentLap build() {
|
||||
return (FitSegmentLap) super.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
/* Copyright (C) 2025 Freeyourgadget
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.FitRecordDataBuilder;
|
||||
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 {@link nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.codegen.FitCodeGen}
|
||||
* @noinspection unused
|
||||
*/
|
||||
public class FitSegmentLeaderboardEntry extends RecordData {
|
||||
public FitSegmentLeaderboardEntry(final RecordDefinition recordDefinition, final RecordHeader recordHeader) {
|
||||
super(recordDefinition, recordHeader);
|
||||
|
||||
final int globalNumber = recordDefinition.getGlobalFITMessage().getNumber();
|
||||
if (globalNumber != 149) {
|
||||
throw new IllegalArgumentException("FitSegmentLeaderboardEntry expects global messages of " + 149 + ", got " + globalNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getName() {
|
||||
return (String) getFieldByNumber(0);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getType() {
|
||||
return (Integer) getFieldByNumber(1);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getGroupPrimaryKey() {
|
||||
return (Long) getFieldByNumber(2);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getActivityId() {
|
||||
return (Long) getFieldByNumber(3);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getSegmentTime() {
|
||||
return (Double) getFieldByNumber(4);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getActivityIdString() {
|
||||
return (String) getFieldByNumber(5);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getMessageIndex() {
|
||||
return (Integer) getFieldByNumber(254);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
public static class Builder extends FitRecordDataBuilder {
|
||||
public Builder() {
|
||||
super(149);
|
||||
}
|
||||
|
||||
public Builder setName(final String value) {
|
||||
setFieldByNumber(0, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setType(final Integer value) {
|
||||
setFieldByNumber(1, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setGroupPrimaryKey(final Long value) {
|
||||
setFieldByNumber(2, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setActivityId(final Long value) {
|
||||
setFieldByNumber(3, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setSegmentTime(final Double value) {
|
||||
setFieldByNumber(4, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setActivityIdString(final String value) {
|
||||
setFieldByNumber(5, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessageIndex(final Integer value) {
|
||||
setFieldByNumber(254, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FitSegmentLeaderboardEntry build() {
|
||||
return (FitSegmentLeaderboardEntry) super.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
/* Copyright (C) 2025 Freeyourgadget
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.FitRecordDataBuilder;
|
||||
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 {@link nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.codegen.FitCodeGen}
|
||||
* @noinspection unused
|
||||
*/
|
||||
public class FitSegmentPoint extends RecordData {
|
||||
public FitSegmentPoint(final RecordDefinition recordDefinition, final RecordHeader recordHeader) {
|
||||
super(recordDefinition, recordHeader);
|
||||
|
||||
final int globalNumber = recordDefinition.getGlobalFITMessage().getNumber();
|
||||
if (globalNumber != 150) {
|
||||
throw new IllegalArgumentException("FitSegmentPoint expects global messages of " + 150 + ", got " + globalNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getPositionLat() {
|
||||
return (Double) getFieldByNumber(1);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getPositionLong() {
|
||||
return (Double) getFieldByNumber(2);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getDistance() {
|
||||
return (Double) getFieldByNumber(3);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Number[] getLeaderTime() {
|
||||
final Object[] objectsArray = (Object[]) getFieldByNumber(5);
|
||||
if (objectsArray == null)
|
||||
return null;
|
||||
final Number[] ret = new Number[objectsArray.length];
|
||||
for (int i = 0; i < objectsArray.length; i++) {
|
||||
ret[i] = (Number) objectsArray[i];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getEnhancedAltitude() {
|
||||
return (Double) getFieldByNumber(6);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getMessageIndex() {
|
||||
return (Integer) getFieldByNumber(254);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
public static class Builder extends FitRecordDataBuilder {
|
||||
public Builder() {
|
||||
super(150);
|
||||
}
|
||||
|
||||
public Builder setPositionLat(final Double value) {
|
||||
setFieldByNumber(1, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setPositionLong(final Double value) {
|
||||
setFieldByNumber(2, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDistance(final Double value) {
|
||||
setFieldByNumber(3, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setLeaderTime(final Number[] value) {
|
||||
setFieldByNumber(5, (Object[]) value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setEnhancedAltitude(final Double value) {
|
||||
setFieldByNumber(6, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessageIndex(final Integer value) {
|
||||
setFieldByNumber(254, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FitSegmentPoint build() {
|
||||
return (FitSegmentPoint) super.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -274,13 +274,13 @@ public class FitSession extends RecordData {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getAvgAltitude() {
|
||||
return (Double) getFieldByNumber(49);
|
||||
public Float getAvgAltitude() {
|
||||
return (Float) getFieldByNumber(49);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getMaxAltitude() {
|
||||
return (Double) getFieldByNumber(50);
|
||||
public Float getMaxAltitude() {
|
||||
return (Float) getFieldByNumber(50);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -1112,12 +1112,12 @@ public class FitSession extends RecordData {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAvgAltitude(final Double value) {
|
||||
public Builder setAvgAltitude(final Float value) {
|
||||
setFieldByNumber(49, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMaxAltitude(final Double value) {
|
||||
public Builder setMaxAltitude(final Float value) {
|
||||
setFieldByNumber(50, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
+12
-12
@@ -79,23 +79,23 @@ public class FitSplit extends RecordData {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getStartPositionLat() {
|
||||
return (Long) getFieldByNumber(21);
|
||||
public Double getStartPositionLat() {
|
||||
return (Double) getFieldByNumber(21);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getStartPositionLong() {
|
||||
return (Long) getFieldByNumber(22);
|
||||
public Double getStartPositionLong() {
|
||||
return (Double) getFieldByNumber(22);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getEndPositionLat() {
|
||||
return (Long) getFieldByNumber(23);
|
||||
public Double getEndPositionLat() {
|
||||
return (Double) getFieldByNumber(23);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getEndPositionLong() {
|
||||
return (Long) getFieldByNumber(24);
|
||||
public Double getEndPositionLong() {
|
||||
return (Double) getFieldByNumber(24);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -181,22 +181,22 @@ public class FitSplit extends RecordData {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setStartPositionLat(final Long value) {
|
||||
public Builder setStartPositionLat(final Double value) {
|
||||
setFieldByNumber(21, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setStartPositionLong(final Long value) {
|
||||
public Builder setStartPositionLong(final Double value) {
|
||||
setFieldByNumber(22, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setEndPositionLat(final Long value) {
|
||||
public Builder setEndPositionLat(final Double value) {
|
||||
setFieldByNumber(23, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setEndPositionLong(final Long value) {
|
||||
public Builder setEndPositionLong(final Double value) {
|
||||
setFieldByNumber(24, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
/* Copyright (C) 2025 Freeyourgadget
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
Gadgetbridge is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Gadgetbridge is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.messages;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.FitRecordDataBuilder;
|
||||
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 {@link nodomain.freeyourgadget.gadgetbridge.service.devices.garmin.fit.codegen.FitCodeGen}
|
||||
* @noinspection unused
|
||||
*/
|
||||
public class FitSplitSummary extends RecordData {
|
||||
public FitSplitSummary(final RecordDefinition recordDefinition, final RecordHeader recordHeader) {
|
||||
super(recordDefinition, recordHeader);
|
||||
|
||||
final int globalNumber = recordDefinition.getGlobalFITMessage().getNumber();
|
||||
if (globalNumber != 313) {
|
||||
throw new IllegalArgumentException("FitSplitSummary expects global messages of " + 313 + ", got " + globalNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getSplitType() {
|
||||
return (Integer) getFieldByNumber(0);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getNumSplits() {
|
||||
return (Integer) getFieldByNumber(3);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getTotalTimerTime() {
|
||||
return (Double) getFieldByNumber(4);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getTotalDistance() {
|
||||
return (Double) getFieldByNumber(5);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getAvgSpeed() {
|
||||
return (Double) getFieldByNumber(6);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getMaxSpeed() {
|
||||
return (Double) getFieldByNumber(7);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getTotalAscent() {
|
||||
return (Integer) getFieldByNumber(8);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getTotalDescent() {
|
||||
return (Integer) getFieldByNumber(9);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getAvgHeartRate() {
|
||||
return (Integer) getFieldByNumber(10);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getMaxHeartRate() {
|
||||
return (Integer) getFieldByNumber(11);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getAvgVertSpeed() {
|
||||
return (Double) getFieldByNumber(12);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getTotalCalories() {
|
||||
return (Long) getFieldByNumber(13);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Double getTotalMovingTime() {
|
||||
return (Double) getFieldByNumber(77);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Long getTimestamp() {
|
||||
return (Long) getFieldByNumber(253);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Integer getMessageIndex() {
|
||||
return (Integer) getFieldByNumber(254);
|
||||
}
|
||||
|
||||
/**
|
||||
* @noinspection unused
|
||||
*/
|
||||
public static class Builder extends FitRecordDataBuilder {
|
||||
public Builder() {
|
||||
super(313);
|
||||
}
|
||||
|
||||
public Builder setSplitType(final Integer value) {
|
||||
setFieldByNumber(0, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setNumSplits(final Integer value) {
|
||||
setFieldByNumber(3, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalTimerTime(final Double value) {
|
||||
setFieldByNumber(4, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalDistance(final Double value) {
|
||||
setFieldByNumber(5, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAvgSpeed(final Double value) {
|
||||
setFieldByNumber(6, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMaxSpeed(final Double value) {
|
||||
setFieldByNumber(7, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalAscent(final Integer value) {
|
||||
setFieldByNumber(8, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalDescent(final Integer value) {
|
||||
setFieldByNumber(9, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAvgHeartRate(final Integer value) {
|
||||
setFieldByNumber(10, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMaxHeartRate(final Integer value) {
|
||||
setFieldByNumber(11, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setAvgVertSpeed(final Double value) {
|
||||
setFieldByNumber(12, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalCalories(final Long value) {
|
||||
setFieldByNumber(13, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTotalMovingTime(final Double value) {
|
||||
setFieldByNumber(77, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setTimestamp(final Long value) {
|
||||
setFieldByNumber(253, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setMessageIndex(final Integer value) {
|
||||
setFieldByNumber(254, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FitSplitSummary build() {
|
||||
return (FitSplitSummary) super.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user