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
- Committer:
- ashleymills
- Date:
- 2012-08-24
- Revision:
- 2:8cc63f7a24cf
- Parent:
- 1:719c0f047c34
- Child:
- 4:6971bded3ebd
File content as of revision 2:8cc63f7a24cf:
#pragma once
#include "mbed.h"
#define BUFFER_WAIT_TIMEOUT 1000000
class Console {
private:
int _currentLine;
int _usedLines;
int _bufferWaitTimeout;
char **_lines;
int _linePos;
int _prevLinePos;
bool waitForInput();
void loadPreviousBuffer();
void loadNextBuffer();
virtual void processCommand();
void printLineBuffer();
void printHistory();
void printBuffer(int index);
void reprintBuffer();
void storeBuffer();
protected:
char *_lineBuffer;
int _lineLength;
int _numLines;
Serial *_terminal;
void clearBuffer();
public:
Console(Serial *terminal, int lineLength, int numLines);
~Console();
virtual void update();
};

