You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
675 B
31 lines
675 B
#ifndef _SerialChannel_h_ |
|
#define _SerialChannel_h_ |
|
|
|
class SerialChannel |
|
{ |
|
private: |
|
static SerialChannel* first; |
|
SerialChannel* next; |
|
|
|
static byte nextId; |
|
byte id; |
|
const char* name; |
|
|
|
public: |
|
SerialChannel(const char* name_); |
|
|
|
void write(byte* data, short byteCount, unsigned long time = (unsigned long)-1); |
|
|
|
void write(const char* text, unsigned long time = (unsigned long)-1); |
|
|
|
void beginWrite(short byteCount, unsigned long time = (unsigned long)-1); |
|
void continueWrite(byte* data, short byteCount); |
|
|
|
private: |
|
void handleConnection(); |
|
void writeShort(short num); |
|
void writeULong(unsigned long num); |
|
}; |
|
|
|
#endif |
|
|
|
|