Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Oct 1996 19:42:08 -0700
From:      Craig Shaver <craig@progroup.com>
To:        hmmm <hmmm@alaska.net>
Cc:        freebsd-questions <questions@FreeBSD.org>
Subject:   Re: using sio ports
Message-ID:  <32644B80.41C67EA6@progroup.com>
References:  <Pine.SOL.3.91.961015142254.25395A-100000@calvino>

next in thread | previous in thread | raw e-mail | index | archive | help
hmmm wrote:
> 
> i'm not to great at UNIX and would appreciate any guidance in proceeding
> with the following:
> 
> i have a FBSD box that needs to communicate with another non-UNIX box
> using a custom async protocol.
> 
> my current state of ignorance would just like to mark off a BSD com port,
> throw in a polling-based driver for the marked off port, and be on my way,
> without further complications.
> 
> but i think i'm oversimplifying.  i think i'd have trouble because the
> remote PC would cause overruns in the FBSD box due to FBSD interrupts.
> 

Why?  If you hang a read on the port it should get everything.  The
device
driver will take care of any FIFO and store a certain amount of chars in
kernel space.

> if i have to use a standard FBSD sio driver for the com port i wish to use,
> what special considerations/configurations do i need to take into account?

You just need to know how to set up the port using ioctl().

> 
> can i just connect the 2 PCs with a NULL modem cable and start C coding
> with some print routines in/out the ports?

Open the port (=device in /dev) as a regular file.  Set it up for the
line
protocol you need using ioctl().  Do a man -s 4 tty (tty(4)), and follow
the
"see also" man pages, especially termios.  See also sio(4).

> 
> does it matter whether i use a NULL modem cable between the FBSD box and
> the remote PC as opposed to 2 radio modems? (diff cfgs?)

Null modem should work great.

> 
> is there a good libc function that allows you to
> putarray(numofbytes)/getarray(numofbytes) and puts()/gets()
> in and out of sio ports?

use the std c lib.  use whatever you want, read(), fread(), fgets(),
fgetc(), .........


> ------------------------------------------------------------------------------
>  ?                                                http://www.alaska.net/~hmmm
> ------------------------------------------------------------------------------

-- 
Craig Shaver  (craig@progroup.com) (415)390-0654 
Productivity Group POB 60458 Sunnyvale, CA  94088



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32644B80.41C67EA6>