1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-09 22:57:54 +02:00
Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/vivomovehr/fit/FitMessageFieldDefinition.java
Mormegil 3a58314db6 Garmin Vivomove HR support
- communication protocols
- device support implementation
- download FIT file storage

Features:
- basic connectivity: time sync, battery status, HW/FW version info
- real-time activity tracking
- fitness data sync
- find the device, find the phone
- factory reset

Features implemented but not working:
- notifications: fully implemented, seem to communicate correctly, but not shown on watch

Features implemented partially (not expected to work now):
- weather information (and in future possibly weather alerts)
- music info
- firmware update: only the initial file upload implemented, not used

Things to improve/change:
- Device name hardcoded in `VivomoveHrCoordinator.getSupportedType`, service UUIDs not available
- Download FIT file storage: Should be store (and offer the user to export?) the FIT data forever?
- Obviously, various code improvements, cleanup, etc.
2023-07-20 20:30:14 +00:00

36 lines
1.4 KiB
Java

package nodomain.freeyourgadget.gadgetbridge.service.devices.vivomovehr.fit;
import nodomain.freeyourgadget.gadgetbridge.service.devices.vivomovehr.messages.MessageWriter;
public class FitMessageFieldDefinition {
public final String fieldName;
public final int fieldNumber;
public final int fieldSize;
public final FitFieldBaseType fieldType;
public final double scale;
public final double offset;
public final String units;
public final Object defaultValue;
public FitMessageFieldDefinition(String fieldName, int fieldNumber, int fieldSize, FitFieldBaseType fieldType, Object defaultValue) {
this(fieldName, fieldNumber, fieldSize, fieldType, 0, 0, null, defaultValue);
}
public FitMessageFieldDefinition(String fieldName, int fieldNumber, int fieldSize, FitFieldBaseType fieldType, double scale, double offset, String units, Object defaultValue) {
this.fieldName = fieldName;
this.fieldNumber = fieldNumber;
this.fieldSize = fieldSize;
this.fieldType = fieldType;
this.scale = scale;
this.offset = offset;
this.units = units;
this.defaultValue = defaultValue == null ? fieldType.invalidValue : defaultValue;
}
public void writeToMessage(MessageWriter writer) {
writer.writeByte(fieldNumber);
writer.writeByte(fieldSize);
writer.writeByte(fieldType.typeID);
}
}