From owner-freebsd-questions Thu Jan 27 13: 7:37 2000 Delivered-To: freebsd-questions@freebsd.org Received: from logisticsoftware.co.nz (logisticsoftware.co.nz [202.37.163.1]) by hub.freebsd.org (Postfix) with ESMTP id EF16C15735 for ; Thu, 27 Jan 2000 13:07:32 -0800 (PST) (envelope-from jonc@logisticsoftware.co.nz) Received: from jonc.logisticsoftware.co.nz (jonc.logisticsoftware.co.nz [10.1.3.1]) by logisticsoftware.co.nz (8.9.3/8.9.3) with ESMTP id KAA22544; Fri, 28 Jan 2000 10:07:13 +1300 (NZDT) Received: (from jonc@localhost) by jonc.logisticsoftware.co.nz (8.9.3/8.9.3) id KAA03679; Fri, 28 Jan 2000 10:07:13 +1300 (NZDT) (envelope-from jonc) Date: Fri, 28 Jan 2000 10:07:12 +1300 From: Jonathan Chen To: Tom Riley Cc: freebsd-questions@FreeBSD.ORG Subject: Re: recording Serial Input Message-ID: <20000128100712.G3290@jonc.logisticsoftware.co.nz> References: <001501bf6901$157c88b0$e972e589@billyjoetombob.cts.uaa.alaska.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <001501bf6901$157c88b0$e972e589@billyjoetombob.cts.uaa.alaska.edu>; from axtjr@UAA.ALASKA.EDU on Thu, Jan 27, 2000 at 10:59:56AM -0900 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, Jan 27, 2000 at 10:59:56AM -0900, Tom Riley wrote: > All: > I'm in the need of a method that will open and record all data coming in via > the serial port. In short, how do you read text data from a serial port? > > I want to pipe the raw text data coming in via the serial port into a file, > and then on a nightly (cron job) basis to move that file to a "holding" > directory. The data will be coming from a telephone switch that only knows > how to pipe records out a serial port (so no scripting ability on that side > to do any sort of terminal login). You could: 1. cat(1) the data from the device file, /dev/cuaa0(?), possibly using stty(1) to set the required serial modes. You might have to put this in a script so that the stty(1) modes `stick' when you read from the serial port. 2. write a program to do this. tcsetattr(3), open(2) are your friends. Jonathan Chen --------------------------------------------------------------------- When all other forms of communication fail, use words To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message