Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jan 2005 11:41:40 +1030
From:      "Daniel O'Connor" <doconnor@gsoft.com.au>
To:        Brandon Fosdick <bfoz@bfoz.net>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: ucom and sio
Message-ID:  <200501091141.40752.doconnor@gsoft.com.au>
In-Reply-To: <41E08199.3000405@bfoz.net>
References:  <40170.4.248.235.201.1104333403.squirrel@4.248.235.201> <200501091115.00779.doconnor@gsoft.com.au> <41E08199.3000405@bfoz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart3310152.LOodFagmlB
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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 =3D open(portfname, O_RDWR | O_NONBLOCK)) =3D=3D -1) {
        fprintf(stderr, "Couldn't open serial port - %s\n", strerror(errno)=
);
        exit(1);
    }

    if (tcgetattr(sfd, &tp) =3D=3D -1) {
        fprintf(stderr, "Couldn't get attr - %s\n", strerror(errno));
        exit(1);
    }

    tp.c_cflag =3D CLOCAL;

    if (tcflush(sfd, TCIOFLUSH) =3D=3D -1) {
        fprintf(stderr, "Couldn't flush - %s\n", strerror(errno));
        exit(1);
    }

    if (tcsetattr(sfd, TCSANOW, &tp) =3D=3D -1) {
        fprintf(stderr, "Couldn't set attrs - %s\n", strerror(errno));
	exit(1);
    }

ie setting CLOCAL.

=2D-=20
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

--nextPart3310152.LOodFagmlB
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (FreeBSD)

iD8DBQBB4ITM5ZPcIHs/zowRAjw1AKCdEuVG/ikYosGegmz1a7OLOiTemQCfTwTL
ROIj/cROVNKQ8/PuGm/Ngs8=
=G+T2
-----END PGP SIGNATURE-----

--nextPart3310152.LOodFagmlB--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501091141.40752.doconnor>