summaryrefslogtreecommitdiff
path: root/src/MTS_IO_CdmaRadio.cpp
diff options
context:
space:
mode:
authorJeff Hatch <jhatch@multitech.com>2019-07-23 08:51:41 -0500
committerJeff Hatch <jhatch@multitech.com>2019-07-23 08:51:41 -0500
commitf6f7d0e174d2bf5eb4494e2508c17d3d7fbdc4e9 (patch)
tree4f0e44ed31f0e536835260ff5b4849f84289ee9c /src/MTS_IO_CdmaRadio.cpp
parent86e572b513259e1f7164dd4e4b0f490c870bfc30 (diff)
parent0330513b8913d1d7bf14bad99d64ab002b770b7c (diff)
downloadlibmts-io-f6f7d0e174d2bf5eb4494e2508c17d3d7fbdc4e9.tar.gz
libmts-io-f6f7d0e174d2bf5eb4494e2508c17d3d7fbdc4e9.tar.bz2
libmts-io-f6f7d0e174d2bf5eb4494e2508c17d3d7fbdc4e9.zip
Merge branch 'quectel-radio' into 'master'
Quectel radio See merge request !1
Diffstat (limited to 'src/MTS_IO_CdmaRadio.cpp')
-rw-r--r--src/MTS_IO_CdmaRadio.cpp216
1 files changed, 108 insertions, 108 deletions
diff --git a/src/MTS_IO_CdmaRadio.cpp b/src/MTS_IO_CdmaRadio.cpp
index 5b53f02..f84fd34 100644
--- a/src/MTS_IO_CdmaRadio.cpp
+++ b/src/MTS_IO_CdmaRadio.cpp
@@ -35,7 +35,7 @@
using namespace MTS::IO;
CdmaRadio::CdmaRadio(const std::string& sName, const std::string& sPort)
-: CellularRadio(sName, sPort)
+: TelitRadio(sName, sPort)
{
}
@@ -44,17 +44,17 @@ CdmaRadio::~CdmaRadio() {
}
-CellularRadio::CODE CdmaRadio::getImei(std::string& sImei) {
+ICellularRadio::CODE CdmaRadio::getImei(std::string& sImei) {
printTrace("%s| Get IMEI", getName().c_str());
return getMeid(sImei);
}
-CellularRadio::CODE CdmaRadio::getMeid(std::string& sMeid) {
+ICellularRadio::CODE CdmaRadio::getMeid(std::string& sMeid) {
printTrace("%s| Get MEID", getName().c_str());
- sMeid = VALUE_NOT_SUPPORTED;
+ sMeid = ICellularRadio::VALUE_NOT_SUPPORTED;
std::string sCmd("AT#MEIDESN?");
- std::string sResult = CellularRadio::sendCommand(sCmd);
- size_t pos = sResult.find(RSP_OK);
+ std::string sResult = sendCommand(sCmd);
+ size_t pos = sResult.find(ICellularRadio::RSP_OK);
if (pos == std::string::npos) {
printWarning("%s| Unable to get MEID from radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -72,12 +72,12 @@ CellularRadio::CODE CdmaRadio::getMeid(std::string& sMeid) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::getMsid(std::string& sMsid) {
+ICellularRadio::CODE CdmaRadio::getMsid(std::string& sMsid) {
printTrace("%s| Get MSID", getName().c_str());
- sMsid = VALUE_NOT_SUPPORTED;
+ sMsid = ICellularRadio::VALUE_NOT_SUPPORTED;
std::string sCmd("AT$MSID?");
- std::string sResult = CellularRadio::sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ std::string sResult = sendCommand(sCmd);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to get MSID from radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -92,14 +92,14 @@ CellularRadio::CODE CdmaRadio::getMsid(std::string& sMsid) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::getCarrier(std::string& sCarrier) {
+ICellularRadio::CODE CdmaRadio::getCarrier(std::string& sCarrier) {
if(m_sCarrier != "") {
sCarrier = m_sCarrier;
return SUCCESS;
}
std::string sFirmware;
- CODE code = getFirmware(sFirmware);
+ ICellularRadio::CODE code = getFirmware(sFirmware);
if(code != SUCCESS) {
return code;
}
@@ -113,34 +113,34 @@ CellularRadio::CODE CdmaRadio::getCarrier(std::string& sCarrier) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::getNetwork(std::string& sNetwork) {
+ICellularRadio::CODE CdmaRadio::getNetwork(std::string& sNetwork) {
return getCarrier(sNetwork);
}
-CellularRadio::CODE CdmaRadio::getSimStatus(std::string& sSimStatus) {
+ICellularRadio::CODE CdmaRadio::getSimStatus(std::string& sSimStatus) {
printTrace("%s| Get SIM Status", getName().c_str());
- sSimStatus = VALUE_NOT_SUPPORTED;
+ sSimStatus = ICellularRadio::VALUE_NOT_SUPPORTED;
return NOT_APPLICABLE;
}
-CellularRadio::CODE CdmaRadio::getIccid(std::string& sIccid) {
+ICellularRadio::CODE CdmaRadio::getIccid(std::string& sIccid) {
printTrace("%s| Get ICCID", getName().c_str());
- sIccid = VALUE_NOT_SUPPORTED;
+ sIccid = ICellularRadio::VALUE_NOT_SUPPORTED;
return NOT_APPLICABLE;
}
-CellularRadio::CODE CdmaRadio::getLac(std::string& sLac) {
+ICellularRadio::CODE CdmaRadio::getLac(std::string& sLac) {
printTrace("%s| Get LAC", getName().c_str());
- sLac = VALUE_NOT_SUPPORTED;
+ sLac = ICellularRadio::VALUE_NOT_SUPPORTED;
return NOT_APPLICABLE;
}
-CellularRadio::CODE CdmaRadio::getService(std::string& sService) {
+ICellularRadio::CODE CdmaRadio::getService(std::string& sService) {
printTrace("%s| Get Service", getName().c_str());
- sService = VALUE_NOT_SUPPORTED;
+ sService = ICellularRadio::VALUE_NOT_SUPPORTED;
std::string sCmd("AT+SERVICE?");
- std::string sResult = CellularRadio::sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ std::string sResult = sendCommand(sCmd);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to get Service from radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -159,7 +159,7 @@ CellularRadio::CODE CdmaRadio::getService(std::string& sService) {
case 2: sService = "EVDO"; break; //Release 0
case 3: sService = "EVDO"; break; //Release A
case 4: sService = "GPRS"; break;
- default: sService = VALUE_UNKNOWN; break;
+ default: sService = ICellularRadio::VALUE_UNKNOWN; break;
}
printDebug("%s| Service ID: [%d][%s]", getName().c_str(), iService, sService.c_str());
@@ -167,12 +167,12 @@ CellularRadio::CODE CdmaRadio::getService(std::string& sService) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::getHardware(std::string& sHardware) {
+ICellularRadio::CODE CdmaRadio::getHardware(std::string& sHardware) {
printTrace("%s| Get Hardware", getName().c_str());
- sHardware = VALUE_NOT_SUPPORTED;
+ sHardware = ICellularRadio::VALUE_NOT_SUPPORTED;
std::string sCmd("AT#HWREV");
- std::string sResult = CellularRadio::sendCommand(sCmd);
- size_t pos = sResult.find(RSP_OK);
+ std::string sResult = sendCommand(sCmd);
+ size_t pos = sResult.find(ICellularRadio::RSP_OK);
if (pos == std::string::npos) {
printWarning("%s| Unable to get hardware from radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -187,12 +187,12 @@ CellularRadio::CODE CdmaRadio::getHardware(std::string& sHardware) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::getMdn(std::string& sMdn) {
+ICellularRadio::CODE CdmaRadio::getMdn(std::string& sMdn) {
printTrace("%s| Get MDN", getName().c_str());
- sMdn = VALUE_NOT_SUPPORTED;
+ sMdn = ICellularRadio::VALUE_NOT_SUPPORTED;
std::string sCmd("AT+CNUM");
- std::string sResult = CellularRadio::sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ std::string sResult = sendCommand(sCmd);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to get MDN from radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -213,7 +213,7 @@ CellularRadio::CODE CdmaRadio::getMdn(std::string& sMdn) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::validateMsl(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::validateMsl(const Json::Value& jArgs) {
printTrace("%s| Validate MSL", getName().c_str());
if(!jArgs["msl"].isString()) {
@@ -239,7 +239,7 @@ CellularRadio::CODE CdmaRadio::validateMsl(const Json::Value& jArgs) {
return setMdn(jMdn);
}
-CellularRadio::CODE CdmaRadio::setMdn(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMdn(const Json::Value& jArgs) {
printTrace("%s| Set MDN", getName().c_str());
if(!jArgs["mdn"].isString()) {
@@ -274,7 +274,7 @@ CellularRadio::CODE CdmaRadio::setMdn(const Json::Value& jArgs) {
sCmd += sMdn;
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set MDN for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -283,7 +283,7 @@ CellularRadio::CODE CdmaRadio::setMdn(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMsid(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMsid(const Json::Value& jArgs) {
printTrace("%s| Set MSID", getName().c_str());
if(!jArgs["msid"].isString()) {
printError("%s| Arguments missing \"msid\"", getName().c_str());
@@ -309,7 +309,7 @@ CellularRadio::CODE CdmaRadio::setMsid(const Json::Value& jArgs) {
sCmd += jArgs["msid"].asString();
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set MSID for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -318,7 +318,7 @@ CellularRadio::CODE CdmaRadio::setMsid(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::getMipProfile(Json::Value& jMipProfile) {
+ICellularRadio::CODE CdmaRadio::getMipProfile(Json::Value& jMipProfile) {
printTrace("%s| Get MIP Active Profile", getName().c_str());
initMipProfile(jMipProfile);
@@ -329,7 +329,7 @@ CellularRadio::CODE CdmaRadio::getMipProfile(Json::Value& jMipProfile) {
if(sCarrier == "Aeris" || sCarrier == "Sprint") {
std::string sCmd("AT$QCMIPGETP");
std::string sResult = MTS::Text::trim(sendCommand(sCmd));
- if (sResult.find(RSP_OK) == std::string::npos) {
+ if (sResult.find(ICellularRadio::RSP_OK) == std::string::npos) {
printWarning("%s| Unable to get active MIP profile for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
}
@@ -341,34 +341,34 @@ CellularRadio::CODE CdmaRadio::getMipProfile(Json::Value& jMipProfile) {
std::vector<std::string> vParts = MTS::Text::split(sLine, ':', 2);
if(vParts.size() == 2 && vParts[0] == "Profile") {
if(vParts[1].find("Enabled") != std::string::npos) {
- jMipProfile[KEY_MIP_ENABLED] = true;
+ jMipProfile[ICellularRadio::KEY_MIP_ENABLED] = true;
} else {
- jMipProfile[KEY_MIP_ENABLED] = false;
+ jMipProfile[ICellularRadio::KEY_MIP_ENABLED] = false;
}
int32_t id;
sscanf(vParts[1].c_str(), "%d", &id);
- jMipProfile[KEY_MIP_ID] = id;
+ jMipProfile[ICellularRadio::KEY_MIP_ID] = id;
} else {
printWarning("%s| Unable to parse active MIP profile from line [%s]", getName().c_str(), sLine.c_str());
}
- splitAndAssign(vLine[1], "NAI", jMipProfile, KEY_MIP_NAI);
- splitAndAssign(vLine[2], "Home Addr", jMipProfile, KEY_MIP_HOMEADDRESS);
- splitAndAssign(vLine[3], "Primary HA", jMipProfile, KEY_MIP_PRIMARYHA);
- splitAndAssign(vLine[4], "Secondary HA", jMipProfile, KEY_MIP_SECONDARYHA);
- splitAndAssign(vLine[5], "MN-AAA SPI", jMipProfile, KEY_MIP_MNAAASPI);
- splitAndAssign(vLine[6], "MN-HA SPI", jMipProfile, KEY_MIP_MNHASPI);
+ splitAndAssign(vLine[1], "NAI", jMipProfile, ICellularRadio::KEY_MIP_NAI);
+ splitAndAssign(vLine[2], "Home Addr", jMipProfile, ICellularRadio::KEY_MIP_HOMEADDRESS);
+ splitAndAssign(vLine[3], "Primary HA", jMipProfile, ICellularRadio::KEY_MIP_PRIMARYHA);
+ splitAndAssign(vLine[4], "Secondary HA", jMipProfile, ICellularRadio::KEY_MIP_SECONDARYHA);
+ splitAndAssign(vLine[5], "MN-AAA SPI", jMipProfile, ICellularRadio::KEY_MIP_MNAAASPI);
+ splitAndAssign(vLine[6], "MN-HA SPI", jMipProfile, ICellularRadio::KEY_MIP_MNHASPI);
//Reverse Tunneling
sLine = vLine[7];
vParts = MTS::Text::split(sLine, ':', 2);
if(vParts.size() == 2 && vParts[0] == "Rev Tun") {
if(vParts[1] == "1") {
- jMipProfile[KEY_MIP_REVTUN] = true;
+ jMipProfile[ICellularRadio::KEY_MIP_REVTUN] = true;
} else {
- jMipProfile[KEY_MIP_REVTUN] = false;
+ jMipProfile[ICellularRadio::KEY_MIP_REVTUN] = false;
}
} else {
printWarning("%s| Unable to parse Reverse Tunneling from line [%s]", getName().c_str(), sLine.c_str());
@@ -379,9 +379,9 @@ CellularRadio::CODE CdmaRadio::getMipProfile(Json::Value& jMipProfile) {
vParts = MTS::Text::split(sLine, ':', 2);
if(vParts.size() == 2 && vParts[0] == "MN-AAA SS") {
if(vParts[1] == "Set") {
- jMipProfile[KEY_MIP_MNAAASS] = true;
+ jMipProfile[ICellularRadio::KEY_MIP_MNAAASS] = true;
} else {
- jMipProfile[KEY_MIP_MNAAASS] = false;
+ jMipProfile[ICellularRadio::KEY_MIP_MNAAASS] = false;
}
} else {
printWarning("%s| Unable to parse MN-AAA SS from line [%s]", getName().c_str(), sLine.c_str());
@@ -392,9 +392,9 @@ CellularRadio::CODE CdmaRadio::getMipProfile(Json::Value& jMipProfile) {
vParts = MTS::Text::split(sLine, ':', 2);
if(vParts.size() == 2 && vParts[0] == "MN-HA SS") {
if(vParts[1] == "Set") {
- jMipProfile[KEY_MIP_MNHASS] = true;
+ jMipProfile[ICellularRadio::KEY_MIP_MNHASS] = true;
} else {
- jMipProfile[KEY_MIP_MNHASS] = false;
+ jMipProfile[ICellularRadio::KEY_MIP_MNHASS] = false;
}
} else {
printWarning("%s| Unable to parse MN-HA SS from line [%s]", getName().c_str(), sLine.c_str());
@@ -406,7 +406,7 @@ CellularRadio::CODE CdmaRadio::getMipProfile(Json::Value& jMipProfile) {
}
-CellularRadio::CODE CdmaRadio::setMipActiveProfile(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipActiveProfile(const Json::Value& jArgs) {
printTrace("%s| Set MIP Active Profile", getName().c_str());
if(!jArgs["activeProfile"].isString()) {
@@ -417,7 +417,7 @@ CellularRadio::CODE CdmaRadio::setMipActiveProfile(const Json::Value& jArgs) {
sCmd += jArgs["activeProfile"].asString();
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set Active profile for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -426,7 +426,7 @@ CellularRadio::CODE CdmaRadio::setMipActiveProfile(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMipNai(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipNai(const Json::Value& jArgs) {
printTrace("%s| Set MIP NAI", getName().c_str());
if(!jArgs["nai"].isString()) {
@@ -437,7 +437,7 @@ CellularRadio::CODE CdmaRadio::setMipNai(const Json::Value& jArgs) {
sCmd += jArgs["nai"].asString() + ",1";
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set NAI for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -446,7 +446,7 @@ CellularRadio::CODE CdmaRadio::setMipNai(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMipHomeIp(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipHomeIp(const Json::Value& jArgs) {
printTrace("%s| Set MIP Home IP", getName().c_str());
if(!jArgs["homeIp"].isString()) {
@@ -457,7 +457,7 @@ CellularRadio::CODE CdmaRadio::setMipHomeIp(const Json::Value& jArgs) {
sCmd += jArgs["homeIp"].asString() + ",1";
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set Home IP profile for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -466,7 +466,7 @@ CellularRadio::CODE CdmaRadio::setMipHomeIp(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMipPrimaryHa(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipPrimaryHa(const Json::Value& jArgs) {
printTrace("%s| Set MIP Primary HA", getName().c_str());
if(!jArgs["primaryHa"].isString()) {
@@ -477,7 +477,7 @@ CellularRadio::CODE CdmaRadio::setMipPrimaryHa(const Json::Value& jArgs) {
sCmd += jArgs["primaryHa"].asString() + ",1";
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set Primary HA for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -486,7 +486,7 @@ CellularRadio::CODE CdmaRadio::setMipPrimaryHa(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMipSecondaryHa(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipSecondaryHa(const Json::Value& jArgs) {
printTrace("%s| Set MIP Secondary HA", getName().c_str());
if(!jArgs["secondaryHa"].isString()) {
@@ -497,7 +497,7 @@ CellularRadio::CODE CdmaRadio::setMipSecondaryHa(const Json::Value& jArgs) {
sCmd += jArgs["secondaryHa"].asString() + ",1";
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set Secondary HA for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -506,7 +506,7 @@ CellularRadio::CODE CdmaRadio::setMipSecondaryHa(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMipMnAaaSpi(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipMnAaaSpi(const Json::Value& jArgs) {
printTrace("%s| Set MIP MN-AAA SPI", getName().c_str());
if(!jArgs["mnAaaSpi"].isString()) {
@@ -517,7 +517,7 @@ CellularRadio::CODE CdmaRadio::setMipMnAaaSpi(const Json::Value& jArgs) {
sCmd += jArgs["mnAaaSpi"].asString() + ",1";
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set MN-AAA SPI for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -526,7 +526,7 @@ CellularRadio::CODE CdmaRadio::setMipMnAaaSpi(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMipMnHaSpi(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipMnHaSpi(const Json::Value& jArgs) {
printTrace("%s| Set MIP MN-HA SPI", getName().c_str());
if(!jArgs["mnHaSpi"].isString()) {
@@ -537,7 +537,7 @@ CellularRadio::CODE CdmaRadio::setMipMnHaSpi(const Json::Value& jArgs) {
sCmd += jArgs["mnHaSpi"].asString() + ",1";
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set MN-HA SPI for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -546,7 +546,7 @@ CellularRadio::CODE CdmaRadio::setMipMnHaSpi(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMipRevTun(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipRevTun(const Json::Value& jArgs) {
printTrace("%s| Set MIP Rev Tun", getName().c_str());
if(!jArgs["revTun"].isString()) {
@@ -557,7 +557,7 @@ CellularRadio::CODE CdmaRadio::setMipRevTun(const Json::Value& jArgs) {
sCmd += jArgs["revTun"].asString() + ",1";
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set Rev Tun for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -566,7 +566,7 @@ CellularRadio::CODE CdmaRadio::setMipRevTun(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMipMnAaaSs(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipMnAaaSs(const Json::Value& jArgs) {
printTrace("%s| Set MIP MN-AAA SS", getName().c_str());
if(!jArgs["mnAaaSs"].isString()) {
@@ -577,7 +577,7 @@ CellularRadio::CODE CdmaRadio::setMipMnAaaSs(const Json::Value& jArgs) {
sCmd += jArgs["mnAaaSs"].asString() + ",1";
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set MN-AAA SS for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -586,7 +586,7 @@ CellularRadio::CODE CdmaRadio::setMipMnAaaSs(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::setMipMnHaSs(const Json::Value& jArgs) {
+ICellularRadio::CODE CdmaRadio::setMipMnHaSs(const Json::Value& jArgs) {
printTrace("%s| Set MIP MN-HA SS", getName().c_str());
if(!jArgs["mnHaSs"].isString()) {
@@ -597,7 +597,7 @@ CellularRadio::CODE CdmaRadio::setMipMnHaSs(const Json::Value& jArgs) {
sCmd += jArgs["mnHaSs"].asString() + ",1";
std::string sResult = sendCommand(sCmd);
- size_t end = sResult.find(RSP_OK);
+ size_t end = sResult.find(ICellularRadio::RSP_OK);
if (end == std::string::npos) {
printWarning("%s| Unable to set MN-HA SS for radio using command [%s]", getName().c_str(), sCmd.c_str());
return FAILURE;
@@ -606,7 +606,7 @@ CellularRadio::CODE CdmaRadio::setMipMnHaSs(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CdmaRadio::updateDc(const Json::Value& jArgs, UpdateCb& stepCb) {
+ICellularRadio::CODE CdmaRadio::updateDc(const Json::Value& jArgs, UpdateCb& stepCb) {
printTrace("%s| Update Device Configuration", getName().c_str());
std::string sCarrier;
@@ -616,7 +616,7 @@ CellularRadio::CODE CdmaRadio::updateDc(const Json::Value& jArgs, UpdateCb& step
return NOT_APPLICABLE;
}
- CellularRadio::CODE result = FAILURE;
+ ICellularRadio::CODE result = FAILURE;
std::size_t pos = 0;
std::size_t end = 0;
@@ -627,7 +627,7 @@ CellularRadio::CODE CdmaRadio::updateDc(const Json::Value& jArgs, UpdateCb& step
return true;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
printTrace("%s| Update DC Callback Started", this->getName().c_str());
while(end != std::string::npos) {
@@ -683,7 +683,7 @@ CellularRadio::CODE CdmaRadio::updateDc(const Json::Value& jArgs, UpdateCb& step
stepCb(Json::Value("DC Error: update fails with other reasons"));
}
return false;
- }else if(sLine == RSP_ERROR) {
+ }else if(sLine == ICellularRadio::RSP_ERROR) {
result = ERROR;
return false;
}
@@ -692,7 +692,7 @@ CellularRadio::CODE CdmaRadio::updateDc(const Json::Value& jArgs, UpdateCb& step
if(next != std::string::npos) {
pos = next;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
}
printTrace("%s| Update DC Callback Finished", this->getName().c_str());
@@ -703,7 +703,7 @@ CellularRadio::CODE CdmaRadio::updateDc(const Json::Value& jArgs, UpdateCb& step
return result;
}
-CellularRadio::CODE CdmaRadio::updatePrl(const Json::Value& jArgs, UpdateCb& stepCb) {
+ICellularRadio::CODE CdmaRadio::updatePrl(const Json::Value& jArgs, UpdateCb& stepCb) {
printTrace("%s| Update Preferred Roaming List", getName().c_str());
std::string sCarrier;
@@ -713,7 +713,7 @@ CellularRadio::CODE CdmaRadio::updatePrl(const Json::Value& jArgs, UpdateCb& ste
return NOT_APPLICABLE;
}
- CellularRadio::CODE result = FAILURE;
+ ICellularRadio::CODE result = FAILURE;
std::size_t pos = 0;
std::size_t end = 0;
@@ -724,7 +724,7 @@ CellularRadio::CODE CdmaRadio::updatePrl(const Json::Value& jArgs, UpdateCb& ste
return true;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
printTrace("%s| Update PRL Callback Started", this->getName().c_str());
while(end != std::string::npos) {
@@ -780,7 +780,7 @@ CellularRadio::CODE CdmaRadio::updatePrl(const Json::Value& jArgs, UpdateCb& ste
stepCb(Json::Value("PRL Error: update fails with other reasons"));
}
return false;
- } else if(sLine == RSP_ERROR) {
+ } else if(sLine == ICellularRadio::RSP_ERROR) {
result = ERROR;
return false;
}
@@ -789,7 +789,7 @@ CellularRadio::CODE CdmaRadio::updatePrl(const Json::Value& jArgs, UpdateCb& ste
if(next != std::string::npos) {
pos = next;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
}
printTrace("%s| Update PRL Callback Finished", this->getName().c_str());
@@ -800,7 +800,7 @@ CellularRadio::CODE CdmaRadio::updatePrl(const Json::Value& jArgs, UpdateCb& ste
return result;
}
-CellularRadio::CODE CdmaRadio::updateFumo(const Json::Value& jArgs, UpdateCb& stepCb) {
+ICellularRadio::CODE CdmaRadio::updateFumo(const Json::Value& jArgs, UpdateCb& stepCb) {
printTrace("%s| Update Firmware Update Management Object", getName().c_str());
std::string sCarrier;
@@ -810,7 +810,7 @@ CellularRadio::CODE CdmaRadio::updateFumo(const Json::Value& jArgs, UpdateCb& st
return NOT_APPLICABLE;
}
- CellularRadio::CODE result = FAILURE;
+ ICellularRadio::CODE result = FAILURE;
std::size_t pos = 0;
std::size_t end = 0;
@@ -821,7 +821,7 @@ CellularRadio::CODE CdmaRadio::updateFumo(const Json::Value& jArgs, UpdateCb& st
return true;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
printTrace("%s| Update FUMO Callback Started", this->getName().c_str());
while(end != std::string::npos) {
@@ -937,7 +937,7 @@ CellularRadio::CODE CdmaRadio::updateFumo(const Json::Value& jArgs, UpdateCb& st
if(stepCb) {
stepCb(Json::Value("FUMO Info: reporting of firmware update result to server"));
}
- } else if(sLine == RSP_ERROR) {
+ } else if(sLine == ICellularRadio::RSP_ERROR) {
result = ERROR;
return false;
}
@@ -946,7 +946,7 @@ CellularRadio::CODE CdmaRadio::updateFumo(const Json::Value& jArgs, UpdateCb& st
if(next != std::string::npos) {
pos = next;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
}
printTrace("%s| Update FUMO Callback Finished", this->getName().c_str());
@@ -957,7 +957,7 @@ CellularRadio::CODE CdmaRadio::updateFumo(const Json::Value& jArgs, UpdateCb& st
return result;
}
-CellularRadio::CODE CdmaRadio::resetHfa(const Json::Value& jArgs, UpdateCb& stepCb) {
+ICellularRadio::CODE CdmaRadio::resetHfa(const Json::Value& jArgs, UpdateCb& stepCb) {
printTrace("%s| HFA Reset (after device reboot HFA will occur)", getName().c_str());
std::string sCarrier;
@@ -971,7 +971,7 @@ CellularRadio::CODE CdmaRadio::resetHfa(const Json::Value& jArgs, UpdateCb& step
return INVALID_ARGS;
}
- CellularRadio::CODE result = FAILURE;
+ ICellularRadio::CODE result = FAILURE;
std::size_t pos = 0;
std::size_t end = 0;
@@ -992,7 +992,7 @@ CellularRadio::CODE CdmaRadio::resetHfa(const Json::Value& jArgs, UpdateCb& step
return true;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
printTrace("%s| HFA Reset Callback Started", this->getName().c_str());
while(end != std::string::npos) {
@@ -1032,10 +1032,10 @@ CellularRadio::CODE CdmaRadio::resetHfa(const Json::Value& jArgs, UpdateCb& step
stepCb(Json::Value("RTN Done: Firmware DM - Session Completed Successfully"));
}
return false;
- } else if(sLine == RSP_ERROR) {
+ } else if(sLine == ICellularRadio::RSP_ERROR) {
result = ERROR;
return false;
- } else if(sLine == RSP_OK) {
+ } else if(sLine == ICellularRadio::RSP_OK) {
//The Device will reboot now, so reset the connection
if(stepCb) {
stepCb(Json::Value("RTN Info: Resetting Radio"));
@@ -1062,7 +1062,7 @@ CellularRadio::CODE CdmaRadio::resetHfa(const Json::Value& jArgs, UpdateCb& step
if(next != std::string::npos) {
pos = next;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
}
printTrace("%s| HFA Reset Callback Finished", this->getName().c_str());
@@ -1075,14 +1075,14 @@ CellularRadio::CODE CdmaRadio::resetHfa(const Json::Value& jArgs, UpdateCb& step
return result;
}
-CellularRadio::CODE CdmaRadio::activate(const Json::Value& jArgs, UpdateCb& stepCb) {
+ICellularRadio::CODE CdmaRadio::activate(const Json::Value& jArgs, UpdateCb& stepCb) {
printTrace("%s| Activation", getName().c_str());
std::string sActivationCmd;
std::string sCarrier;
getCarrier(sCarrier);
- if(sCarrier == VALUE_CARRIER_AERIS) {
+ if(sCarrier == ICellularRadio::VALUE_CARRIER_AERIS) {
if(!jArgs["msid"].isString()) {
printError("%s| Arguments missing \"msid\"", getName().c_str());
@@ -1107,7 +1107,7 @@ CellularRadio::CODE CdmaRadio::activate(const Json::Value& jArgs, UpdateCb& step
}
//Set MDN & MSID
- CellularRadio::CODE code;
+ ICellularRadio::CODE code;
code = setMdn(jArgs);
if(code != SUCCESS) {
return code;
@@ -1122,15 +1122,15 @@ CellularRadio::CODE CdmaRadio::activate(const Json::Value& jArgs, UpdateCb& step
return SUCCESS;
- } else if(sCarrier == VALUE_CARRIER_VERIZON) {
+ } else if(sCarrier == ICellularRadio::VALUE_CARRIER_VERIZON) {
sActivationCmd = "AT+CDV*22899\r";
- } else if(sCarrier == VALUE_CARRIER_USCELLULAR) {
+ } else if(sCarrier == ICellularRadio::VALUE_CARRIER_USCELLULAR) {
sActivationCmd = "AT+CDV*228\r";
} else {
return NOT_APPLICABLE;
}
- CellularRadio::CODE result = FAILURE;
+ ICellularRadio::CODE result = FAILURE;
std::size_t pos = 0;
std::size_t end = 0;
@@ -1153,7 +1153,7 @@ CellularRadio::CODE CdmaRadio::activate(const Json::Value& jArgs, UpdateCb& step
return true;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
printTrace("%s| Activation Reset Callback Started", this->getName().c_str());
while(end != std::string::npos) {
@@ -1162,7 +1162,7 @@ CellularRadio::CODE CdmaRadio::activate(const Json::Value& jArgs, UpdateCb& step
printTrace("%s| Line: [%s]", this->getName().c_str(), sLine.c_str());
- if(sLine == RSP_OK) {
+ if(sLine == ICellularRadio::RSP_OK) {
if(stepCb) {
stepCb(Json::Value("Activation Info: Over-the-Air Programming in Process"));
}
@@ -1194,7 +1194,7 @@ CellularRadio::CODE CdmaRadio::activate(const Json::Value& jArgs, UpdateCb& step
}
result = ERROR;
return false;
- } else if(sLine == RSP_ERROR) {
+ } else if(sLine == ICellularRadio::RSP_ERROR) {
result = ERROR;
return false;
}
@@ -1203,7 +1203,7 @@ CellularRadio::CODE CdmaRadio::activate(const Json::Value& jArgs, UpdateCb& step
if(next != std::string::npos) {
pos = next;
}
- end = allData.find(NL, pos);
+ end = allData.find(ICellularRadio::NL, pos);
}
printTrace("%s| Activation Callback Finished", this->getName().c_str());
@@ -1214,7 +1214,7 @@ CellularRadio::CODE CdmaRadio::activate(const Json::Value& jArgs, UpdateCb& step
return result;
}
-CellularRadio::CODE CdmaRadio::getNetworkStatus(Json::Value& jData) {
+ICellularRadio::CODE CdmaRadio::getNetworkStatus(Json::Value& jData) {
printTrace("%s| Get Network Status", getName().c_str());
getCommonNetworkStats(jData);
@@ -1222,11 +1222,11 @@ CellularRadio::CODE CdmaRadio::getNetworkStatus(Json::Value& jData) {
std::string sCarrier;
getCarrier(sCarrier);
- if(sCarrier == VALUE_CARRIER_SPRINT) {
+ if(sCarrier == ICellularRadio::VALUE_CARRIER_SPRINT) {
Json::Value& jDebug = jData["debug"];
std::string sCmd("AT$DEBUG?");
std::string sResult = MTS::Text::trim(sendCommand(sCmd));
- if (sResult.find(RSP_OK) != std::string::npos) {
+ if (sResult.find(ICellularRadio::RSP_OK) != std::string::npos) {
std::vector<std::string> vCategories = MTS::Text::split(sResult, "\r\n\r\n");
for(size_t i = 0 ; i < vCategories.size(); i++) {
std::vector<std::string> vLine = MTS::Text::split(vCategories[i], "\r\n");