41 # include <sys/select.h>
42 # include <sys/ioctl.h>
85 line[len++] = ungetch;
86 ungetch_valid =
false;
92 timeout_us = (long) (timeout*1000000.0);
98 n = Read( line + len, 1, timeout_us, return_on_less_data );
107 if (strchr( eol, c ) !=
NULL)
116 throw new cSerialBaseException(
cMsg(
"Timeout while reading line from device (timeout_us=%ld line=\"%s\")", timeout_us, line ) );
129 static char return_msg[512];
133 FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER |
134 FORMAT_MESSAGE_FROM_SYSTEM |
135 FORMAT_MESSAGE_IGNORE_INSERTS,
138 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
143 StringCchPrintfA( return_msg,
145 "error 0x%x = %d = \"%s\"",
149 snprintf( return_msg, 511,
"error 0x%x = %d = \"%s\"", dw, dw, strerror( dw ) );