summaryrefslogtreecommitdiff
path: root/src/MTS_IO_ME910C1NVRadio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MTS_IO_ME910C1NVRadio.cpp')
-rw-r--r--src/MTS_IO_ME910C1NVRadio.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/MTS_IO_ME910C1NVRadio.cpp b/src/MTS_IO_ME910C1NVRadio.cpp
index e9a4874..08c18e9 100644
--- a/src/MTS_IO_ME910C1NVRadio.cpp
+++ b/src/MTS_IO_ME910C1NVRadio.cpp
@@ -53,13 +53,13 @@ ME910C1NVRadio::ME910C1NVRadio(const std::string& sPort)
}
-CellularRadio::CODE ME910C1NVRadio::getCarrier(std::string& sCarrier) {
+ME910C1NVRadio::CODE ME910C1NVRadio::getCarrier(std::string& sCarrier) {
sCarrier = "Verizon";
return SUCCESS;
}
-CellularRadio::CODE ME910C1NVRadio::doGetFirmwareNumbers(std::string &sFirmware, std::string &sFirmwareBuild) {
- CellularRadio::CODE rc = FAILURE;
+ME910C1NVRadio::CODE ME910C1NVRadio::doGetFirmwareNumbers(std::string &sFirmware, std::string &sFirmwareBuild) {
+ CODE rc = FAILURE;
rc = getFirmware(sFirmware);
if (rc != SUCCESS){
@@ -74,9 +74,9 @@ CellularRadio::CODE ME910C1NVRadio::doGetFirmwareNumbers(std::string &sFirmware,
return rc;
}
-CellularRadio::CODE ME910C1NVRadio::doFumoReadConfig(const Json::Value& jArgs, Json::Value &jConfig)
+ME910C1NVRadio::CODE ME910C1NVRadio::doFumoReadConfig(const Json::Value& jArgs, Json::Value &jConfig)
{
- CellularRadio::CODE rc = INVALID_ARGS;
+ CODE rc = INVALID_ARGS;
std::string sPath;
do
@@ -196,9 +196,9 @@ CellularRadio::CODE ME910C1NVRadio::doFumoReadConfig(const Json::Value& jArgs, J
return rc;
}
-CellularRadio::CODE ME910C1NVRadio::doFumoSetup(const Json::Value &jConfig, UpdateCb& stepCb)
+ME910C1NVRadio::CODE ME910C1NVRadio::doFumoSetup(const Json::Value &jConfig, UpdateCb& stepCb)
{
- CellularRadio::CODE rc = FAILURE;
+ CODE rc = FAILURE;
std::string sCmd;
std::string sContextId = jConfig[KEY_FUMO_PDPID].asString();
@@ -215,7 +215,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoSetup(const Json::Value &jConfig, Upda
// AT#SGACT=<cid>,<stat>[,<userId>,<pwd>]
//
sCmd = "AT#SGACT=" + sContextId + ",0";
- rc = CellularRadio::sendBasicCommand(sCmd);
+ rc = sendBasicCommand(sCmd);
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: Failed to deactivate PDP context"));
@@ -244,7 +244,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoSetup(const Json::Value &jConfig, Upda
if (!sApn.empty()) {
sCmd += ",\"" + sApn + "\"";
}
- rc = CellularRadio::sendBasicCommand(sCmd, 1000);
+ rc = sendBasicCommand(sCmd, 1000);
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: Failed to setup PDP context"));
@@ -267,7 +267,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoSetup(const Json::Value &jConfig, Upda
// less than max packet size (timeout value in hundreds of milliseconds).
//
sCmd = "AT#SCFG=1," + sContextId + ",300,90,600,50";
- rc = CellularRadio::sendBasicCommand(sCmd);
+ rc = sendBasicCommand(sCmd);
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: Failed to set connection configuration parameters"));
@@ -279,7 +279,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoSetup(const Json::Value &jConfig, Upda
// Activate PDP context
//
sCmd = "AT#SGACT=" + sContextId + ",1";
- rc = CellularRadio::sendBasicCommand(sCmd, 60 * 1000);
+ rc = sendBasicCommand(sCmd, 60 * 1000);
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: Failed to activate PDP context"));
@@ -292,9 +292,9 @@ CellularRadio::CODE ME910C1NVRadio::doFumoSetup(const Json::Value &jConfig, Upda
return rc;
}
-CellularRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, UpdateCb& stepCb)
+ME910C1NVRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, UpdateCb& stepCb)
{
- CellularRadio::CODE rc = FAILURE;
+ CODE rc = FAILURE;
std::string sCmd;
std::string sResult;
@@ -305,7 +305,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, Update
// AT#FTPTO= [<tout>]
// <tout> - time-out in 100 ms units
//
- rc = CellularRadio::sendBasicCommand("AT#FTPTO=2400");
+ rc = sendBasicCommand("AT#FTPTO=2400");
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: Failed to setup connection timeout"));
@@ -322,7 +322,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, Update
sCmd += "\"" + jConfig[KEY_FUMO_ADDRESS].asString() + "\",";
sCmd += "\"" + jConfig[KEY_FUMO_USER].asString() + "\",";
sCmd += "\"" + jConfig[KEY_FUMO_PASSWORD].asString() + "\",1";
- rc = CellularRadio::sendBasicCommand(sCmd, 60 * 1000);
+ rc = sendBasicCommand(sCmd, 60 * 1000);
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: Failed to open connection"));
@@ -344,7 +344,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, Update
// 0 - binary
// 1 - ascii
//
- rc = CellularRadio::sendBasicCommand("AT#FTPTYPE=0", 1000);
+ rc = sendBasicCommand("AT#FTPTYPE=0", 1000);
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: failed to set file transfer type"));
@@ -363,7 +363,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, Update
sCmd += jConfig[KEY_FUMO_DIR].asString() + "/";
}
sCmd += "\"";
- rc = CellularRadio::sendBasicCommand(sCmd, 60 * 1000);
+ rc = sendBasicCommand(sCmd, 60 * 1000);
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: failed to change working directory on the server"));
@@ -380,7 +380,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, Update
//
sCmd = "AT#FTPGETOTA=";
sCmd += "\"" + jConfig[KEY_FUMO_FILE].asString() + "\",1,1";
- CellularRadio::sendBasicCommand(sCmd);
+ sendBasicCommand(sCmd);
//
// Noticed that after successful AT#FTPGETOTA the radio resets the connection.
@@ -396,12 +396,12 @@ CellularRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, Update
{
MTS::Thread::sleep(5000);
- rc = CellularRadio::sendBasicCommand("AT");
+ rc = sendBasicCommand("AT");
if (rc == SUCCESS) {
break;
}
- CellularRadio::resetConnection(1);
+ resetConnection(1);
}
oTimer.stop();
@@ -450,7 +450,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, Update
//
// AT#FTPCLOSE
//
- CellularRadio::CODE rcclose = CellularRadio::sendBasicCommand("AT#FTPCLOSE", 60 * 1000);
+ CODE rcclose = sendBasicCommand("AT#FTPCLOSE", 60 * 1000);
if (rcclose != SUCCESS && rc == SUCCESS) {
if(stepCb) {
// Only one "FUMO Error" message should be sent
@@ -468,9 +468,9 @@ CellularRadio::CODE ME910C1NVRadio::doFumoFtp(const Json::Value &jConfig, Update
return rc;
}
-CellularRadio::CODE ME910C1NVRadio::doFumoCleanup(const Json::Value &jConfig, UpdateCb& stepCb)
+ME910C1NVRadio::CODE ME910C1NVRadio::doFumoCleanup(const Json::Value &jConfig, UpdateCb& stepCb)
{
- CellularRadio::CODE rc = FAILURE;
+ CODE rc = FAILURE;
std::string sCmd;
std::string sContextId = jConfig[KEY_FUMO_PDPID].asString();
@@ -479,7 +479,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoCleanup(const Json::Value &jConfig, Up
// Deactivate PDP context
//
sCmd = "AT#SGACT=" + sContextId + ",0";
- rc = CellularRadio::sendBasicCommand(sCmd, 10000);
+ rc = sendBasicCommand(sCmd, 10000);
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: Failed to deactivate PDP context"));
@@ -488,9 +488,9 @@ CellularRadio::CODE ME910C1NVRadio::doFumoCleanup(const Json::Value &jConfig, Up
return rc;
}
-CellularRadio::CODE ME910C1NVRadio::doFumoApplyFirmware(const Json::Value &jConfig, UpdateCb& stepCb)
+ME910C1NVRadio::CODE ME910C1NVRadio::doFumoApplyFirmware(const Json::Value &jConfig, UpdateCb& stepCb)
{
- CellularRadio::CODE rc = FAILURE;
+ CODE rc = FAILURE;
if (jConfig.isMember(KEY_FUMO_DRYRUN)) {
if(stepCb) {
@@ -499,7 +499,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoApplyFirmware(const Json::Value &jConf
return SUCCESS;
}
- rc = CellularRadio::sendBasicCommand("AT#OTAUP=0", 10000);
+ rc = sendBasicCommand("AT#OTAUP=0", 10000);
if (rc != SUCCESS) {
if(stepCb) {
stepCb(Json::Value("FUMO Error: failed to apply the firmware"));
@@ -514,11 +514,11 @@ CellularRadio::CODE ME910C1NVRadio::doFumoApplyFirmware(const Json::Value &jConf
return rc;
}
-CellularRadio::CODE ME910C1NVRadio::doFumoWaitNewFirmware(const Json::Value &jConfig, UpdateCb& stepCb)
+ME910C1NVRadio::CODE ME910C1NVRadio::doFumoWaitNewFirmware(const Json::Value &jConfig, UpdateCb& stepCb)
{
std::string sFirmware;
std::string sFirmwareBuild;
- CellularRadio::CODE rc = FAILURE;
+ CODE rc = FAILURE;
if (jConfig.isMember(KEY_FUMO_DRYRUN)) {
if(stepCb) {
@@ -539,7 +539,7 @@ CellularRadio::CODE ME910C1NVRadio::doFumoWaitNewFirmware(const Json::Value &jCo
if (doGetFirmwareNumbers(sFirmware, sFirmwareBuild) != SUCCESS) {
// The radio is probably unavailable
- CellularRadio::resetConnection(100);
+ resetConnection(100);
continue;
}
@@ -570,9 +570,9 @@ CellularRadio::CODE ME910C1NVRadio::doFumoWaitNewFirmware(const Json::Value &jCo
}
-CellularRadio::CODE ME910C1NVRadio::doFumoPerform(const Json::Value &jConfig, UpdateCb& stepCb)
+ME910C1NVRadio::CODE ME910C1NVRadio::doFumoPerform(const Json::Value &jConfig, UpdateCb& stepCb)
{
- CellularRadio::CODE rc = FAILURE;
+ CODE rc = FAILURE;
UpdateCb dummyCb;
@@ -606,10 +606,10 @@ CellularRadio::CODE ME910C1NVRadio::doFumoPerform(const Json::Value &jConfig, Up
return rc;
}
-CellularRadio::CODE ME910C1NVRadio::updateFumo(const Json::Value& jArgs, UpdateCb& stepCb)
+ME910C1NVRadio::CODE ME910C1NVRadio::updateFumo(const Json::Value& jArgs, UpdateCb& stepCb)
{
Json::Value jConfig(Json::objectValue);
- CellularRadio::CODE rc = FAILURE;
+ CODE rc = FAILURE;
rc = doFumoReadConfig(jArgs, jConfig);
if (rc != SUCCESS) {