mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-25 00:30:37 +02:00
Revert Xiaomi steps and stress parsing fixes
- This reverts commit789292d318
. - This reverts commit641eb1bee7
. Further changes are required
This commit is contained in:
parent
3902db5abd
commit
0b0aedfb52
@ -88,12 +88,7 @@ public class DailyDetailsParser extends XiaomiActivityParser {
|
|||||||
final XiaomiActivitySample sample = new XiaomiActivitySample();
|
final XiaomiActivitySample sample = new XiaomiActivitySample();
|
||||||
sample.setTimestamp((int) (timestamp.getTimeInMillis() / 1000));
|
sample.setTimestamp((int) (timestamp.getTimeInMillis() / 1000));
|
||||||
|
|
||||||
// we only need the first 14 bits of the 2 bytes
|
sample.setSteps(buf.getShort());
|
||||||
// FIXME we should parse the header
|
|
||||||
final byte[] steps = new byte[2];
|
|
||||||
buf.get(steps);
|
|
||||||
final int stepsNum = (steps[0] & 0xff) | (((steps[1] >> 2) & 0xff) << 8);
|
|
||||||
sample.setSteps(stepsNum);
|
|
||||||
|
|
||||||
final int calories = buf.get() & 0xff;
|
final int calories = buf.get() & 0xff;
|
||||||
final int unk2 = buf.get() & 0xff;
|
final int unk2 = buf.get() & 0xff;
|
||||||
@ -110,10 +105,7 @@ public class DailyDetailsParser extends XiaomiActivityParser {
|
|||||||
if (version == 3) {
|
if (version == 3) {
|
||||||
// TODO gadgets with versions 2 also should have stress, but the values don't make sense
|
// TODO gadgets with versions 2 also should have stress, but the values don't make sense
|
||||||
sample.setSpo2(buf.get() & 0xff);
|
sample.setSpo2(buf.get() & 0xff);
|
||||||
int stress = buf.get() & 0xff;
|
sample.setStress(buf.get() & 0xff);
|
||||||
if (stress != 0xff) {
|
|
||||||
sample.setStress(stress);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user