[comp.sys.mac] RAMSDClose

tim@ism780c.UUCP (06/02/87)

I am attempting to use the modem port on my Mac+ from LightspeedC.

I open the driver with RAMSDOpen(), set parameters with SerReset(),
set it up to ignore hardware handshaking with whatever the call that
does that is ( SerHShk() ? ), and do my IO with PBRead() and PBWrite().

All of this seems to work.  However, when I finish and do RAMSDClose(),
it hangs.  The RAMSDClose() does not return until I cycle power on
the modem.

How do I get it to not do this?
-- 
Tim Smith			"Froh wie seine Sonnen fliegen
sdcrdcf!ism780c!tim		 Durch des Himmels praecht'gen Plan,
				 Laufet, Brueder, eure Bahn,
				 Freudig wie ein Held zum Siegen"

tim@ism780c.UUCP (Tim Smith) (06/05/87)

I have found out what was happening.  I was doing reads by starting
up an asynchronous read.  When it finishes, I pass the data back to
my program, and queue up another read.

Thus, I always have a read pending.

RAMSDClose() waits for IO to complete before closing the driver.
Thus, it hangs.  Flicking the modem off and on causes it to send
a couple characters of garbage, which satisfy the read, and then
RASDClose() finishes.

Now I call KillIO() before calling RAMSDClose(), and everything
works.

( by the way, the reason I am using the RAM serial driver rather
than the ROM serial driver ( which are the same on a plus, I think ),
is so that I will also run under the 64k rom. )
-- 
Religion: just say "no"         Tim Smith  {seismo,sdcrdcf}!ism780c!tim