mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Moyoung: Fix sync crash on too short workout HR packets
This commit is contained in:
+5
@@ -140,6 +140,11 @@ public class FetchWorkoutsV2Operation extends AbstractBTLEOperation<MoyoungDevic
|
||||
|
||||
private void decodeWorkoutHR(byte[] data) {
|
||||
LOG.info("Decoding workout HR packet");
|
||||
if (data.length < 5) {
|
||||
LOG.warn("Not enough data in workout HR packet, stopping fetch");
|
||||
updateProgressAndCheckFinish();
|
||||
return;
|
||||
}
|
||||
ByteBuffer buf = ByteBuffer.wrap(data);
|
||||
buf.get(); // packet subtype (0x05)
|
||||
buf.get(); // workout nr
|
||||
|
||||
Reference in New Issue
Block a user