#33 termio.h support or equivalent

closed
nobody
None
5
2003-07-03
2003-07-03
Terrence Dabbs
No

I need to do serial IO on NT and Windows98. Using
Cygwin and gcc -mno-cygwin option, it appears that
mingw does not have the termio.h header files. What
(easy) method will accomplish this? Is there some
sample code to illustrate how it is done? Thanks.

Discussion

  • Luke Dunstan
    Luke Dunstan
    2003-07-03

    Logged In: YES
    user_id=30442

    termio.h and similar functions are not supported on Windows,
    so either you will need to use a portable third party library (or
    Cygwin), or you'll need to change your code to use Windows-
    specific API functions. The most basic serial IO should be
    possible by doing fopen("COM1"...), but for anything specific
    like setting the baud rate you will need to open the device
    using CreateFile() and call functions such as SetCommState()
    on the resulting handle. I don't have any sample code handy
    but any examples designed for MSVC should work.

     
  • Luke Dunstan
    Luke Dunstan
    2003-07-03

    • status: open --> closed