From owner-freebsd-hackers Thu Dec 5 14:25:26 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id OAA09707 for hackers-outgoing; Thu, 5 Dec 1996 14:25:26 -0800 (PST) Received: from gateway.cybernet.com (gateway.cybernet.com [192.245.33.1]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id OAA09702 for ; Thu, 5 Dec 1996 14:25:24 -0800 (PST) Received: from spiffy.cybernet.com (spiffy.cybernet.com [192.245.33.55]) by gateway.cybernet.com (8.7.6/8.7.3) with SMTP id RAA14851; Thu, 5 Dec 1996 17:31:33 -0500 (EST) Message-ID: X-Mailer: XFMail 0.5-beta [p0] on FreeBSD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Thu, 05 Dec 1996 17:18:58 -0500 (EST) Organization: Cybernet Systems Corporation From: Mark Taylor To: Brandon Gillespie 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 On 18:25:06 Brandon Gillespie wrote: >I'm writing some software to use the serial device in FreeBSD (and >Unixware in the long run). I need to know if I can turn off DTR. The >supplied software with this program is for DOS, and manages to turn off >DTR from the software end--but I have never been able to figure out if I >can do this from a unix perspective? Can I? help? > >-Brandon Gillespie There is an IOCTL for it. Look in /usr/include/sys/ttycom.h for TIOCSDTR (set DTR) and TIOCCDTR (clear DTR). 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). -------------------------------------------------------------------- Mark J. Taylor Network R&D Engineer Cybernet Systems mtaylor@cybernet.com 727 Airport Blvd. PHONE (313) 668-2567 Ann Arbor, MI 48108 FAX (313) 668-8780 --------------------------------------------------------------------