mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 21:06:50 +01:00
Mi2: Fix off-by-one in activity fetching
This commit is contained in:
parent
31122f0b09
commit
94c0d6af9d
@ -218,7 +218,7 @@ public class FetchActivityOperation extends AbstractMiBand2Operation {
|
||||
private void handleActivityMetadata(byte[] value) {
|
||||
if (value.length == 15) {
|
||||
// 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 4th - 7th bytes probably somehow represent the number of bytes/packets to expect
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user