Hello,
I am trying to read the status of the RTS pin on the serial port. I am using the following code snippet:
main() {
int fd, sercmd, serstat;
sercmd = TIOCM_RTS;
fd = open("/dev/ttyPSC0", O_RDONLY); // Open the serial port.
// Read the RTS pin status.
ioctl(fd, TIOCMGET, &serstat);
if (serstat & TIOCM_RTS)
printf("RTS pin is set.\n");
else
printf("RTS pin is reset.\n");
Using a similar code that sets the RTS signal, I can correctly read if the pin is set or not. On the code it works nicely. But using a voltmeter between pins 5 (neg) and 7 (RTS) I cannot measure any voltage, regardless of the pin status (set or reset). What am I missing?
Thanks
Cesar
|