Simple embedded shell with runtime pluggable commands.
Implements a simple unix-like shell for embedded systems with a pluggable command architecture.
SimpleShell.h@0:49820d5a38c9, 2018-12-01 (annotated)
- Committer:
- shimniok
- Date:
- Sat Dec 01 23:18:03 2018 +0000
- Revision:
- 0:49820d5a38c9
- Child:
- 1:998a7ed04f10
Initial functionality working
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shimniok | 0:49820d5a38c9 | 1 | #include "mbed.h" |
shimniok | 0:49820d5a38c9 | 2 | |
shimniok | 0:49820d5a38c9 | 3 | class SimpleShell { |
shimniok | 0:49820d5a38c9 | 4 | public: |
shimniok | 0:49820d5a38c9 | 5 | SimpleShell(); |
shimniok | 0:49820d5a38c9 | 6 | |
shimniok | 0:49820d5a38c9 | 7 | void attach(Callback<void()> func, char *command) { |
shimniok | 0:49820d5a38c9 | 8 | } |
shimniok | 0:49820d5a38c9 | 9 | |
shimniok | 0:49820d5a38c9 | 10 | // void registerCommand(char *commandString, char *helpText, Callback<void(float)> cb); |
shimniok | 0:49820d5a38c9 | 11 | void run(); |
shimniok | 0:49820d5a38c9 | 12 | |
shimniok | 0:49820d5a38c9 | 13 | private: |
shimniok | 0:49820d5a38c9 | 14 | static const int MAXBUF=128; |
shimniok | 0:49820d5a38c9 | 15 | void printPrompt(void); |
shimniok | 0:49820d5a38c9 | 16 | void readCommand(); |
shimniok | 0:49820d5a38c9 | 17 | char cmd[MAXBUF]; |
shimniok | 0:49820d5a38c9 | 18 | char _cwd[MAXBUF]; |
shimniok | 0:49820d5a38c9 | 19 | }; // class |