Board index » kylix » RTS and ioctl()

RTS and ioctl()


2005-02-25 10:26:31 AM
kylix1
... open /dev/ttyS0 // in Kylix 3.0 for C++
I want to Control Serial RTS,But failure.
Someone can teach me.
thanks a lot.
ioctl (fd, TIOCMGET, &line);
line &= ~TIOCM_RTS;
ioctl (fd, TIOCMSET, &line);
printf("RTS to LOW\n");
ioctl (fd, TIOCMGET, &line);
line |= TIOCM_RTS;
ioctl (fd, TIOCMSET, &line);
printf("RTS set to HIGH\n");
 
 

Re:RTS and ioctl()

sigmaccc wrote:
Quote
... open /dev/ttyS0 // in Kylix 3.0 for C++

I want to Control Serial RTS,But failure.
Someone can teach me.
thanks a lot.

ioctl (fd, TIOCMGET, &line);
line &= ~TIOCM_RTS;
ioctl (fd, TIOCMSET, &line);
printf("RTS to LOW\n");


ioctl (fd, TIOCMGET, &line);
line |= TIOCM_RTS;
ioctl (fd, TIOCMSET, &line);
printf("RTS set to HIGH\n");


Try using TIOCMBIC (bit clear) and TIOCMBIS (bit set), it worked for me.
Do you happen to use a pl2303HX chip (usb-serial) from Prolific? If so
just mail me, I got a solution.
Good luck,
Florian