summaryrefslogtreecommitdiff
path: root/src/MTS_IO_CellularRadio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTS_IO_CellularRadio.cpp')
-rw-r--r--src/MTS_IO_CellularRadio.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/src/MTS_IO_CellularRadio.cpp b/src/MTS_IO_CellularRadio.cpp
index feccd3c..3f0c037 100644
--- a/src/MTS_IO_CellularRadio.cpp
+++ b/src/MTS_IO_CellularRadio.cpp
@@ -113,7 +113,7 @@ bool CellularRadio::initialize(uint32_t iTimeoutMillis) {
}
bool bEnabled;
- CODE eCode = getEcho(bEnabled);
+ ICellularRadio::CODE eCode = getEcho(bEnabled);
if(eCode == SUCCESS && bEnabled) {
printDebug("%s| Disabling 'echo'", m_sName.c_str());
setEcho(false);
@@ -173,7 +173,7 @@ const std::string& CellularRadio::getName() const {
return m_sName;
}
-CellularRadio::CODE CellularRadio::getFirmware(std::string& sFirmware) {
+ICellularRadio::CODE CellularRadio::getFirmware(std::string& sFirmware) {
printTrace("%s| Get Firmware", m_sName.c_str());
sFirmware = ICellularRadio::VALUE_NOT_SUPPORTED;
std::string sCmd("AT+CGMR");
@@ -195,12 +195,12 @@ CellularRadio::CODE CellularRadio::getFirmware(std::string& sFirmware) {
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::getFirmwareBuild(std::string& sFirmwareBuild) {
+ICellularRadio::CODE CellularRadio::getFirmwareBuild(std::string& sFirmwareBuild) {
sFirmwareBuild = ICellularRadio::VALUE_NOT_SUPPORTED;
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getHardware(std::string& sHardware) {
+ICellularRadio::CODE CellularRadio::getHardware(std::string& sHardware) {
printTrace("%s| Get Hardware", m_sName.c_str());
sHardware = ICellularRadio::VALUE_NOT_SUPPORTED;
@@ -214,7 +214,7 @@ CellularRadio::CODE CellularRadio::getHardware(std::string& sHardware) {
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getManufacturer(std::string& sManufacturer) {
+ICellularRadio::CODE CellularRadio::getManufacturer(std::string& sManufacturer) {
printTrace("%s| Get Manufacturer", m_sName.c_str());
sManufacturer = ICellularRadio::VALUE_NOT_SUPPORTED;
std::string sCmd("AT+GMI");
@@ -234,7 +234,7 @@ CellularRadio::CODE CellularRadio::getManufacturer(std::string& sManufacturer) {
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::getImei(std::string& sImei) {
+ICellularRadio::CODE CellularRadio::getImei(std::string& sImei) {
printTrace("%s| Get IMEI", m_sName.c_str());
sImei = ICellularRadio::VALUE_NOT_SUPPORTED;
@@ -257,12 +257,12 @@ CellularRadio::CODE CellularRadio::getImei(std::string& sImei) {
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::getMeid(std::string& sMeid) {
+ICellularRadio::CODE CellularRadio::getMeid(std::string& sMeid) {
printTrace("%s| Get MEID", m_sName.c_str());
return getImei(sMeid);
}
-CellularRadio::CODE CellularRadio::getImsi(std::string& sImsi) {
+ICellularRadio::CODE CellularRadio::getImsi(std::string& sImsi) {
printTrace("%s| Get IMSI", m_sName.c_str());
sImsi = ICellularRadio::VALUE_NOT_SUPPORTED;
@@ -285,19 +285,19 @@ CellularRadio::CODE CellularRadio::getImsi(std::string& sImsi) {
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::getSimStatus(std::string& sSimStatus) {
+ICellularRadio::CODE CellularRadio::getSimStatus(std::string& sSimStatus) {
printTrace("%s| Get SIM Status", getName().c_str());
sSimStatus = ICellularRadio::VALUE_UNKNOWN;
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getSimStatusSummary(Json::Value& jData) {
+ICellularRadio::CODE CellularRadio::getSimStatusSummary(Json::Value& jData) {
bool bIsSimInserted = false;
bool bIsSimLocked = true;
int iAttemptsPin = 0;
int iAttemptsPuk = 0;
std::string sSimLockStatus;
- CODE retCode;
+ ICellularRadio::CODE retCode;
do {
retCode = getIsSimInserted(bIsSimInserted);
@@ -335,7 +335,7 @@ CellularRadio::CODE CellularRadio::getSimStatusSummary(Json::Value& jData) {
return retCode;
}
-CellularRadio::CODE CellularRadio::getLac(std::string& sLac) {
+ICellularRadio::CODE CellularRadio::getLac(std::string& sLac) {
Json::Value jData;
printTrace("%s| Get LAC", m_sName.c_str());
@@ -351,7 +351,7 @@ CellularRadio::CODE CellularRadio::getLac(std::string& sLac) {
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getMdn(std::string& sMdn) {
+ICellularRadio::CODE CellularRadio::getMdn(std::string& sMdn) {
printTrace("%s| Get MDN", m_sName.c_str());
sMdn = ICellularRadio::VALUE_NOT_SUPPORTED;
@@ -385,7 +385,7 @@ CellularRadio::CODE CellularRadio::getMdn(std::string& sMdn) {
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::getMsid(std::string& sMsid) {
+ICellularRadio::CODE CellularRadio::getMsid(std::string& sMsid) {
printTrace("%s| Get MSID", m_sName.c_str());
sMsid = "";
@@ -401,13 +401,13 @@ CellularRadio::CODE CellularRadio::getMsid(std::string& sMsid) {
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getType(std::string& sType) {
+ICellularRadio::CODE CellularRadio::getType(std::string& sType) {
printTrace("%s| Get Type", m_sName.c_str());
sType = ICellularRadio::VALUE_NOT_SUPPORTED;
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getCarrier(std::string& sCarrier) {
+ICellularRadio::CODE CellularRadio::getCarrier(std::string& sCarrier) {
printTrace("%s| Get Carrier", m_sName.c_str());
if(m_sCarrier == "") {
Json::Value jData;
@@ -437,7 +437,7 @@ CellularRadio::CODE CellularRadio::getCarrier(std::string& sCarrier) {
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::getTower(std::string& sTower) {
+ICellularRadio::CODE CellularRadio::getTower(std::string& sTower) {
Json::Value jData;
printTrace("%s| Get Tower", m_sName.c_str());
@@ -452,7 +452,7 @@ CellularRadio::CODE CellularRadio::getTower(std::string& sTower) {
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getTime(std::string& sDate, std::string& sTime, std::string& sTimeZone) {
+ICellularRadio::CODE CellularRadio::getTime(std::string& sDate, std::string& sTime, std::string& sTimeZone) {
Json::Value jData;
printTrace("%s| Get Time", m_sName.c_str());
@@ -527,7 +527,7 @@ CellularRadio::CODE CellularRadio::getTime(std::string& sDate, std::string& sTim
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getRoaming(bool& bRoaming) {
+ICellularRadio::CODE CellularRadio::getRoaming(bool& bRoaming) {
Json::Value jData;
printTrace("%s| Get Roaming", m_sName.c_str());
@@ -541,7 +541,7 @@ CellularRadio::CODE CellularRadio::getRoaming(bool& bRoaming) {
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getSignalStrength(int32_t& rssi) {
+ICellularRadio::CODE CellularRadio::getSignalStrength(int32_t& rssi) {
printTrace("%s| Get Signal Strength", m_sName.c_str());
// AT+CSQ execution can take up to 300ms according to the Quectel datasheet. Setting timeout to 500ms just for sure.
@@ -567,12 +567,12 @@ CellularRadio::CODE CellularRadio::getSignalStrength(int32_t& rssi) {
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::getModemLocation(std::string&) {
+ICellularRadio::CODE CellularRadio::getModemLocation(std::string&) {
printTrace("%s|CellularRadio getModemLocation - not supported", m_sName.c_str());
return FAILURE;
}
-CellularRadio::CODE CellularRadio::getEcho(bool& bEnabled) {
+ICellularRadio::CODE CellularRadio::getEcho(bool& bEnabled) {
printTrace("%s| Echo Test", m_sName.c_str());
std::string sResult = sendCommand("AT");
if(sResult.size() == 0) {
@@ -588,8 +588,8 @@ CellularRadio::CODE CellularRadio::getEcho(bool& bEnabled) {
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::setEcho(bool bEnabled) {
- CODE eCode = FAILURE;
+ICellularRadio::CODE CellularRadio::setEcho(bool bEnabled) {
+ ICellularRadio::CODE eCode = FAILURE;
if(bEnabled) {
eCode = sendBasicCommand("ATE1");
m_bEchoEnabled = (eCode == SUCCESS ) ? true : m_bEchoEnabled;
@@ -601,7 +601,7 @@ CellularRadio::CODE CellularRadio::setEcho(bool bEnabled) {
return eCode;
}
-CellularRadio::CODE CellularRadio::getStaticInformation(Json::Value& jData) {
+ICellularRadio::CODE CellularRadio::getStaticInformation(Json::Value& jData) {
printTrace("%s| Get Static Information", m_sName.c_str());
printTrace("%s| Static Information:\n%s\n", m_sName.c_str(), jData.toStyledString().c_str());
@@ -696,7 +696,7 @@ void CellularRadio::getCommonNetworkStats(Json::Value& jData) {
}
}
-CellularRadio::CODE CellularRadio::getSimLockStatus(std::string& sData)
+ICellularRadio::CODE CellularRadio::getSimLockStatus(std::string& sData)
{
printTrace("%s| Get SIM lock status", m_sName.c_str());
@@ -736,7 +736,7 @@ void CellularRadio::initMipProfile(Json::Value& jData) {
jData[ICellularRadio::KEY_MIP_MNHASS] = false;
}
-CellularRadio::CODE CellularRadio::getRegistration(REGISTRATION& eRegistration) {
+ICellularRadio::CODE CellularRadio::getRegistration(REGISTRATION& eRegistration) {
std::string sCmd;
std::string sResp;
@@ -770,9 +770,9 @@ CellularRadio::CODE CellularRadio::getRegistration(REGISTRATION& eRegistration)
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::convertRegistrationToString(REGISTRATION eRegistration, std::string& sRegistration) {
+ICellularRadio::CODE CellularRadio::convertRegistrationToString(REGISTRATION eRegistration, std::string& sRegistration) {
- CODE eCode = FAILURE;
+ ICellularRadio::CODE eCode = FAILURE;
switch (eRegistration) {
case NOT_REGISTERED: sRegistration = ICellularRadio::VALUE_NOT_REGISTERED; eCode = SUCCESS; break;
case REGISTERED: sRegistration = ICellularRadio::VALUE_REGISTERED; eCode = SUCCESS; break;
@@ -784,7 +784,7 @@ CellularRadio::CODE CellularRadio::convertRegistrationToString(REGISTRATION eReg
return eCode;
}
-CellularRadio::CODE CellularRadio::unlockSimCard(const Json::Value& jArgs) {
+ICellularRadio::CODE CellularRadio::unlockSimCard(const Json::Value& jArgs) {
printTrace("%s| Unlock the SIM card using PIN code", m_sName.c_str());
if(!jArgs["pin"].isString()) {
@@ -803,128 +803,128 @@ CellularRadio::CODE CellularRadio::unlockSimCard(const Json::Value& jArgs) {
return SUCCESS;
}
-CellularRadio::CODE CellularRadio::validateMsl(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::validateMsl(const Json::Value&) {
printTrace("%s| Validate MSL", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMsid(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMsid(const Json::Value&) {
printTrace("%s| Set MSID", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::getMipProfile(Json::Value&) {
+ICellularRadio::CODE CellularRadio::getMipProfile(Json::Value&) {
printTrace("%s| Get MIP Active Profile", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipActiveProfile(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipActiveProfile(const Json::Value&) {
printTrace("%s| Set MIP Active Profile", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipNai(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipNai(const Json::Value&) {
printTrace("%s| Set MIP NAI", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipHomeIp(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipHomeIp(const Json::Value&) {
printTrace("%s| Set MIP Home IP", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipPrimaryHa(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipPrimaryHa(const Json::Value&) {
printTrace("%s| Set MIP Primary HA", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipSecondaryHa(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipSecondaryHa(const Json::Value&) {
printTrace("%s| Set MIP Secondary HA", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipMnAaaSpi(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipMnAaaSpi(const Json::Value&) {
printTrace("%s| Set MIP MN-AAA SPI", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipMnHaSpi(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipMnHaSpi(const Json::Value&) {
printTrace("%s| Set MIP MN-HA SPI", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipRevTun(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipRevTun(const Json::Value&) {
printTrace("%s| Set MIP Rev Tun", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipMnAaaSs(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipMnAaaSs(const Json::Value&) {
printTrace("%s| Set MIP MN-AAA SS", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setMipMnHaSs(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setMipMnHaSs(const Json::Value&) {
printTrace("%s| Set MIP MN-HA SS", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::updateDc(const Json::Value&, UpdateCb&) {
+ICellularRadio::CODE CellularRadio::updateDc(const Json::Value&, UpdateCb&) {
printTrace("%s| Update Device Configuration", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::updatePrl(const Json::Value&, UpdateCb&) {
+ICellularRadio::CODE CellularRadio::updatePrl(const Json::Value&, UpdateCb&) {
printTrace("%s| Update Preferred Roaming List", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::updateFumo(const Json::Value&, UpdateCb&) {
+ICellularRadio::CODE CellularRadio::updateFumo(const Json::Value&, UpdateCb&) {
printTrace("%s| Update Firmware Update Management Object", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::resetHfa(const Json::Value&, UpdateCb&) {
+ICellularRadio::CODE CellularRadio::resetHfa(const Json::Value&, UpdateCb&) {
printTrace("%s| HFA Reset", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::activate(const Json::Value&, UpdateCb&) {
+ICellularRadio::CODE CellularRadio::activate(const Json::Value&, UpdateCb&) {
printTrace("%s| Activation", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::setActiveFirmware(const Json::Value&) {
+ICellularRadio::CODE CellularRadio::setActiveFirmware(const Json::Value&) {
printTrace("%s| Set Active Firmware Image Number: not applicable", m_sName.c_str());
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::getActiveFirmware(std::string& sFwId) {
+ICellularRadio::CODE CellularRadio::getActiveFirmware(std::string& sFwId) {
printTrace("%s| Get Active Firmware Image Number: not applicable", m_sName.c_str());
sFwId = ICellularRadio::VALUE_NOT_SUPPORTED;
return NOT_APPLICABLE;
}
-CellularRadio::CODE CellularRadio::sendBasicCommand(const std::string& sCmd, int32_t iTimeoutMillis, const char& ESC) {
+ICellularRadio::CODE CellularRadio::sendBasicCommand(const std::string& sCmd, int32_t iTimeoutMillis, const char& ESC) {
std::string response = sendCommand(sCmd, DEFAULT_BAIL_STRINGS, iTimeoutMillis, ESC);
if (response.size() == 0) {
return NO_RESPONSE;