[comp.sys.amiga] set serial port

hansb@ariel.unm.edu (Richard Harris PSYCHOLOGY) (04/24/87)

I need some help with the serial port.  I need to know how to set the
serial port in C to a one byte buffer.  Currently, the buffer is set by
preferences to 512 bytes.

The major reason for this one byte buffer is so I can hook up a "simple"
terminal to the amiga through the serial port and say:

newcli ser:

That would make the amiga into a multi-user system, but right now,
since the buffer is 512 bytes, I have to enter 512 bytes of data before the
computer responds.

I have tried setserial, but it doesn't seem to do the job...

Thanks for any help...
Hans Bechtel

dillon@CORY.BERKELEY.EDU.UUCP (04/26/87)

	You cannot set the serial port's buffer to 1 byte.  However, you
can use my latest PIPE: device to slave a CLI, then write a terminal  
program to drive it:

	newcli PIPE:name/t


	C Program would then:
		open the serial.device (somewhat messy, I'll post some general
		routines to handle generic device stuff momentarily).

		Open the same PIPE: with modes 1006 (MASTER):

		fh = Open("PIPE:name/ns31", 1006);

		Where 's31' is the signal number you want that filehandle to
		signal you with when there is read data available, 'n'
		means your writes to the handle never block and always work.
		In any case, Read()ing from the file handle reads what the
		CLI gives back to you, and writing sends stuff to the CLI.

	(Note: I'm assuming you have experience in using EXEC devices).

	Note that closing the filehandle does not get rid of the CLI, since
	the CLI does not recognize file EOF's... you must send an
	'ENDCLI' command over to it.

	Also remember that the CLI expects a newline to enter a command line,
	sending return (13) will not work.  Therefore, you would have to 
	scan incomming data over the modem and modify it.


				-Matt

avery@puff.WISC.EDU (Aaron Avery) (04/26/87)

In article <934@charon.unm.edu>, hansb@ariel.unm.edu (Richard Harris PSYCHOLOGY) writes:
> I need some help with the serial port.  I need to know how to set the
> serial port in C to a one byte buffer.  Currently, the buffer is set by
> preferences to 512 bytes.
>
Nice try, but this won't solve the problem. It's that AmigaDos asks SER:
for 256(? really a guess) characters at a time.

> The major reason for this one byte buffer is so I can hook up a "simple"
> terminal to the amiga through the serial port and say:
> 
> newcli ser:
> 
> That would make the amiga into a multi-user system, but right now,
> since the buffer is 512 bytes, I have to enter 512 bytes of data before the
> computer responds.
As before, I think it's more on the order of 256.

I will be posting an AmigaDos handler which allows just this. It takes care
of the most obvious LF -> CR,LF conversions, etc.
It will be posted in both executable and binary (uuencoded) forms. This is
(partly) because someone will probably want to hack it up to his own needs,
and (partly) because it might be of some educational value.
I have a few more modifications to make, one being a slight problem with
the skeleton handler Phillip Lindsay provided (thanks, Phil!), and I really
should comment the thing before posting. Hopefully in the next week or
so. It really is quite slick (thanks Amiga!).

Aaron Avery ({caip,seismo,allegra,harvard,ihnp4}!uwvax!puff!avery)
	    (avery@puff.wisc.edu)

ud118191@ndsuvm1.bitnet.UUCP (04/28/87)

Here's a tip about hooking up a dumb terminal to the Amiga. My business
partner and I purchased the Metacomco Toolkit software package. The Toolkit
has some features available, one of which was helpful to us. The feature we
used the most was "Mount Aux:" and it enabled us to basically set up, after
the proper parameters were defined (e.g., baud rate, etc.), a dumb terminal
as a newcli. Also, since a telephone modem is bacially an extension of the
serial port, we were able to modify the parameters as mentioned above and the
interesting result was that we could use a public domain telecommunications
package to call the other Amiga (for instance, I'd use Comm1.3 to call his
Amiga which had an AUX: already mounted) and I could type in AmigaDOS
     
commands it would work on his machine. Under the mounted Aux: and newcli that
I operated under (via the phone lines), I was able to have my own current
directory (cd) and I could manipulate a lot of things. I could even instruct
the Juggler to boot. Of course, he had to stop the Juggler at his terminal,
thus limiting the Dumb terminal user to simple DOS routines with no graphics
user interface. If anyone plans on doing this, there is one bug we found in
this whole process: Make sure you set your preferences to 60 columns on both
ends (over the phone lines) but if you're simply connecting a dumb terminal,
then 80 column text should work! Good Luck one and all!
     
*****************************************************************************
* Brendan Larson, Meteorologist,                                            * *
* Channel 41 News -Weather Dept.                                       *     *
* & Weather-Buffs Co.-->>"Dedicated to Expanding the Horizons of the Amiga!"*
*                                                                            *
* UD118191@NDSUVM1.BITNET           Go CUBS, GO!                            *
****************************************************************************  *

page@ulowell.cs.ulowell.edu (Bob Page) (04/30/87)

UD118191@NDSUVM1.BITNET wrote in article <142UD118191@NDSUVM1>:
(using AUX: to put a NEWCLI on it)
>There is one bug we found in this whole process: Make sure you set your
>preferences to 60 columns on both ends (over the phone lines) but if
>you're simply connecting a dumb terminal, then 80 column text should work!

I'm not sure what this means, or why it should be so.  Can you shed
more light on this?

Another thing to remember is you DON'T want to do a NEWCLI AUX: and
hook up your modem to it, then call from a friend's house (or from
"work" if you do that sort of thing).  Sure it's a trip to be able
to call your amiga and start up Juggler for your cat, but it's just
as easy for somebody to call you, get the CLI and create havoc.
Can you say DELETE C:#? - I knew you could.

I understand DIGA (from Aegis) allows you to "log in" to your Amiga
in this fashion ... you call it up and enter a password.  THEN you're
free to entertain your cat.

..Bob
-- 
Bob Page, U of Lowell CS Dept.   page@ulowell.{uucp,edu,csnet} 

ali@rocky.UUCP (05/01/87)

In article <1240@ulowell.cs.ulowell.edu> Bob Page writes:
>I understand DIGA (from Aegis) allows you to "log in" to your Amiga
>in this fashion ... you call it up and enter a password.  THEN you're
>free to entertain your cat.

Just make sure you don't have PopCLI running. Unless, of course, your cat
can come move the mouse. My cat would have no problems there.

Ali Ozer, ali@rocky.stanford.edu