An arduino library to communicate using the Dallas one-wire protocol, where the Arduino takes the role of a slave.
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.
|
|
|
#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);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void handleConnection();
|
|
|
|
void writeShort(short num);
|
|
|
|
void writeULong(unsigned long num);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|