48 ComSpeed19200 = B19200,
49 ComSpeed38400 = B38400,
50 ComSpeed57600 = B57600,
51 ComSpeed115200 = B115200,
52 ComSpeed230400 = B230400,
53 ComSpeed460800 = B460800,
54 ComSpeed500000 = B500000,
55 ComSpeed576000 = B576000,
56 ComSpeed921600 = B921600,
57 ComSpeed1000000 = B1000000,
58 ComSpeed1152000 = B1152000,
59 ComSpeed1500000 = B1500000,
60 ComSpeed2000000 = B2000000,
61 ComSpeed2500000 = B2500000,
62 ComSpeed3000000 = B3000000,
63 ComSpeed3500000 = B3500000,
64 ComSpeed4000000 = B4000000
88 ComPort(
const std::string& comDevice,
bool nocreate =
false );
91 inline std::string getDevice()
96 void setSpeed( Speed s );
97 void setSpeed(
const std::string& speed );
98 Speed getSpeed()
const;
100 static Speed getSpeed(
const std::string& s );
101 static std::string getSpeed( Speed s );
102 static Parity getParity(
const std::string& s );
103 static CharacterSize getCharacterSize(
const std::string& s );
105 void setParity(Parity);
106 void setParity(
const std::string& s);
109 void setCharacterSize(CharacterSize);
110 CharacterSize getCharacterSize();
112 void setStopBits(StopBits sBit);
113 StopBits getStopBits();
115 virtual void setTimeout( timeout_t msec );
116 timeout_t getTimeout()
const;
118 void setWaiting(
bool waiting);
120 virtual unsigned char receiveByte();
121 virtual void sendByte(
unsigned char x);
123 virtual size_t receiveBlock(
unsigned char* msg,
size_t len );
124 virtual ssize_t sendBlock(
unsigned char* msg,
size_t len );
126 void setBlocking(
bool blocking);
128 virtual void cleanupChannel();
129 virtual void reopen();
134 static const size_t BufSize = 8192;
135 unsigned char buf[BufSize];
136 ssize_t curSym = { 0 };
137 ssize_t bufLength = { 0 };
139 timeout_t uTimeout = { 0 };
140 bool waiting = {
false };
141 Speed speed = ComSpeed38400;
142 std::string dev = {
"" };
143 Parity parity = NoParity;
144 CharacterSize charSize = CSize8;
145 StopBits stopBits = OneBit;
147 virtual unsigned char m_receiveByte(
bool wait );
150 struct termios oldTermios;