summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2016-01-08 09:27:22 -0600
committerMike Fiore <mfiore@multitech.com>2016-01-08 09:27:22 -0600
commitadc3d703dd1945b2b06c80dd7252cb4e9cc4f485 (patch)
tree88f5d84f6a28ef32f3fee978f67510b1161d10c4
parent746bf896ba44a97c904ed9d9f450a54898705e78 (diff)
downloadmtdot-box-evb-factory-firmware-adc3d703dd1945b2b06c80dd7252cb4e9cc4f485.tar.gz
mtdot-box-evb-factory-firmware-adc3d703dd1945b2b06c80dd7252cb4e9cc4f485.tar.bz2
mtdot-box-evb-factory-firmware-adc3d703dd1945b2b06c80dd7252cb4e9cc4f485.zip
allow changes to protected config if built with debug macros MTS_RADIO_DEBUG_COMMANDS and DEBUG_MAC
-rw-r--r--CommandTerminal/CmdDeviceId.cpp6
-rw-r--r--CommandTerminal/Commands.h4
-rw-r--r--Mode/ModeConfig.cpp4
3 files changed, 11 insertions, 3 deletions
diff --git a/CommandTerminal/CmdDeviceId.cpp b/CommandTerminal/CmdDeviceId.cpp
index 05d2301..10dc9e8 100644
--- a/CommandTerminal/CmdDeviceId.cpp
+++ b/CommandTerminal/CmdDeviceId.cpp
@@ -2,7 +2,7 @@
#include <algorithm>
CmdDeviceId::CmdDeviceId(mDot* dot, mts::MTSSerial& serial) :
- Command(dot, "Device ID", "AT+DI", "Device EUI (unique, set at factory) (8 bytes)"), _serial(serial)
+ Command(dot, "Device ID", "AT+DI", "Device EUI-64 (MSB) (unique, set at factory) (8 bytes)"), _serial(serial)
{
_help = std::string(text()) + ": " + std::string(desc());
_usage = "(hex:8)";
@@ -15,7 +15,7 @@ uint32_t CmdDeviceId::action(std::vector<std::string> args)
{
if (_dot->getVerbose())
_serial.writef("%s: ", name());
- _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getDeviceId(), ":").c_str());
+ _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getDeviceId(), "-").c_str());
}
#ifdef DEBUG_MAC
else if (args.size() == 2)
@@ -28,7 +28,7 @@ uint32_t CmdDeviceId::action(std::vector<std::string> args)
if ((code = _dot->setDeviceId(NewEUI)) == mDot::MDOT_OK) {
_serial.writef("Set %s: ", name());
- _serial.writef("%s\r\n", mts::Text::bin2hexString(NewEUI, ":").c_str());
+ _serial.writef("%s\r\n", mts::Text::bin2hexString(NewEUI, "-").c_str());
} else {
std::string error = mDot::getReturnCodeString(code) + " - " + _dot->getLastError();
setErrorMessage(error);
diff --git a/CommandTerminal/Commands.h b/CommandTerminal/Commands.h
index 22beb41..da1f8bd 100644
--- a/CommandTerminal/Commands.h
+++ b/CommandTerminal/Commands.h
@@ -28,3 +28,7 @@
#include "CmdDeleteSurveyDataFile.h"
#include "CmdDummy.h"
+
+#ifdef MTS_RADIO_DEBUG_COMMANDS
+#include "CmdWriteProtectedConfig.h"
+#endif
diff --git a/Mode/ModeConfig.cpp b/Mode/ModeConfig.cpp
index 6fbeae0..8f869bf 100644
--- a/Mode/ModeConfig.cpp
+++ b/Mode/ModeConfig.cpp
@@ -54,6 +54,10 @@ ModeConfig::ModeConfig(DOGS102* lcd, ButtonHandler* buttons, mDot* dot, LoRaHand
addCommand(new CmdGetSurveyDataFile(_dot, _serial));
addCommand(new CmdDeleteSurveyDataFile(_dot, _serial));
addCommand(new CmdDummy(_dot, "Exit to main menu", "AT+EXIT", "Exit configuration and return to the main menu"));
+
+#if MTS_RADIO_DEBUG_COMMANDS
+ addCommand(new CmdWriteProtectedConfig(_dot));
+#endif
}
void ModeConfig::printHelp() {