diff options
author | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2020-08-04 11:15:30 +0300 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2020-08-04 12:30:26 +0300 |
commit | 64d8e39ac05a89acfb9173fad05d0aab948032c6 (patch) | |
tree | 45e86c1946981e4842eae66cbd57a79dfc716929 /src | |
parent | 7ad3dbe2667f660f4133ea0747b3f61495f7de01 (diff) | |
download | libmts-io-64d8e39ac05a89acfb9173fad05d0aab948032c6.tar.gz libmts-io-64d8e39ac05a89acfb9173fad05d0aab948032c6.tar.bz2 libmts-io-64d8e39ac05a89acfb9173fad05d0aab948032c6.zip |
Quectel EG25-G Delta Radio Firmware Upgrade support - libmts-io implementation
Delta Radio Firmware Upgrade implementation uses file management commands for Quectel radios.
Radio behaviour for +QFLST output on EG25 radios is different that on EG95:
- EG95 radios list all files on UFS _with_ "UFS:" prefix;
- EG25 radios list all files on UFS _without_ "UFS:" prefix.
This commit allows to handle both formats of +QFLST output to check file presense.
Diffstat (limited to 'src')
-rw-r--r-- | src/MTS_IO_QuectelRadio.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp index 8656973..601674b 100644 --- a/src/MTS_IO_QuectelRadio.cpp +++ b/src/MTS_IO_QuectelRadio.cpp @@ -968,9 +968,15 @@ ICellularRadio::CODE QuectelRadio::checkFile(bool& bIsFilePresent, const std::st return FAILURE; } - const std::string sExpected = "+QFLST: \"UFS:" + sTargetFilename + "\""; - bIsFilePresent = (sResult.find(sExpected) != std::string::npos); + // UFS files in +QFLST output may or may not have "UFS:" prefix + const std::string sExpectedFull = "+QFLST: \"UFS:" + sTargetFilename + "\""; + const std::string sExpectedAlt = "+QFLST: \"" + sTargetFilename + "\""; + // File is present if file name found with or without "UFS:" prefix in QFLST output + bool bIsPresentFull = (sResult.find(sExpectedFull) != std::string::npos); + bool bIsPresentAlt = (sResult.find(sExpectedAlt) != std::string::npos); + + bIsFilePresent = (bIsPresentFull || bIsPresentAlt); return SUCCESS; } |