summaryrefslogtreecommitdiff
path: root/Mode/ModeConfig.h
diff options
context:
space:
mode:
authorLeon Lindenfelser <llindenfelser@multitech.com>2015-11-20 16:21:44 -0600
committerLeon Lindenfelser <llindenfelser@multitech.com>2015-11-20 16:21:44 -0600
commit4ea46cbfee73c43579ea657cabc7f1fc7de97874 (patch)
tree96c7451f54600d847e7d0231090bb79d02f0ac50 /Mode/ModeConfig.h
parent393317f7d04753d6e9773393a96c311a88a27f7b (diff)
downloadmtdot-box-evb-factory-firmware-4ea46cbfee73c43579ea657cabc7f1fc7de97874.tar.gz
mtdot-box-evb-factory-firmware-4ea46cbfee73c43579ea657cabc7f1fc7de97874.tar.bz2
mtdot-box-evb-factory-firmware-4ea46cbfee73c43579ea657cabc7f1fc7de97874.zip
1. Merged CommandTerminal into ModeConfig and deleted CommandTerminal.
2. Fixed AT&V output. 3. Cleaned up some unused code. 4. Added +FREQ back in. 5. Removed CmdExit and put the +EXIT command right in the command parsing code.
Diffstat (limited to 'Mode/ModeConfig.h')
-rw-r--r--Mode/ModeConfig.h58
1 files changed, 48 insertions, 10 deletions
diff --git a/Mode/ModeConfig.h b/Mode/ModeConfig.h
index be478dd..ade3093 100644
--- a/Mode/ModeConfig.h
+++ b/Mode/ModeConfig.h
@@ -2,20 +2,58 @@
#define __MODECONFIG_H__
#include "Mode.h"
-#include "LayoutConfig.h"
+#include "LayoutConfig.h"
+#include "mbed.h"
+#include "MTSSerial.h"
+#include "Commands.h"
#include "mDot.h"
+#include "ButtonHandler.h"
class ModeConfig : public Mode {
- public:
- ModeConfig(DOGS102* lcd, ButtonHandler* buttons, mDot* dot);
- ~ModeConfig();
- bool start();
+public:
- private:
- LayoutConfig _lc;
- mDot* _dot;
- ButtonHandler::ButtonEvent _be;
+ ModeConfig(DOGS102* lcd, mts::MTSSerial& serial, mDot* dot, ButtonHandler* buttons);
+
+ // Command error text...
+ static const char command_error[];
+
+ // Response texts...
+ static const char newline[];
+ static const char done[];
+ static const char error[];
+
+ bool start();
+
+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;
+ std::vector<Command*> _commands;
+ Thread _idle_thread;
+ bool _serial_up;
+
+ void addCommand(Command* cmd);
+
+ void printHelp();
+
+ bool readable();
+ bool writeable();
+ char read();
+ void write(const char* message);
+ void writef(const char* format, ... );
+
};
-#endif
+#endif // __MODECONFIG_H__