summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBijoy Anose <banose@multitech.com>2015-11-03 10:03:25 -0600
committerBijoy Anose <banose@multitech.com>2015-11-03 10:03:25 -0600
commit98281d3bda9fae91c265e0b626782ebbaaab7bdf (patch)
tree389c2699fe40717589665b65ce29e1cd1bf834b8
parent88d22d0cb8f7a3d23472d13f17221176d3a43057 (diff)
downloadlibmts-io-98281d3bda9fae91c265e0b626782ebbaaab7bdf.tar.gz
libmts-io-98281d3bda9fae91c265e0b626782ebbaaab7bdf.tar.bz2
libmts-io-98281d3bda9fae91c265e0b626782ebbaaab7bdf.zip
[IN001490] libmts-io: Implementing setRxDiversity function for applicable radio models
-rw-r--r--include/mts/MTS_IO_CE910Radio.h1
-rw-r--r--include/mts/MTS_IO_CellularRadio.h7
-rw-r--r--include/mts/MTS_IO_DE910Radio.h1
-rw-r--r--include/mts/MTS_IO_GE910Radio.h1
-rw-r--r--include/mts/MTS_IO_HE910Radio.h1
-rw-r--r--include/mts/MTS_IO_LE910Radio.h1
-rw-r--r--src/MTS_IO_CE910Radio.cpp5
-rw-r--r--src/MTS_IO_DE910Radio.cpp11
-rw-r--r--src/MTS_IO_GE910Radio.cpp4
-rw-r--r--src/MTS_IO_HE910Radio.cpp12
-rw-r--r--src/MTS_IO_LE910Radio.cpp13
11 files changed, 55 insertions, 2 deletions
diff --git a/include/mts/MTS_IO_CE910Radio.h b/include/mts/MTS_IO_CE910Radio.h
index 47444d9..58642cb 100644
--- a/include/mts/MTS_IO_CE910Radio.h
+++ b/include/mts/MTS_IO_CE910Radio.h
@@ -41,6 +41,7 @@ namespace MTS {
CE910Radio(const std::string& sPort);
virtual ~CE910Radio(){};
+ CODE setRxDiversity(const Json::Value& jArgs);
protected:
diff --git a/include/mts/MTS_IO_CellularRadio.h b/include/mts/MTS_IO_CellularRadio.h
index 71190c5..a90c469 100644
--- a/include/mts/MTS_IO_CellularRadio.h
+++ b/include/mts/MTS_IO_CellularRadio.h
@@ -418,6 +418,13 @@ namespace MTS {
*/
virtual CODE activate(const Json::Value& jArgs, UpdateCb& stepCb);
+ /*
+ * jArgs = {
+ * "enabled" : "RX Diversity Enabled ("0" or "1"): STRING"
+ * }
+ */
+ virtual CODE setRxDiversity(const Json::Value& jArgs)=0;
+
virtual CODE getEcho(bool& bEnabled);
virtual CODE setEcho(bool bEnabled = true);
diff --git a/include/mts/MTS_IO_DE910Radio.h b/include/mts/MTS_IO_DE910Radio.h
index e9e8287..9f9b9ae 100644
--- a/include/mts/MTS_IO_DE910Radio.h
+++ b/include/mts/MTS_IO_DE910Radio.h
@@ -41,6 +41,7 @@ namespace MTS {
DE910Radio(const std::string& sPort);
virtual ~DE910Radio(){};
+ CODE setRxDiversity(const Json::Value& jArgs);
protected:
diff --git a/include/mts/MTS_IO_GE910Radio.h b/include/mts/MTS_IO_GE910Radio.h
index 403e623..27efbac 100644
--- a/include/mts/MTS_IO_GE910Radio.h
+++ b/include/mts/MTS_IO_GE910Radio.h
@@ -41,6 +41,7 @@ namespace MTS {
GE910Radio(const std::string& sPort);
virtual ~GE910Radio(){};
+ CODE setRxDiversity(const Json::Value& jArgs);
protected:
diff --git a/include/mts/MTS_IO_HE910Radio.h b/include/mts/MTS_IO_HE910Radio.h
index 8c1aaa1..e6fc73c 100644
--- a/include/mts/MTS_IO_HE910Radio.h
+++ b/include/mts/MTS_IO_HE910Radio.h
@@ -39,6 +39,7 @@ namespace MTS {
public:
virtual ~HE910Radio(){};
+ CODE setRxDiversity(const Json::Value& jArgs);
protected:
HE910Radio(const std::string& sHE910Model, const std::string& sPort);
diff --git a/include/mts/MTS_IO_LE910Radio.h b/include/mts/MTS_IO_LE910Radio.h
index 5391304..f46094e 100644
--- a/include/mts/MTS_IO_LE910Radio.h
+++ b/include/mts/MTS_IO_LE910Radio.h
@@ -41,6 +41,7 @@ namespace MTS {
LE910Radio(const std::string& sLE910Model, const std::string& sPort);
virtual ~LE910Radio(){};
+ CODE setRxDiversity(const Json::Value& jArgs);
protected:
diff --git a/src/MTS_IO_CE910Radio.cpp b/src/MTS_IO_CE910Radio.cpp
index bb6e97a..7bdf280 100644
--- a/src/MTS_IO_CE910Radio.cpp
+++ b/src/MTS_IO_CE910Radio.cpp
@@ -39,4 +39,7 @@ CE910Radio::CE910Radio(const std::string& sPort)
}
-
+CellularRadio::CODE CE910Radio::setRxDiversity(const Json::Value& jArgs) {
+/* Command string for CE radios: N/A */
+ return FAILURE;
+}
diff --git a/src/MTS_IO_DE910Radio.cpp b/src/MTS_IO_DE910Radio.cpp
index f11e8c5..eccb3eb 100644
--- a/src/MTS_IO_DE910Radio.cpp
+++ b/src/MTS_IO_DE910Radio.cpp
@@ -39,3 +39,14 @@ DE910Radio::DE910Radio(const std::string& sPort)
}
+CellularRadio::CODE DE910Radio::setRxDiversity(const Json::Value& jArgs) {
+/* Command string for EV3 radios: AT#CRXD= */
+ if (jArgs["enabled"].asString() != "1" && jArgs["enabled"].asString() != "0")
+ {
+ return FAILURE;
+ }
+ std::string sCmd = "AT#CRXD=";
+ sCmd += jArgs["enabled"].asString();
+
+ return sendBasicCommand(sCmd);
+}
diff --git a/src/MTS_IO_GE910Radio.cpp b/src/MTS_IO_GE910Radio.cpp
index 7e35323..e402b13 100644
--- a/src/MTS_IO_GE910Radio.cpp
+++ b/src/MTS_IO_GE910Radio.cpp
@@ -39,3 +39,7 @@ GE910Radio::GE910Radio(const std::string& sPort)
}
+CellularRadio::CODE GE910Radio::setRxDiversity(const Json::Value& jArgs) {
+/* Command string for GE radios: N/A */
+ return FAILURE;
+}
diff --git a/src/MTS_IO_HE910Radio.cpp b/src/MTS_IO_HE910Radio.cpp
index f548b4e..bc08932 100644
--- a/src/MTS_IO_HE910Radio.cpp
+++ b/src/MTS_IO_HE910Radio.cpp
@@ -37,4 +37,14 @@ HE910Radio::HE910Radio(const std::string& sHE910Model, const std::string& sPort)
}
-
+CellularRadio::CODE HE910Radio::setRxDiversity(const Json::Value& jArgs) {
+/* Command string for H5 radios: "AT#RXDIV" */
+ if (jArgs["enabled"].asString() != "1" && jArgs["enabled"].asString() != "0")
+ {
+ return FAILURE;
+ }
+ std::string sCmd = "AT#RXDIV=";
+ sCmd += jArgs["enabled"].asString();
+
+ return sendBasicCommand(sCmd);
+}
diff --git a/src/MTS_IO_LE910Radio.cpp b/src/MTS_IO_LE910Radio.cpp
index 66a074e..33719f2 100644
--- a/src/MTS_IO_LE910Radio.cpp
+++ b/src/MTS_IO_LE910Radio.cpp
@@ -37,3 +37,16 @@ LE910Radio::LE910Radio(const std::string& sLE910Model, const std::string& sPort)
}
+CellularRadio::CODE LE910Radio::setRxDiversity(const Json::Value& jArgs) {
+/* Command string for LAT1,LVW2,LEU1 radios: "AT#RXDIV=" */
+/* Setting needs to append ",1" to the 0/1 value */
+ if (jArgs["enabled"].asString() != "1" && jArgs["enabled"].asString() != "0")
+ {
+ return FAILURE;
+ }
+ std::string sCmd = "AT#RXDIV=";
+ sCmd += jArgs["enabled"].asString();
+ sCmd += ",1";
+
+ return CellularRadio::sendBasicCommand(sCmd);
+}