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
1 changed files with 5 additions and 1 deletions

View File

@ -312,7 +312,7 @@ public class FetchActivityOperation extends AbstractMiBandOperation {
try { try {
int timestampInSeconds = (int) (activityStruct.activityDataTimestampProgress.getTimeInMillis() / 1000); int timestampInSeconds = (int) (activityStruct.activityDataTimestampProgress.getTimeInMillis() / 1000);
if ((activityStruct.activityDataHolderProgress % bpm) != 0) { 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; int numSamples = activityStruct.activityDataHolderProgress / bpm;
MiBandActivitySample[] samples = new MiBandActivitySample[numSamples]; MiBandActivitySample[] samples = new MiBandActivitySample[numSamples];
@ -337,6 +337,10 @@ public class FetchActivityOperation extends AbstractMiBandOperation {
heartrate & 0xff); heartrate & 0xff);
// samples[minutes].setProvider(dbHandler); // samples[minutes].setProvider(dbHandler);
if (LOG.isDebugEnabled()) {
LOG.debug("sample: " + samples[minutes]);
}
// next minute // next minute
minutes++; minutes++;
timestampInSeconds += 60; timestampInSeconds += 60;