2018-04-22 23:11:56 +00:00
|
|
|
#ifndef MACSERIALSTREAM_H_
|
|
|
|
#define MACSERIALSTREAM_H_
|
|
|
|
|
|
|
|
#include <Stream.h>
|
|
|
|
|
|
|
|
class MacSerialStream : public Stream
|
|
|
|
{
|
|
|
|
static const long kInputBufferSize = 4096;
|
|
|
|
static const long kReadBufferSize = 4096;
|
|
|
|
char inputBuffer[kInputBufferSize];
|
|
|
|
char readBuffer[kReadBufferSize];
|
|
|
|
|
|
|
|
short outRefNum, inRefNum;
|
2018-04-27 00:06:54 +00:00
|
|
|
int curBaud;
|
2018-04-22 23:11:56 +00:00
|
|
|
public:
|
|
|
|
virtual void write(const void* p, size_t n) override;
|
|
|
|
|
|
|
|
void idle();
|
|
|
|
|
2018-04-27 07:00:33 +00:00
|
|
|
MacSerialStream(int baud = 19200);
|
2018-04-22 23:11:56 +00:00
|
|
|
~MacSerialStream();
|
|
|
|
|
|
|
|
void close();
|
2018-04-27 00:06:54 +00:00
|
|
|
void open();
|
2018-04-24 20:06:32 +00:00
|
|
|
|
|
|
|
void setBaud(int baud);
|
2018-05-06 10:40:26 +00:00
|
|
|
|
|
|
|
static void unloadSegDummy();
|
2018-04-22 23:11:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|