Serial Port Setup

Thomas Mondoshawan Tate plug-discuss@lists.PLUG.phoenix.az.us
Tue, 20 Nov 2001 19:50:22 -0700


--9jxsPFA5p3P2qPhR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Nov 20, 2001 at 08:41:25AM -0700, Nicholas Bacon wrote:
> I am trying to set up a serial port to=20
> read data from a weather station.  I=20
> have some C code that will set up the=20
> allow the port to listen, but I can't=20
> find any information on how to get=20
> the code "into" dev/ttyS0 or ttyS1. =20
> Do I compile it into that directory=20
> with the name ttyS1 and replace it,=20
> or something else?

Well, first off, you have to realize that all of the files in the /dev
directory correspond directly to each device installed in your system. If
you want to send data to a device, you have to open() it like a file, and
write() to it. The same procedure goes for reading: open() it and then
read() from it.

What do you mean "get the code 'into' dev/ttyS0 or ttyS1"? Do you mean
upload the actual program into the device?

--=20
Thomas "Mondoshawan" Tate
phoenix@psy.ed.asu.edu
http://tank.dyndns.org

--9jxsPFA5p3P2qPhR
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7+xZuYp5mUsPGjjwRAgIEAJ4lAufE4rKMnfTRAYZP657nU5+EzgCeIWCG
Yq4bOvxG4uSOWqMOSAgxDM8=
=eFhO
-----END PGP SIGNATURE-----

--9jxsPFA5p3P2qPhR--