Mail Archives: djgpp/2002/10/16/21:45:09
Thanks,
In Linux, I used C-functions like
open(), tcsetattr(), and read()
for opening, setting parameter, and reading data from
serial port.
I am trying to use the same C-code in Win2000.
Here is the suumary of run result in Win2000:
1) open COM1 - looks OK.
2) tcsetattr - looks it works.
3) read() - This doesn't work like Linux.
In Linux,
n=read(fd, buf, RL) waits some bytes to read, and
return the bytes actually read.
In Win2000 command promt using DJGPP,
n=read(fd, buf, RL) immediately return RL
after reading RL byte data of almost null.
How can I read the actual bytes in serial port buffer ?
Is there any functions to check the bytes in buffer of serial port.
"ioctl(fd, FIONREAD, &nbyte)" doesn't work in DOS (Win2000).
jou
Eli Zaretskii wrote:
> On Wed, 16 Oct 2002, jou wrote:
>
>
>>I want to read data from serial port (RS232C).
>>Not possible to open /dev/ttyS0 in DOS.
>>
>
> Open /dev/aux or COM1 (or COM2, as the case might be) instead.
>
- Raw text -