summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Reiss <jreiss@multitech.com>2016-09-14 11:02:19 -0500
committerJason Reiss <jreiss@multitech.com>2016-09-14 11:02:19 -0500
commit692b74778f6b95cf0c668dfdb85f39035e113baa (patch)
treee7bc7d35baef7f63146a4e25e7df34c6c4030fd7
parent173c34ce2472d33c957457de125a56a83ff11aa1 (diff)
downloadmtdot-box-evb-factory-firmware-692b74778f6b95cf0c668dfdb85f39035e113baa.tar.gz
mtdot-box-evb-factory-firmware-692b74778f6b95cf0c668dfdb85f39035e113baa.tar.bz2
mtdot-box-evb-factory-firmware-692b74778f6b95cf0c668dfdb85f39035e113baa.zip
Add AT+TXF and AT+SENDC debug commands
-rw-r--r--CommandTerminal/CmdSendContinuous.cpp13
-rw-r--r--CommandTerminal/CmdSendContinuous.h18
-rw-r--r--CommandTerminal/CmdTxFrequency.cpp26
-rw-r--r--CommandTerminal/CmdTxFrequency.h20
-rw-r--r--CommandTerminal/CmdWriteProtectedConfig.cpp4
-rw-r--r--CommandTerminal/CmdWriteProtectedConfig.h1
-rw-r--r--CommandTerminal/Commands.h2
-rw-r--r--Mode/ModeConfig.cpp2
8 files changed, 86 insertions, 0 deletions
diff --git a/CommandTerminal/CmdSendContinuous.cpp b/CommandTerminal/CmdSendContinuous.cpp
new file mode 100644
index 0000000..843d5bf
--- /dev/null
+++ b/CommandTerminal/CmdSendContinuous.cpp
@@ -0,0 +1,13 @@
+#include "CmdSendContinuous.h"
+
+CmdSendContinuous::CmdSendContinuous(mDot* dot)
+: Command(dot, "Send Continuous", "AT+SENDC", "Send un-modulated data continuously") {
+}
+
+uint32_t CmdSendContinuous::action(std::vector<std::string> args) {
+
+ _dot->sendContinuous(true);
+
+ return 0;
+}
+
diff --git a/CommandTerminal/CmdSendContinuous.h b/CommandTerminal/CmdSendContinuous.h
new file mode 100644
index 0000000..403ab54
--- /dev/null
+++ b/CommandTerminal/CmdSendContinuous.h
@@ -0,0 +1,18 @@
+
+#ifndef __CMDSENDCONTINUOUS_H__
+#define __CMDSENDCONTINUOUS_H__
+
+#include "Command.h"
+
+class CmdSendContinuous : public Command {
+
+public:
+
+ CmdSendContinuous(mDot* dot);
+ uint32_t action(std::vector<std::string> args);
+
+private:
+
+};
+
+#endif // __CMDSENDCONTINUOUS_H__
diff --git a/CommandTerminal/CmdTxFrequency.cpp b/CommandTerminal/CmdTxFrequency.cpp
new file mode 100644
index 0000000..35e7f8d
--- /dev/null
+++ b/CommandTerminal/CmdTxFrequency.cpp
@@ -0,0 +1,26 @@
+#include "CmdTxFrequency.h"
+#include <climits>
+
+
+CmdTxFrequency::CmdTxFrequency(mDot* dot) :
+ Command(dot, "Tx Frequency", "AT+TXF", "Set Tx frequency") {
+}
+
+uint32_t CmdTxFrequency::action(std::vector<std::string> args)
+{
+ if (args.size() == 2)
+ {
+ int frequency = 0;
+
+ sscanf(args[1].c_str(), "%d", &frequency);
+ _dot->setTxFrequency(frequency);
+ }
+
+ return 0;
+}
+
+bool CmdTxFrequency::verify(std::vector<std::string> args)
+{
+ return true;
+}
+
diff --git a/CommandTerminal/CmdTxFrequency.h b/CommandTerminal/CmdTxFrequency.h
new file mode 100644
index 0000000..22eb777
--- /dev/null
+++ b/CommandTerminal/CmdTxFrequency.h
@@ -0,0 +1,20 @@
+#ifndef __CMDTXFREQUENCY_H__
+#define __CMDTXFREQUENCY_H__
+
+#include "Command.h"
+
+class CommandTerminal;
+
+class CmdTxFrequency : public Command {
+
+public:
+
+ CmdTxFrequency(mDot* dot);
+ uint32_t action(std::vector<std::string> args);
+ bool verify(std::vector<std::string> args);
+
+private:
+
+};
+
+#endif // __CMDTXFREQUENCY_H__
diff --git a/CommandTerminal/CmdWriteProtectedConfig.cpp b/CommandTerminal/CmdWriteProtectedConfig.cpp
index 6c2d6ce..db22562 100644
--- a/CommandTerminal/CmdWriteProtectedConfig.cpp
+++ b/CommandTerminal/CmdWriteProtectedConfig.cpp
@@ -24,6 +24,10 @@ CmdWriteProtectedConfig::CmdWriteProtectedConfig(mDot* dot) :
_help = std::string(text()) + ": " + std::string(desc());
}
+CmdWriteProtectedConfig::~CmdWriteProtectedConfig() {
+
+}
+
uint32_t CmdWriteProtectedConfig::action(std::vector<std::string> args)
{
if (!_dot->saveProtectedConfig()) {
diff --git a/CommandTerminal/CmdWriteProtectedConfig.h b/CommandTerminal/CmdWriteProtectedConfig.h
index e5ad3c7..51315fe 100644
--- a/CommandTerminal/CmdWriteProtectedConfig.h
+++ b/CommandTerminal/CmdWriteProtectedConfig.h
@@ -27,6 +27,7 @@ class CmdWriteProtectedConfig : public Command {
public:
CmdWriteProtectedConfig(mDot* dot);
+ virtual ~CmdWriteProtectedConfig();
virtual uint32_t action(std::vector<std::string> args);
private:
diff --git a/CommandTerminal/Commands.h b/CommandTerminal/Commands.h
index 9a06835..b041b19 100644
--- a/CommandTerminal/Commands.h
+++ b/CommandTerminal/Commands.h
@@ -49,4 +49,6 @@
#ifdef MTS_RADIO_DEBUG_COMMANDS
#include "CmdWriteProtectedConfig.h"
+#include "CmdSendContinuous.h"
+#include "CmdTxFrequency.h"
#endif
diff --git a/Mode/ModeConfig.cpp b/Mode/ModeConfig.cpp
index 56ba1a0..bd1967d 100644
--- a/Mode/ModeConfig.cpp
+++ b/Mode/ModeConfig.cpp
@@ -75,6 +75,8 @@ ModeConfig::ModeConfig(DOGS102* lcd, ButtonHandler* buttons, mDot* dot, LoRaHand
#if MTS_RADIO_DEBUG_COMMANDS
addCommand(new CmdWriteProtectedConfig(_dot));
+ addCommand(new CmdSendContinuous(_dot));
+ addCommand(new CmdTxFrequency(_dot));
#endif
}