Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!swrinde!ucsd!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: Checking Serial drivers for pending chars Message-ID: <9052@hoptoad.uucp> Date: 22 Nov 89 15:13:44 GMT References: <10346@cadnetix.COM> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 22 In article <10346@cadnetix.COM> pem@cadnetix.COM (Paul Meyer) writes: > The easiest thing would be to check if there is pending stuff in >the serial driver's buffer. A couple of calls in IM looked like they *might* >give this info, but both looked more likely not to (please pardon any >misremembered call names; I don't have my IM at work): > SerGetBufSize? returns the size of the serial buffer. I suspect this >is the size it was allocated (default or by the set-buffer call), not the >amount in use or amount left. No, SerGetBuf returns the number of bytes in the buffer of the input driver whose reference number you pass it, meaning the number of bytes waiting to be read. I suppose the IM language is a little vague, but I've done this, and it tells you how many characters have been received by the driver and not yet read by the application (or whoever is calling the driver). -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com FROM THE FOOL FILE: "Yet another piece of evidence that it's a Communist society which is being presented as good, but which we probably would not want to live in." -- Ken Arromdee on rec.arts.startrek, on the Federation's Red Menace