Simple embedded shell with runtime pluggable commands.
Implements a simple unix-like shell for embedded systems with a pluggable command architecture.
SimpleShell.h@1:998a7ed04f10, 2018-12-02 (annotated)
- Committer:
- shimniok
- Date:
- Sun Dec 02 16:50:40 2018 +0000
- Revision:
- 1:998a7ed04f10
- Parent:
- 0:49820d5a38c9
- Child:
- 2:4f0affdb7db9
Stubbed out command attach
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 | 1:998a7ed04f10 | 7 | void attach(Callback<void()> cb, char *command); |
shimniok | 0:49820d5a38c9 | 8 | |
shimniok | 0:49820d5a38c9 | 9 | // void registerCommand(char *commandString, char *helpText, Callback<void(float)> cb); |
shimniok | 0:49820d5a38c9 | 10 | void run(); |
shimniok | 0:49820d5a38c9 | 11 | |
shimniok | 0:49820d5a38c9 | 12 | private: |
shimniok | 0:49820d5a38c9 | 13 | static const int MAXBUF=128; |
shimniok | 0:49820d5a38c9 | 14 | void printPrompt(void); |
shimniok | 0:49820d5a38c9 | 15 | void readCommand(); |
shimniok | 0:49820d5a38c9 | 16 | char cmd[MAXBUF]; |
shimniok | 0:49820d5a38c9 | 17 | char _cwd[MAXBUF]; |
shimniok | 0:49820d5a38c9 | 18 | }; // class |