Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos VodafoneUSBModem mbed
Console.h@0:6c831cc49d22, 2012-08-14 (annotated)
- Committer:
- ashleymills
- Date:
- Tue Aug 14 16:03:35 2012 +0000
- Revision:
- 0:6c831cc49d22
- Child:
- 1:719c0f047c34
A console for interacting with Vodafone dongles.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ashleymills | 0:6c831cc49d22 | 1 | #pragma once |
| ashleymills | 0:6c831cc49d22 | 2 | #include "mbed.h" |
| ashleymills | 0:6c831cc49d22 | 3 | |
| ashleymills | 0:6c831cc49d22 | 4 | #define BUFFER_WAIT_TIMEOUT 1000000 |
| ashleymills | 0:6c831cc49d22 | 5 | |
| ashleymills | 0:6c831cc49d22 | 6 | class Console { |
| ashleymills | 0:6c831cc49d22 | 7 | private: |
| ashleymills | 0:6c831cc49d22 | 8 | int _currentLine; |
| ashleymills | 0:6c831cc49d22 | 9 | int _usedLines; |
| ashleymills | 0:6c831cc49d22 | 10 | |
| ashleymills | 0:6c831cc49d22 | 11 | int _bufferWaitTimeout; |
| ashleymills | 0:6c831cc49d22 | 12 | char **_lines; |
| ashleymills | 0:6c831cc49d22 | 13 | |
| ashleymills | 0:6c831cc49d22 | 14 | int _linePos; |
| ashleymills | 0:6c831cc49d22 | 15 | int _prevLinePos; |
| ashleymills | 0:6c831cc49d22 | 16 | |
| ashleymills | 0:6c831cc49d22 | 17 | Serial *_terminal; |
| ashleymills | 0:6c831cc49d22 | 18 | |
| ashleymills | 0:6c831cc49d22 | 19 | bool waitForInput(); |
| ashleymills | 0:6c831cc49d22 | 20 | void loadPreviousBuffer(); |
| ashleymills | 0:6c831cc49d22 | 21 | void loadNextBuffer(); |
| ashleymills | 0:6c831cc49d22 | 22 | void virtual processCommand(); |
| ashleymills | 0:6c831cc49d22 | 23 | void printLineBuffer(); |
| ashleymills | 0:6c831cc49d22 | 24 | void printHistory(); |
| ashleymills | 0:6c831cc49d22 | 25 | void printBuffer(int index); |
| ashleymills | 0:6c831cc49d22 | 26 | void reprintBuffer(); |
| ashleymills | 0:6c831cc49d22 | 27 | void storeBuffer(); |
| ashleymills | 0:6c831cc49d22 | 28 | void clearBuffer(); |
| ashleymills | 0:6c831cc49d22 | 29 | |
| ashleymills | 0:6c831cc49d22 | 30 | protected: |
| ashleymills | 0:6c831cc49d22 | 31 | char *_lineBuffer; |
| ashleymills | 0:6c831cc49d22 | 32 | int _lineLength; |
| ashleymills | 0:6c831cc49d22 | 33 | int _numLines; |
| ashleymills | 0:6c831cc49d22 | 34 | |
| ashleymills | 0:6c831cc49d22 | 35 | public: |
| ashleymills | 0:6c831cc49d22 | 36 | Console(Serial *terminal, int lineLength, int numLines); |
| ashleymills | 0:6c831cc49d22 | 37 | ~Console(); |
| ashleymills | 0:6c831cc49d22 | 38 | void virtual update(); |
| ashleymills | 0:6c831cc49d22 | 39 | |
| ashleymills | 0:6c831cc49d22 | 40 | }; |

