mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-09-06 22:45:33 +02:00
Do not allocate the buffer if there's no data available.
Perhaps could fix the "data in the future" issue
This commit is contained in:
parent
9e2d32c33f
commit
406f9ab90d
@ -462,8 +462,10 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
|
|||||||
LOG.info("data to read until next header: "+ dataUntilNextHeader +" len: " + (dataUntilNextHeader / 3) + " minute(s)");
|
LOG.info("data to read until next header: "+ dataUntilNextHeader +" len: " + (dataUntilNextHeader / 3) + " minute(s)");
|
||||||
LOG.info("TIMESTAMP: " + DateFormat.getDateTimeInstance().format(timestamp.getTime()).toString() + " magic byte: " + dataUntilNextHeader);
|
LOG.info("TIMESTAMP: " + DateFormat.getDateTimeInstance().format(timestamp.getTime()).toString() + " magic byte: " + dataUntilNextHeader);
|
||||||
|
|
||||||
this.activityDataRemainingBytes = this.activityDataUntilNextHeader = dataUntilNextHeader;
|
if (dataUntilNextHeader > 0 ) { //tentative fix for data in the future
|
||||||
this.activityDataTimestampProgress = this.activityDataTimestampToAck = timestamp;
|
this.activityDataRemainingBytes = this.activityDataUntilNextHeader = dataUntilNextHeader;
|
||||||
|
this.activityDataTimestampProgress = this.activityDataTimestampToAck = timestamp;
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
bufferActivityData(value);
|
bufferActivityData(value);
|
||||||
|
Loading…
Reference in New Issue
Block a user