diff options
-rw-r--r-- | include/mts/MTS_IO_CellularRadio.h | 6 | ||||
-rw-r--r-- | src/MTS_IO_CellularRadio.cpp | 81 |
2 files changed, 4 insertions, 83 deletions
diff --git a/include/mts/MTS_IO_CellularRadio.h b/include/mts/MTS_IO_CellularRadio.h index 1576588..c4e5b86 100644 --- a/include/mts/MTS_IO_CellularRadio.h +++ b/include/mts/MTS_IO_CellularRadio.h @@ -119,9 +119,11 @@ namespace MTS { CellularRadio(const std::string& sName, const std::string& sRadioPort); - virtual bool getCarrierFromFirmware(const std::string& sFirmware, std::string& sCarrier); - virtual bool getHardwareVersionFromFirmware(const std::string& sFirmware, std::string& sHardware); + virtual bool getCarrierFromFirmware(const std::string& sFirmware, std::string& sCarrier) = 0; + virtual bool getHardwareVersionFromFirmware(const std::string& sFirmware, std::string& sHardware) = 0; + virtual void getCommonNetworkStats(Json::Value& jData); + void initMipProfile(Json::Value& jData); bool splitAndAssign(const std::string& sLine, const std::string& sKey, Json::Value& jParent, const std::string& sJsonKey, Json::ValueType eType = Json::ValueType::stringValue); diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp index e3927ea..092da35 100644 --- a/src/MTS_IO_CellularRadio.cpp +++ b/src/MTS_IO_CellularRadio.cpp @@ -991,87 +991,6 @@ bool CellularRadio::splitAndAssign(const std::string& sLine, const std::string& return true; } -bool CellularRadio::getCarrierFromFirmware(const std::string& sFirmware, std::string& sCarrier) { - // Telit Radios - // H.ab.zyx => 3 Main Components - // "H" = Hardware -> 15 = DE910 family, 18 = CE910 family, 12 = HE910 family - // "a" = Hardware version - // "b" = Software Major Version - // "z" = is the product type, i.e. DUAL or SC - // "y" = is the carrier variant - // "x" = is the firmware version - // Telit will do their best to keep the carrier variant as "0" for Sprint, "1" for Aeris, "2" for Verizon, and "3" for U.S. Cellular. - - const uint32_t CARRIER_INDEX = 1; //y in [zyx] - - bool bResult = false; - std::vector<std::string> vParts = MTS::Text::split(sFirmware, '.'); - - if(vParts.size() == 3) { - //CDMA firmware version notation - if(vParts[0] == "15" || vParts[0] == "18") { - //DE910 or CE910 -> Good good - std::string sID = vParts[2]; - if(sID.size() == 3) { - char cId = sID[CARRIER_INDEX]; - - //Good good - if(cId == '0') { - sCarrier = VALUE_CARRIER_SPRINT; - bResult = true; - } else - if(cId == '1') { - sCarrier = VALUE_CARRIER_AERIS; - bResult = true; - } else - if(cId == '2') { - sCarrier = VALUE_CARRIER_VERIZON; - bResult = true; - } else - if(cId == '3') { - sCarrier = VALUE_CARRIER_USCELLULAR; - bResult = true; - } - } - } - } - - return bResult; -} - -bool CellularRadio::getHardwareVersionFromFirmware(const std::string& sFirmware, std::string& sHardware) { - // Telit Radios - // H.ab.zyx => 3 Main Components - // "H" = Hardware -> 15 = DE910 family, 18 = CE910 family, 12 = HE910 family - // "a" = Hardware version - // "b" = Software Major Version - // "z" = is the product type, i.e. DUAL or SC - // "y" = is the carrier variant - // "x" = is the firmware version - // Telit will do their best to keep the carrier variant as "0" for Sprint, "1" for Aeris, and "2" for Verizon. - - const uint32_t HARDWARE_INDEX = 0; //a in [ab] - - bool bResult = false; - std::vector<std::string> vParts = MTS::Text::split(sFirmware, '.'); - - if(vParts.size() == 3) { - //GSM Hardware Version - if(!(vParts[0] == "15" || vParts[0] == "18")) { - //Not DE910 or CE910 -> Good good - std::string sVersion = vParts[1]; - if(sVersion.size() == 2) { - sHardware = "1."; - sHardware += sVersion[HARDWARE_INDEX]; - bResult = true; - } - } - } - - return bResult; - -} - const char *CellularRadio::RadioBandMap::getLTEBand(const int32_t channel) { for (unsigned int ii = 0; ii < NUM_LTE_BANDS; ii++) |