[REBOL] Re: using wait on a serial device
From: holger:rebol at: 2-Nov-2000 21:08
On Thu, Nov 02, 2000 at 02:50:53PM -0800, David Hawley wrote:
> I am building at least a prototype of an instrument which reports
> it's data collection via e-mail using REBOL. Currently it runs on
> QNX4, but probably will run on QNX RTP/Nto.
> I have several instruments which are connecteded via serial ports
> as well as a LCD/keypad display. I have writing to the display working
> and can read characters from the keypad, but am having trouble building
> a loop around a wait statement.
> I open the lcd with the following:
> lcd-fp: open/mode %/dev/ser1 [ direct write read binary ]
> writing works as expected using insert. To read chars I use:
> char: first lcd-fp
> but doing a: wait [lcd-fp]
> I get:
> >> wait [lcd-fp]
> ** Script Error: Invalid argument: ?port?.
> ** Where: wait [lcd-fp]
> >> type? lcd-fp
> == port!
For file ports REBOL currently does not distinguish between streams
and disk-based files. That's why 'wait does not work for them, and also
why 'skip'ping is slow and only works in one direction. Both are issues
that we plan to resolve in the future, by using different behaviors for
streams and disk-based files.
For serial i/o try one of the more recent experimental builds. They
support "serial:" ports (currently for all operating systems except MacOS
-- that to be supported soon). "serial:" ports support 'wait, and also
let you adjust port setting such as flow control and transfer rate.