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.
LineSerial.h
- Committer:
- matsujirushi
- Date:
- 2014-10-13
- Revision:
- 0:d3ca6a57e60b
File content as of revision 0:d3ca6a57e60b:
#ifndef LINE_SERIAL_H
#define LINE_SERIAL_H
#include "mbed.h"
class LineSerial : public Serial
{
public:
LineSerial(PinName tx, PinName rx, const char *name = NULL);
virtual ~LineSerial();
void allocateReadBuffer(size_t size);
void attachReadLine(void (*func)(const char* str));
void task();
private:
char *readBuffer;
size_t readBufferSize;
size_t readBufferCount;
void (*readLineFunc)(const char* data);
bool appendReadBuffer(char data);
bool removeReadBuffer();
};
#endif