From 64d8e39ac05a89acfb9173fad05d0aab948032c6 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Tue, 4 Aug 2020 11:15:30 +0300 Subject: 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. --- src/MTS_IO_QuectelRadio.cpp | 10 ++++++++-- 1 file 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; } -- cgit v1.2.3