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.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/MTS_IO_QuectelRadio.cpp b/src/MTS_IO_QuectelRadio.cpp
index 2d1ffcd..22fa92f 100644
--- a/src/MTS_IO_QuectelRadio.cpp
+++ b/src/MTS_IO_QuectelRadio.cpp
@@ -56,6 +56,26 @@ bool QuectelRadio::resetRadio(uint32_t iTimeoutMillis) {
return false;
}
+ICellularRadio::CODE QuectelRadio::getVendorFirmware(std::string& sVendorFirmware) {
+ printTrace("%s| Get Quectel-specific firmware version", getName().c_str());
+ sVendorFirmware = ICellularRadio::VALUE_NOT_SUPPORTED;
+ std::string sCmd("AT+QGMR");
+ std::string sResult = sendCommand(sCmd);
+ size_t pos = sResult.find(ICellularRadio::RSP_OK);
+ if (pos == std::string::npos) {
+ printWarning("%s| Unable to get firmware from radio using command [%s]", getName().c_str(), sCmd.c_str());
+ return FAILURE;
+ }
+
+ sVendorFirmware = MTS::Text::trim(sResult.substr(0, pos));
+ if(sVendorFirmware.size() == 0) {
+ printWarning("%s| Unable to get firmware from radio using command [%s]", getName().c_str(), sCmd.c_str());
+ return FAILURE;
+ }
+
+ return SUCCESS;
+}
+
ICellularRadio::CODE QuectelRadio::getModel(std::string& sModel) {
printTrace("%s| Get Model", getName().c_str());
//Always returns SUCCESS because the model should be m_sName
@@ -591,7 +611,7 @@ ICellularRadio::CODE QuectelRadio::fumoLocalApply(ICellularRadio::UpdateCb& step
ICellularRadio::CODE rc;
std::string sCmd;
- rc = getQuectelFirmware(m_sQuectelFirmware);
+ rc = getVendorFirmware(m_sQuectelFirmware);
if (rc != SUCCESS) {
callNextStep(stepCb, "FUMO Error: Failed to obtain current firmware version");
return rc;
@@ -954,26 +974,6 @@ ICellularRadio::CODE QuectelRadio::checkFile(bool& bIsFilePresent, const std::st
return SUCCESS;
}
-ICellularRadio::CODE QuectelRadio::getQuectelFirmware(std::string& sFirmware) {
- printTrace("%s| Get Quectel-specific firmware version", getName().c_str());
- sFirmware = ICellularRadio::VALUE_NOT_SUPPORTED;
- std::string sCmd("AT+QGMR");
- std::string sResult = sendCommand(sCmd);
- size_t pos = sResult.find(ICellularRadio::RSP_OK);
- if (pos == std::string::npos) {
- printWarning("%s| Unable to get firmware from radio using command [%s]", getName().c_str(), sCmd.c_str());
- return FAILURE;
- }
-
- sFirmware = MTS::Text::trim(sResult.substr(0, pos));
- if(sFirmware.size() == 0) {
- printWarning("%s| Unable to get firmware from radio using command [%s]", getName().c_str(), sCmd.c_str());
- return FAILURE;
- }
-
- return SUCCESS;
-}
-
uint16_t QuectelRadio::getQuectelChecksum(const void* data, size_t nBytes) {
auto castData = static_cast<const uint8_t*>(data);
uint16_t iChecksum = 0;
@@ -1053,7 +1053,7 @@ ICellularRadio::CODE QuectelRadio::fumoWaitNewFirmware(ICellularRadio::UpdateCb&
MTS::Thread::sleep(10000);
- if (getQuectelFirmware(sQuectelFirmware) != SUCCESS) {
+ if (getVendorFirmware(sQuectelFirmware) != SUCCESS) {
// The radio is probably unavailable
resetConnection(100);
continue;