Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jan 2000 10:07:12 +1300
From:      Jonathan Chen <jonc@logisticsoftware.co.nz>
To:        Tom Riley <axtjr@UAA.ALASKA.EDU>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: recording Serial Input
Message-ID:  <20000128100712.G3290@jonc.logisticsoftware.co.nz>
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
References:  <001501bf6901$157c88b0$e972e589@billyjoetombob.cts.uaa.alaska.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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