From owner-freebsd-hackers Thu Dec 5 21:03:37 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id VAA28153 for hackers-outgoing; Thu, 5 Dec 1996 21:03:37 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id VAA28139 for ; Thu, 5 Dec 1996 21:03:23 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id PAA10852; Fri, 6 Dec 1996 15:59:18 +1100 Date: Fri, 6 Dec 1996 15:59:18 +1100 From: Bruce Evans Message-Id: <199612060459.PAA10852@godzilla.zeta.org.au> To: brandon@glacier.cold.org, mtaylor@cybernet.com Subject: RE: Help! Turning off DTR on a serial device Cc: hackers@freebsd.org Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >There is an IOCTL for it. >Look in /usr/include/sys/ttycom.h for TIOCSDTR (set DTR) and TIOCCDTR (clear DTR). There's also TIOCMSET, etc. which can be used to change the other modem control bits. None of these work right for DTR, because: >The only problem youu will find with it is that the DTR is set when you change your >baud rate. There is an 'if' statement in the baud changing code in the kernel's sio >driver which checks if the baud is non-zero, then the DTR will be set. > >So, you can set your baud rate, turn off your DTR, but don't chang your baud rate >again! It will turn ON the DTR (if the new baud rate is not zero). This is why DTR should be controlled using tcsettattr() instead of the old ioctls. Set the output speed to B0 to turn DTR off. Keep it as B0 to keep DTR off. Set it back to the actual speed to turn DTR on. Bruce