igpsport: Add missing return after download data

This commit is contained in:
Vitaliy Tomin
2026-05-13 23:33:24 +02:00
committed by José Rebelo
parent 9a2b5a38ac
commit d3103400fc
2 changed files with 4 additions and 6 deletions
@@ -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);
@@ -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 {