12 #ifndef ECL_THREADS_SERIAL_W32_HPP_ 13 #define ECL_THREADS_SERIAL_W32_HPP_ 127 Serial() : is_open(false), is_run(false), file_descriptor(INVALID_HANDLE_VALUE), error_handler(
NoError) {};
189 bool open()
const {
return is_open; }
234 void block(
const long &timeout = 500) ecl_assert_throw_decl(StandardException);
264 long read(
char &c) ecl_assert_throw_decl(StandardException);
276 long read(
char *s, const
unsigned long &n) ecl_assert_throw_decl(StandardException);
289 PurgeComm( file_descriptor, PURGE_RXCLEAR );
290 PurgeComm( file_descriptor, PURGE_TXCLEAR );
297 void clearInputBuffer() { PurgeComm( file_descriptor, PURGE_RXCLEAR ); }
303 void clearOutputBuffer() { PurgeComm( file_descriptor, PURGE_TXCLEAR ); }
311 const Error& error()
const {
return error_handler; }
317 HANDLE file_descriptor;
318 OVERLAPPED m_osRead, m_osWrite;
322 Thread event_receiver;
331 friend void event_proc(
void* arg);
344 class is_sink<Serial> :
public True {};
352 class is_source<Serial> :
public True {};
360 class is_sourcesink<Serial> :
public True {};
StopBits
Stop bits used in a serial packet.
Embedded control libraries.
Cross-platform abstractions for the serial class.
Parity
Parity of the serial packet.
DataBits
Data bits used in a serial packet.
#define ecl_assert_throw_decl(exception)
#define ecl_devices_PUBLIC
BaudRate
Serial connection baud rate.