delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/17/05:15:19

Xref: news2.mv.net comp.os.msdos.djgpp:6074
From: Tom Wheeley <tomw AT tsys DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Nasty problem with SVAsync
Date: Wed, 10 Jul 96 01:11:28 GMT
Organization: City Zen FM
Lines: 25
Message-ID: <836961088snz@tsys.demon.co.uk>
Reply-To: tomw AT tsys DOT demon DOT co DOT uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Firstly, thankyou very much for svasync; it's very nice :-)

I've got a horrible feeling I'm being stupid here, but it seems to have
problems with reading `\0' from the serial port.

Using it the lazy way, as suggested is possible in the docs, (using the
return value of SVAsyncIn()) there is no way of discriminating between a
failed call and reading 0.

> unsigned char SVAsyncIn(void);
> Returns the next character in the buffer or a NULL upon an empty buffer.
> Use SVAsyncInStat() to check for the number of characters in the buffer.

I am now checking SVASyncStat() before each read :-)

Perhaps a note in the docs concerning this pitfall, or a more foolproof
SVASyncIn()  (trivial) is required.  There are a lot of us fools around!

..splitbung
-- 
* TQ 1.0 * The 'Just So Quotes'.
"Never put off until run time what you can do at compile time."
    	--  David Gries, in "Compiler Construction for Digital 
    	    Computers", circa 1969.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019