1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-24 17:45:50 +01:00

log raw activity data from mi band, closes #341

Hopefully aids in deciphering activity kinds.
This commit is contained in:
cpfeiffer 2016-06-28 23:23:29 +02:00
parent f0da25c49b
commit f65afa64d9

View File

@ -312,7 +312,7 @@ public class FetchActivityOperation extends AbstractMiBandOperation {
try {
int timestampInSeconds = (int) (activityStruct.activityDataTimestampProgress.getTimeInMillis() / 1000);
if ((activityStruct.activityDataHolderProgress % bpm) != 0) {
throw new IllegalStateException("Unexpected data, progress should be mutiple of " + bpm + ": " + activityStruct.activityDataHolderProgress);
throw new IllegalStateException("Unexpected data, progress should be multiple of " + bpm + ": " + activityStruct.activityDataHolderProgress);
}
int numSamples = activityStruct.activityDataHolderProgress / bpm;
MiBandActivitySample[] samples = new MiBandActivitySample[numSamples];
@ -337,6 +337,10 @@ public class FetchActivityOperation extends AbstractMiBandOperation {
heartrate & 0xff);
// samples[minutes].setProvider(dbHandler);
if (LOG.isDebugEnabled()) {
LOG.debug("sample: " + samples[minutes]);
}
// next minute
minutes++;
timestampInSeconds += 60;