Re: serial ports



Pavel A. da Mek wrote:
When I want to use serial ports, shall I write separate code for Windows and for Linux, or is there some library function which would allow to do it in the platform independent way?

I have written portable code for this with timeouts for read and write operations.
Because Windows don't know a generic select() like call but use special
SetCommTimeouts() call I don't know if the g_io_* calls works for Serial port
handles.

I recommend the following literature to start with this task.

POSIX
- "Serial Programming Guide for POSIX Operating Systems" 5th Edition by Michael R. Sweet
  http://www.easysw.com/~mike/serial/

Windows
- "Windows Serial Port Programming" by Robertson Bayer
  http://www.robbayer.com/files//serial-win.pdf
- "Serial Communication in Win32" by Allen Denver
  http://msdn2.microsoft.com/en-us/library/ms810467.aspx


Cheers, Andy




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]