Hi. I am currently porting an application which interfaces with a serial port from Windows to Linux. The two main things done are the setting of DTR and the reading of DSR. I am having a problem, however, reading off the value of DSR from the serial port.
My current code does it like so:
Code:
bool getDSR (void)
{
int controlBits;
ioctl(serialFD, TIOCMGET, &controlBits);
return controlBits & TIOCM_DSR;
}
Problem is that ioctl keeps returning "Bad address" as the error. Does anyone have any idea why this is? Setting the value of DTR works perfectly. I have tried it under two systems, a PIII-era Debian system (2.6.15) and a 2.6.23 Gentoo system.
Regards, Freddie.