Mi2: Fix off-by-one in activity fetching

This commit is contained in:
cpfeiffer 2016-12-11 21:30:37 +01:00
parent 31122f0b09
commit 94c0d6af9d
1 changed files with 1 additions and 1 deletions

View File

@ -218,7 +218,7 @@ public class FetchActivityOperation extends AbstractMiBand2Operation {
private void handleActivityMetadata(byte[] value) { private void handleActivityMetadata(byte[] value) {
if (value.length == 15) { if (value.length == 15) {
// first two bytes are whether our request was accepted // first two bytes are whether our request was accepted
if (ArrayUtils.equals(MiBand2Service.RESPONSE_ACTIVITY_DATA_START_DATE_SUCCESS, value, 0, 2)) { if (ArrayUtils.equals(MiBand2Service.RESPONSE_ACTIVITY_DATA_START_DATE_SUCCESS, value, 0, 3)) {
// the third byte (0x01 on success) = ? // the third byte (0x01 on success) = ?
// the 4th - 7th bytes probably somehow represent the number of bytes/packets to expect // the 4th - 7th bytes probably somehow represent the number of bytes/packets to expect