mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
igpsport: Add missing return after download data
This commit is contained in:
committed by
José Rebelo
parent
9a2b5a38ac
commit
d3103400fc
+2
-1
@@ -286,6 +286,7 @@ public class IGPSportDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
if (characteristicUUID.compareTo(UUID_IGPSPORT_CHARACTERISTIC_THIRD_RX) == 0 ) {
|
||||
downloadManager.addData(value);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if(partialPacketInProgress) {
|
||||
@@ -314,7 +315,7 @@ public class IGPSportDeviceSupport extends AbstractBTLESingleDeviceSupport {
|
||||
if ((value[0] == (byte) 0x01) && ( value[3] == (byte)0xff)) {
|
||||
int dataSize = ByteBuffer.wrap(value, 7, 2).getShort();
|
||||
if (dataSize+DATA_HEADER_SIZE > value.length) {
|
||||
LOG.info("Partial packet detected, creating buffer for it");
|
||||
LOG.info("Partial packet detected, creating buffer for it, buffer size: " + dataSize+DATA_HEADER_SIZE);
|
||||
partialPacketInProgress = true;
|
||||
partialBuffer = ByteBuffer.allocate(dataSize+DATA_HEADER_SIZE);
|
||||
partialBuffer.put(value);
|
||||
|
||||
+2
-5
@@ -189,13 +189,10 @@ public class IGPSportDownloadManager {
|
||||
}
|
||||
|
||||
public Boolean needMoreData() {
|
||||
if (!downloadInProgress)
|
||||
return false;
|
||||
if (recievingDataBuffer.size() < (downloadingFile.getFileSize() + 20 + 4 + pbSize)) {
|
||||
return true;
|
||||
} else {
|
||||
if (!downloadInProgress) {
|
||||
return false;
|
||||
}
|
||||
return recievingDataBuffer.size() < (downloadingFile.getFileSize() + 20 + 4 + pbSize);
|
||||
}
|
||||
|
||||
public static class FileInfo {
|
||||
|
||||
Reference in New Issue
Block a user