Eduard Heimann wrote:
> Hi all,
> 
> is there some way to do a call similar to
>     fd = open("COM1:", O_RDONLY);
> to access the serial communications port driver? Setting baud rate?
> 
> Maybe this is a newbie's question... however, i didn't find any hint till 
> now. I remember 
> from my good old CPM-days one had to fiddle a bit inside libc.
> 
> Any help is highly appreciated. Thank you.
> 

Goggle for CreateFile/ReadFile/WriteFile/SetCommState.

mingw32ce supports open/read/write as simple wrappers around
CreateFile/ReadFile/WriteFile.  You just have to realize that open returns
an int, which is really a HANDLE casted to int.  In practice this means that
this is correct:

int fd;
if ((fd = open(...) == -1)

And this is wrong:
if ((fd = open(...) < 0)

Cheers,
Pedro Alves


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to