mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Xiaomi: Improve activity details parsing on some devices
This commit is contained in:
parent
71b55902d0
commit
a62ff4eabb
@ -52,10 +52,13 @@ public class DailyDetailsParser extends XiaomiActivityParser {
|
||||
final int sampleSize;
|
||||
switch (version) {
|
||||
case 1:
|
||||
case 2:
|
||||
headerSize = 4;
|
||||
sampleSize = 7;
|
||||
break;
|
||||
case 2:
|
||||
headerSize = 4;
|
||||
sampleSize = 10;
|
||||
break;
|
||||
case 3:
|
||||
headerSize = 5;
|
||||
sampleSize = 12;
|
||||
@ -95,12 +98,15 @@ public class DailyDetailsParser extends XiaomiActivityParser {
|
||||
|
||||
sample.setHeartRate(buf.get() & 0xff);
|
||||
|
||||
if (version == 3) {
|
||||
if (version >= 2) {
|
||||
final byte[] unknown2 = new byte[3];
|
||||
buf.get(unknown2); // TODO intensity and kind?
|
||||
buf.get(unknown2); // TODO intensity and kind? energy?
|
||||
|
||||
sample.setSpo2(buf.get() & 0xff);
|
||||
sample.setStress(buf.get() & 0xff);
|
||||
if (version == 3) {
|
||||
// TODO gadgets with versions 2 also should have stress, but the values don't make sense
|
||||
sample.setSpo2(buf.get() & 0xff);
|
||||
sample.setStress(buf.get() & 0xff);
|
||||
}
|
||||
}
|
||||
|
||||
samples.add(sample);
|
||||
|
Loading…
Reference in New Issue
Block a user