[net.micro.amiga] serial driver query

louie@trantor.UMD.EDU (01/02/86)

From: Louis A. Mamakos <louie@trantor.UMD.EDU>

I'm writing (yet another) terminal program that also does XMODEM type
file transfers.  I'm using the console.device handler attached to a 
window to do the terminal emulation.  Performence suffers pretty badly
when making single character requests to the driver, so I'm trying to
send more than one character at a time to the screen display.  The
problem that I've run across is not being able to ask for, say, 20
characters from the serial device driver without it blocking waiting for
all 20 to arrive.  I'd like to say, give me up to 20 characters that
might already be buffered, or block if none are there.  Then return me
a single character.  I'm using the 1.1 Kickstart and 1.1 Workbench disks
and therefore that version of the serial driver.

Louis A. Mamakos  WA3YMH    Internet: louie@TRANTOR.UMD.EDU
  University of Maryland, Computer Science Center - Systems Programming

tomp@amiga.UUCP (Tom Pohorsky) (01/03/86)

In article <876@caip.RUTGERS.EDU> louie@trantor.UMD.EDU writes:
>The problem that I've run across is not being able to ask for, say, 20
>characters from the serial device driver without it blocking waiting for
>all 20 to arrive.  I'd like to say, give me up to 20 characters that
>might already be buffered, or block if none are there.

  Under 1.1, DoIO the SDCMD_QUERY command. It will return (in the io_Actual 
field) the number of unread bytes in the serial.devices's input buffer.
Then do a read of the "n" pending characters all at once.