summaryrefslogtreecommitdiff
path: root/src/MTS_IO_QuectelRadio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTS_IO_QuectelRadio.cpp')
-rw-r--r--src/MTS_IO_QuectelRadio.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp
index bb81621..2d1ffcd 100644
--- a/src/MTS_IO_QuectelRadio.cpp
+++ b/src/MTS_IO_QuectelRadio.cpp
@@ -31,6 +31,7 @@
using namespace MTS::IO;
+const size_t QuectelRadio::FILE_CHUNK_SIZE = 1024;
const std::string QuectelRadio::CMD_ABORT_UPLOAD = "+++";
// It is strongly recommended to use DOS 8.3 file name format for <filename>.
@@ -836,10 +837,16 @@ ICellularRadio::CODE QuectelRadio::uploadFile(int fd, const std::string& sTarget
size_t nChunks;
CODE rc;
- rc = getFileSize(fd, dPayloadLength, nChunks);
+ rc = getFileSize(fd, dPayloadLength);
if (rc != SUCCESS) {
return rc;
}
+
+ rc = sizeToChunks(dPayloadLength, FILE_CHUNK_SIZE, nChunks);
+ if (rc != SUCCESS) {
+ return rc;
+ }
+
printTrace("File size: %d bytes and %d chunks", dPayloadLength, nChunks);
printTrace("Starting file upload...");