diff options
author | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2019-06-12 09:51:50 +0300 |
---|---|---|
committer | Serhii Kostiuk <serhii.o.kostiuk@globallogic.com> | 2019-06-12 09:56:46 +0300 |
commit | 5649cebb23edc7ef20456e76b959e4a217a08594 (patch) | |
tree | 839ed6a4b815b5564e18727a66e7cc834bd3d0bc /src | |
parent | c316cdffa1749a17b7f106ea526ac2288074920b (diff) | |
download | libmts-io-5649cebb23edc7ef20456e76b959e4a217a08594.tar.gz libmts-io-5649cebb23edc7ef20456e76b959e4a217a08594.tar.bz2 libmts-io-5649cebb23edc7ef20456e76b959e4a217a08594.zip |
[MTS-MTQ] QuectelRadio implementation
Updated the following functions to support Quectel radios:
- CellularRadioFactory::createEG95Radio - fixed to build a EG95Radio instance;
- ICellularRadio::extractModelFromResult - returning EG95 for EG95 radios;
- ICellularRadio::convertModelToType - returning VALUE_TYPE_LTE for EG95.
Diffstat (limited to 'src')
-rw-r--r-- | src/MTS_IO_CellularRadioFactory.cpp | 4 | ||||
-rw-r--r-- | src/MTS_IO_ICellularRadio.cpp | 24 |
2 files changed, 25 insertions, 3 deletions
diff --git a/src/MTS_IO_CellularRadioFactory.cpp b/src/MTS_IO_CellularRadioFactory.cpp index 8ebd8dc..4ee8756 100644 --- a/src/MTS_IO_CellularRadioFactory.cpp +++ b/src/MTS_IO_CellularRadioFactory.cpp @@ -199,7 +199,5 @@ ICellularRadio* CellularRadioFactory::createLE866A1JS(const std::string &sPort) ICellularRadio* CellularRadioFactory::createEG95Radio(const std::string& sPort) const { - // TODO: return new EG95Radio(sPort); - printError("TODO: EG95Radio"); - return new HE910DRadio(sPort); + return new EG95Radio(sPort); } diff --git a/src/MTS_IO_ICellularRadio.cpp b/src/MTS_IO_ICellularRadio.cpp index 2f19f3a..7f216d0 100644 --- a/src/MTS_IO_ICellularRadio.cpp +++ b/src/MTS_IO_ICellularRadio.cpp @@ -181,6 +181,27 @@ MTS::IO::ICellularRadio::CODE MTS::IO::ICellularRadio::convertModelToMtsShortCod } else if (sModel.find("DE910") == 0) { sCode = "EV3"; eCode = SUCCESS; + } else if (sModel.find("EG95") == 0) { + if (NULL == radioObject) { + sCode = VALUE_NOT_SUPPORTED; + eCode = ERROR; + } else { + std::string sValue; + eCode = radioObject->getFirmware(sValue); + if (eCode != SUCCESS) { + sCode = VALUE_NOT_SUPPORTED; + eCode = ERROR; + } else if (sValue.find("EG95E") != std::string::npos) { + sCode = "LEU7"; + eCode = SUCCESS; + } else if (sValue.find("EG95NA") != std::string::npos) { + sCode = "LNA7"; + eCode = SUCCESS; + } else { + sCode = VALUE_NOT_SUPPORTED; + eCode = ERROR; + } + } } else { sCode = VALUE_NOT_SUPPORTED; printError("RADIO| Could not identify MTS short code from model. [%s]", sModel.c_str()); @@ -274,6 +295,9 @@ MTS::IO::ICellularRadio::CODE MTS::IO::ICellularRadio::convertModelToType(const } else if (sModel.find("DE910") == 0) { sType = VALUE_TYPE_CDMA; eCode = SUCCESS; + } else if (sModel.find("EG95") == 0) { + sType = VALUE_TYPE_LTE; + eCode = SUCCESS; } else { sType = VALUE_TYPE_GSM; eCode = ERROR; |