diff options
author | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2020-07-21 20:24:00 +0300 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2020-07-22 10:18:37 +0300 |
commit | b9a5e7ab27ad313b95fe6642f08e230091efef0f (patch) | |
tree | db50efd264bc4dbb01548bf22cc5ec502703074b /src/MTS_IO_TelitRadio.cpp | |
parent | a9a598dab448dd0d062725e2f3a60bcf68c6fe9e (diff) | |
download | libmts-io-b9a5e7ab27ad313b95fe6642f08e230091efef0f.tar.gz libmts-io-b9a5e7ab27ad313b95fe6642f08e230091efef0f.tar.bz2 libmts-io-b9a5e7ab27ad313b95fe6642f08e230091efef0f.zip |
Telit Delta Radio Firmware Upgrade support - libmts-io implementation
Changes after code review:
1. Handle cases when the number of bytes written is different from the number of bytes requested to transfer.
2. Use fstat instead of lseek to determine the firmware size.
3. Renamed TelitRadio::startWrite and TelitRadio::abortWrite functions to better represent their applicability scope.
Diffstat (limited to 'src/MTS_IO_TelitRadio.cpp')
-rw-r--r-- | src/MTS_IO_TelitRadio.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/MTS_IO_TelitRadio.cpp b/src/MTS_IO_TelitRadio.cpp index a82004c..8c7e174 100644 --- a/src/MTS_IO_TelitRadio.cpp +++ b/src/MTS_IO_TelitRadio.cpp @@ -943,7 +943,7 @@ ICellularRadio::CODE TelitRadio::fumoWriteGroupsABD(int fd, ICellularRadio::Upda printTrace("File size: %d bytes and %d chunks", dPayloadLength, nChunks); printTrace("Starting file upload..."); - rc = startWrite(); + rc = startFotaWriteABD(); if (rc != SUCCESS) { return rc; } @@ -980,12 +980,12 @@ ICellularRadio::CODE TelitRadio::fumoWriteGroupsABD(int fd, ICellularRadio::Upda } // send +++ - abortWrite(); + abortFotaWriteABD(); return rc; } -ICellularRadio::CODE TelitRadio::startWrite() { +ICellularRadio::CODE TelitRadio::startFotaWriteABD() { const std::vector<std::string> vBailStrings{ ICellularRadio::RSP_CONNECT, ICellularRadio::RSP_ERROR }; const int dTimeout = 1000; //ms std::string sCommand, sResult; @@ -1001,7 +1001,7 @@ ICellularRadio::CODE TelitRadio::startWrite() { return SUCCESS; } -ICellularRadio::CODE TelitRadio::abortWrite() { +ICellularRadio::CODE TelitRadio::abortFotaWriteABD() { /* * To prevent the “+++” from being mistaken for data, the following sequence should be followed: * 1) Do not input any character within 1s or longer before inputting “+++”. |