mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Mi2: Fix off-by-one in activity fetching
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user