Zepp OS: Fix and log experimental temperature fetch

This commit is contained in:
José Rebelo
2025-03-23 14:46:13 +00:00
parent 1f8fdf7eef
commit b91254265c
2 changed files with 6 additions and 4 deletions
@@ -35,5 +35,6 @@ public class RecordedDataTypes {
// Types to fetch during sync - scheduled, sync button, etc.
// Does not include debug logs or workouts
public static final int TYPE_SYNC = TYPE_ACTIVITY | TYPE_GPS_TRACKS | TYPE_SPO2 | TYPE_STRESS |
TYPE_TEMPERATURE |
TYPE_HEART_RATE | TYPE_PAI | TYPE_SLEEP_RESPIRATORY_RATE;
}
@@ -52,12 +52,13 @@ public class FetchTemperatureOperation extends AbstractRepeatingFetchOperation {
final ByteBuffer buffer = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN);
while (buffer.position() < bytes.length) {
final int temperature = buffer.getShort();
final byte[] unknown = new byte[6];
buffer.get(unknown);
final int temp1 = buffer.getShort();
final int temp2 = buffer.getShort();
final int temp3 = buffer.getShort();
final int temp4 = buffer.getShort();
// TODO persist / parse rest
LOG.warn("Temperature: {}, unknown={}", temperature, GB.hexdump(unknown));
LOG.warn("temp1: {}, temp2={}, temp3: {}, temp4={}", temp1, temp2, temp3, temp4);
}
return false;