diff options
| author | Jeff Hatch <Jeff.Hatch@multitech.com> | 2018-06-25 13:20:43 -0500 | 
|---|---|---|
| committer | Jeff Hatch <Jeff.Hatch@multitech.com> | 2018-06-25 13:20:43 -0500 | 
| commit | 472b181a37d5abf81a698caea1379d12ef91d4ee (patch) | |
| tree | 52c0ede3a3058be18c5995910d6dd604f04410e2 | |
| parent | 5d78c924aab3cbb35f09c911534d2c2ce763457e (diff) | |
| download | libmts-io-472b181a37d5abf81a698caea1379d12ef91d4ee.tar.gz libmts-io-472b181a37d5abf81a698caea1379d12ef91d4ee.tar.bz2 libmts-io-472b181a37d5abf81a698caea1379d12ef91d4ee.zip | |
Update convertModelToMtsShortCode signature to support LNA3 and LAT3 radios1.0.11
| -rw-r--r-- | include/mts/MTS_IO_CellularRadio.h | 2 | ||||
| -rw-r--r-- | src/MTS_IO_CellularRadio.cpp | 18 | 
2 files changed, 12 insertions, 8 deletions
| diff --git a/include/mts/MTS_IO_CellularRadio.h b/include/mts/MTS_IO_CellularRadio.h index ca3eeb2..007c130 100644 --- a/include/mts/MTS_IO_CellularRadio.h +++ b/include/mts/MTS_IO_CellularRadio.h @@ -261,7 +261,7 @@ namespace MTS {                  virtual CODE getModel(std::string& sModel);                  static CODE convertModelToType(const std::string& sModel, std::string& sType); -                static CODE convertModelToMtsShortCode(const std::string& sModel, std::string& sCode); +                static CODE convertModelToMtsShortCode(const std::string& sModel, std::string& sCode, CellularRadio *radioObj = NULL);                  static CODE convertServiceDomainToString(SERVICEDOMAIN eSd, std::string& sSd);                  static CODE convertActiveBandToString(ACTIVEBAND eBand, std::string& sBand); diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index 1842c23..a29ef2d 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -283,7 +283,7 @@ CellularRadio::CODE CellularRadio::getModel(std::string& sModel) {      return SUCCESS;  } -CellularRadio::CODE CellularRadio::convertModelToMtsShortCode(const std::string& sModel, std::string& sCode) { +CellularRadio::CODE CellularRadio::convertModelToMtsShortCode(const std::string& sModel, std::string& sCode, CellularRadio *radioObject) {      CODE eCode = FAILURE;      if(sModel.find("HE910-D") == 0) { @@ -302,13 +302,17 @@ CellularRadio::CODE CellularRadio::convertModelToMtsShortCode(const std::string&          sCode = "LAT1";          eCode = SUCCESS;      } else if (sModel.find("LE910-NA1") == 0) { -        std::string cmd = "radio-query --active-firmware"; -        std::string result; -        int32_t code = MTS::System::cmd(cmd, result); -        if (!code) { -            sCode = "LNA3"; +        if (NULL == radioObject) { +            sCode = VALUE_NOT_SUPPORTED; +            eCode = ERROR;          } else { -            sCode = "LAT3"; +            std::string sValue; +            eCode = radioObject->getActiveFirmware(sValue); +            if (eCode == SUCCESS) { +                sCode = "LNA3"; +            } else { +                sCode = "LAT3"; +            }          }          eCode = SUCCESS;      } else if (sModel.find("LE910-SVG") == 0) { | 
