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-14
- Revision:
- 0:6c831cc49d22
- Child:
- 1:719c0f047c34
File content as of revision 0:6c831cc49d22:
#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;
        
        Serial *_terminal;
        
        bool waitForInput();
        void loadPreviousBuffer();
        void loadNextBuffer();
        void virtual processCommand();
        void printLineBuffer();
        void printHistory();
        void printBuffer(int index);
        void reprintBuffer();
        void storeBuffer();
        void clearBuffer();
        
    protected:
        char *_lineBuffer;
        int _lineLength;
        int _numLines;
           
    public:
        Console(Serial *terminal, int lineLength, int numLines);
        ~Console();
        void virtual update();
};
            
    
