summaryrefslogtreecommitdiff
path: root/Mode
diff options
context:
space:
mode:
authorMike Fiore <mfiore@multitech.com>2015-11-23 13:42:33 -0600
committerMike Fiore <mfiore@multitech.com>2015-11-23 13:42:33 -0600
commite1736be283e3da3df63e9d29c9382c076e59f80e (patch)
tree858e20d587cfd41925500e99660b3f321881ee43 /Mode
parenta3494764b5837a15695445652b01310eeebd6449 (diff)
downloadmtdot-box-evb-factory-firmware-e1736be283e3da3df63e9d29c9382c076e59f80e.tar.gz
mtdot-box-evb-factory-firmware-e1736be283e3da3df63e9d29c9382c076e59f80e.tar.bz2
mtdot-box-evb-factory-firmware-e1736be283e3da3df63e9d29c9382c076e59f80e.zip
clean up after config, get things building again, update default configuration to match spec
Diffstat (limited to 'Mode')
-rw-r--r--Mode/ModeConfig.cpp67
-rw-r--r--Mode/ModeConfig.h19
2 files changed, 32 insertions, 54 deletions
diff --git a/Mode/ModeConfig.cpp b/Mode/ModeConfig.cpp
index 2d24716..6075897 100644
--- a/Mode/ModeConfig.cpp
+++ b/Mode/ModeConfig.cpp
@@ -15,53 +15,44 @@ const char ModeConfig::command_error[] = "Command not found!\r\n";
const char ModeConfig::done[] = "\r\nOK\r\n";
const char ModeConfig::error[] = "\r\nERROR\r\n";
-mts::MTSSerial* ModeConfig::_serialp = NULL;
-
void ModeConfig::addCommand(Command* cmd) {
_commands.push_back(cmd);
}
-ModeConfig::ModeConfig(DOGS102* lcd, mts::MTSSerial& serial, mDot* dot, ButtonHandler* buttons)
-: Mode(lcd, buttons),
+ModeConfig::ModeConfig(DOGS102* lcd, ButtonHandler* buttons, mDot* dot, LoRaHandler* lora)
+: Mode(lcd, buttons, dot, lora),
_lc(lcd),
- _serial(serial),
- _dot(dot),
- _mode(mDot::COMMAND_MODE),
- _idle_thread(idle, NULL, osPriorityLow),
- _serial_up(false),
- _buttons(buttons) {
-
- _serialp = &serial;
+ _serial(USBTX, USBRX, 512, 512)
+{
addCommand(new CmdAttention(_dot));
- addCommand(new CmdIdentification(_dot, serial));
+ addCommand(new CmdIdentification(_dot, _serial));
addCommand(new CmdFactoryDefault(_dot));
addCommand(new CmdSaveConfig(_dot));
- addCommand(new CmdDisplayConfig(_dot, serial));
-
- addCommand(new CmdFrequencyBand(_dot, serial));
- addCommand(new CmdFrequencySubBand(_dot, serial));
- addCommand(new CmdPublicNetwork(_dot, serial));
- addCommand(new CmdDeviceId(_dot, serial));
-
- addCommand(new CmdNetworkAddress(_dot, serial));
- addCommand(new CmdNetworkSessionKey(_dot, serial));
- addCommand(new CmdDataSessionKey(_dot, serial));
- addCommand(new CmdNetworkKey(_dot, serial));
- addCommand(new CmdNetworkId(_dot, serial));
-
- addCommand(new CmdNetworkJoinMode(_dot, serial));
- addCommand(new CmdTxDataRate(_dot, serial));
- addCommand(new CmdTxPower(_dot, serial));
-
- addCommand(new CmdMinimumSize(_dot, serial));
- addCommand(new CmdMaximumSize(_dot, serial));
- addCommand(new CmdMinimumPower(_dot, serial));
- addCommand(new CmdMaximumPower(_dot, serial));
- addCommand(new CmdData(_dot, serial));
- addCommand(new CmdGetSurveyDataFile(_dot, serial));
- addCommand(new CmdDeleteSurveyDataFile(_dot, serial));
-
+ addCommand(new CmdDisplayConfig(_dot, _serial));
+
+ addCommand(new CmdFrequencyBand(_dot, _serial));
+ addCommand(new CmdFrequencySubBand(_dot, _serial));
+ addCommand(new CmdPublicNetwork(_dot, _serial));
+ addCommand(new CmdDeviceId(_dot, _serial));
+
+ addCommand(new CmdNetworkAddress(_dot, _serial));
+ addCommand(new CmdNetworkSessionKey(_dot, _serial));
+ addCommand(new CmdDataSessionKey(_dot, _serial));
+ addCommand(new CmdNetworkKey(_dot, _serial));
+ addCommand(new CmdNetworkId(_dot, _serial));
+
+ addCommand(new CmdNetworkJoinMode(_dot, _serial));
+ addCommand(new CmdTxDataRate(_dot, _serial));
+ addCommand(new CmdTxPower(_dot, _serial));
+
+ addCommand(new CmdMinimumSize(_dot, _serial));
+ addCommand(new CmdMaximumSize(_dot, _serial));
+ addCommand(new CmdMinimumPower(_dot, _serial));
+ addCommand(new CmdMaximumPower(_dot, _serial));
+ addCommand(new CmdData(_dot, _serial));
+ addCommand(new CmdGetSurveyDataFile(_dot, _serial));
+ addCommand(new CmdDeleteSurveyDataFile(_dot, _serial));
}
void ModeConfig::printHelp() {
diff --git a/Mode/ModeConfig.h b/Mode/ModeConfig.h
index ade3093..1192a8c 100644
--- a/Mode/ModeConfig.h
+++ b/Mode/ModeConfig.h
@@ -13,7 +13,7 @@ class ModeConfig : public Mode {
public:
- ModeConfig(DOGS102* lcd, mts::MTSSerial& serial, mDot* dot, ButtonHandler* buttons);
+ ModeConfig(DOGS102* lcd, ButtonHandler* buttons, mDot* dot, LoRaHandler* lora);
// Command error text...
static const char command_error[];
@@ -27,22 +27,9 @@ public:
private:
- static void idle(void const* args) {
- while (1)
- __WFI();
- }
-
- mts::MTSSerial& _serial;
- static mts::MTSSerial* _serialp;
-
- LayoutConfig _lc;
- ButtonHandler::ButtonEvent _be;
- ButtonHandler* _buttons;
- mDot* _dot;
- mDot::Mode _mode;
+ mts::MTSSerial _serial;
+ LayoutConfig _lc;
std::vector<Command*> _commands;
- Thread _idle_thread;
- bool _serial_up;
void addCommand(Command* cmd);