[Chicago-talk] distinguishing between tped input and scanned
richard at rushlogistics.com
Fri Apr 15 05:28:43 PDT 2005
> Instead of doing blocking reads use a polling read
> the raw device. The Camel documentation for "select"
> describes this in some detail. The trick is to read
> bytes from your input data stream until you get the
> number of bytes, with a timeout that avoids
> blocking on the port.
> If you put the keyboard temporarily into raw mode
> get the individual bytes; when you get five of them
> flush the input stream and put it back in cooked
> (readkey does most of this for you but sysread +
> gives finer control).
> The point is to suck in bytes as they happen, which
> requires being in raw mode.
Thanks for the response. This would have been a very
elegant solution, but I took the easy way out
(recommended by Warren) and reconfigured my scanner.
A people that values its privileges above its principles soon loses both. -Dwight D. Eisenhower.
More information about the Chicago-talk