On Sun, 9 Jan 2005 11:28, Brandon Fosdick wrote: > Daniel O'Connor wrote: > > Is it blocking waiting for carrier detect to come up? > > Try using the cuaNN device instead. > > The software in question worked fine using a cuaNN device until said > device died. > > Somebody else mentioned that I could set the device to ignore the > carrier detect signal. How do I do that? Is it a flag to tcsetattr() or > some kind of ioctl?
Something like this should work..
if ((sfd = open(portfname, O_RDWR | O_NONBLOCK)) == -1) {
fprintf(stderr, "Couldn't open serial port - %s\n", strerror(errno));
exit(1);
}
if (tcgetattr(sfd, &tp) == -1) {
fprintf(stderr, "Couldn't get attr - %s\n", strerror(errno));
exit(1);
}
tp.c_cflag = CLOCAL;
if (tcflush(sfd, TCIOFLUSH) == -1) {
fprintf(stderr, "Couldn't flush - %s\n", strerror(errno));
exit(1);
}
if (tcsetattr(sfd, TCSANOW, &tp) == -1) {
fprintf(stderr, "Couldn't set attrs - %s\n", strerror(errno));
exit(1);
}
ie setting CLOCAL.
--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
-- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
pgpvjGg4XUwjq.pgp
Description: PGP signature
