Fixed syncing activity data (#45)

Bytes 1-6 represent the date/time, so we should not try to check for this.
Thanks a lot, Daniele!
led-profile
cpfeiffer 2015-07-04 22:22:59 +02:00
parent 580b86f41b
commit f36caafc54
2 changed files with 7 additions and 1 deletions

View File

@ -144,6 +144,7 @@ public class GBDevice implements Parcelable {
if (mBusyTask != null) {
LOG.warn("Attempt to mark device as busy with: " + task + ", but is already busy with: " + mBusyTask);
}
LOG.info("Mark device as busy: " + mBusyTask);
mBusyTask = task;
}
@ -153,7 +154,9 @@ public class GBDevice implements Parcelable {
public void unsetBusyTask() {
if (mBusyTask == null) {
LOG.error("Attempt to mark device as not busy anymore, but was not busy before.");
return;
}
LOG.info("Mark device as NOT busy anymore: " + mBusyTask);
mBusyTask = null;
}

View File

@ -693,8 +693,11 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
}
private boolean isActivityDataSyncFinished(byte[] value) {
// byte 0 is the kind of message
// byte 1 to 6 represent a timestamp
// byte 7 to 8 represent the amount of data left (0 = done)
if (value.length == 9) {
if (value[0] == 0xa && value[1] == 0xf && value[2] == 5 && value[7] == 0 && value[8] == 0) {
if (value[0] == 0xa && value[7] == 0 && value[8] == 0) {
return true;
}
}