From owner-freebsd-hackers Fri Jun 29 6:15:27 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtpproxy2.mitre.org (smtpproxy2.mitre.org [128.29.154.90]) by hub.freebsd.org (Postfix) with ESMTP id 9B4A537B409 for ; Fri, 29 Jun 2001 06:15:18 -0700 (PDT) (envelope-from jandrese@mitre.org) Received: from avsrv2.mitre.org (avsrv2.mitre.org [128.29.154.4]) by smtpproxy2.mitre.org (8.11.3/8.11.3) with ESMTP id f5TDFE115672; Fri, 29 Jun 2001 09:15:14 -0400 (EDT) Received: from MAILHUB2 (mailhub2.mitre.org [129.83.221.18]) by smtpsrv2.mitre.org (8.11.3/8.11.3) with ESMTP id f5TDFDa17409; Fri, 29 Jun 2001 09:15:13 -0400 (EDT) Received: from dhcp-105-164.mitre.org (128.29.105.164) by mailhub2.mitre.org with SMTP id 7050686; Fri, 29 Jun 2001 09:15:11 -0400 Message-ID: <3B3C7F64.A4C5D7F0@mitre.org> Date: Fri, 29 Jun 2001 09:15:16 -0400 From: Jason Andresen Organization: The MITRE Corporation X-Mailer: Mozilla 4.75 [en]C-20000818M (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 To: Jason Borkowsky Cc: freebsd-hackers@freebsd.org Subject: Re: Serial port control References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Jason Borkowsky wrote: > > > > I am looking to find a simple way to control a serial port through BSD > > > (such as raising and lowering DTR for a specified duration). I thought I > > > had it using ioctl() and wrote a simple program to test it, but it seems I > > > don't have a full understanding of ioctl(). Does anyone know of any > > > pre-written utilities I can use? Or where to get some really detailed > > > information about ioctl()? Thanks! > > After several responses, I thought I had it. From a software point of > view, my program, included below, works fine. But from a hardware point of > view, the signals I am trying to lower, RTS and DTR, are staying > high. Can anyone try to compile the below program and do a serial port > test with an RS-232 tester and see if anyone actually sees RTS and DTR > going low? Sorry for bothering everyone with this again, but this is > driving me nuts and I can't figure out the problem now. Thanks! (77 ~): gcc -o serialioctl serialioctl.c (78 ~): sudo ./serialioctl Password: Current Serial Settings: Ring RTS DTR DSR Current Serial Settings: Ring DSR (79 ~): uname -a FreeBSD Nausicaa.mitre.org 4.3-RC FreeBSD 4.3-RC #2: Tue Apr 10 10:50:19 EDT 2001 root@Nausicaa.mitre.org:/usr/obj/usr/src/sys/NAUSICAA i386 Seems to work for me. -- \ |_ _|__ __|_ \ __| Jason Andresen jandrese@mitre.org |\/ | | | / _| Network and Distributed Systems Engineer _| _|___| _| _|_\___| Office: 703-883-7755 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message