srpenndo@uokmax.UUCP (Sean Richard Penndorf) (12/03/88)
If I use RAMSDOpen to open the serial port for use with a modem, AND no carrier is currently connected, as soon as I make a FSWrite call to the serial port, the program locks up and I have to re-boot. However, if I make an Open Driver call to open both the output and input ROM drivers, the program works fine, with no other changes. Anyone have any ideas WHY this is occurring? I would prefer to use the RAM serial drivers, but so far I have been unable. I am using a Mac 512E with a Dove 2meg and SCSI port upgrade (MacSnap 548S). I use, when developing, System 5.3 and Finder 6.0. And when checking the stand alone application at 2400 baud, I use System 6.0.1. Any help would be greatly appreciated, and if you need more info I can mail you portions of the source code for you check. Thanks. -- Sean 'Longstride' Penndorf !texsun!uokmax!srpenndo . . .----------- GEnie: S.PENNDORF | | `---. ---- The WEASEL Project ---- `--'LTIMATUM----'OFTWARE
parent@Apple.COM (Sean Parent) (12/21/88)
In article <2094@uokmax.UUCP>, srpenndo@uokmax.UUCP (Sean Richard Penndorf) writes: > If I use RAMSDOpen to open the serial port for use with a modem, AND > no carrier is currently connected, as soon as I make a FSWrite call to the > serial port, the program locks up and I have to re-boot. However, if I make > an Open Driver call to open both the output and input ROM drivers, the > program works fine, with no other changes. I think that what is happening is that the driver is using flow control and the modem is not currently recieving. The solution is to make the Write ASYNC and either use a completion routine to notify you when the send is complete or monitor the ioResult in the ParamBlock (you must use PBWrite). ioResult will stay positive until the write is complete and then it will either go to 0 (no error) or negative (error code). Monitoring ioResult can be a bit simpler then writing an ioCompletion routine. It might be a good idea to time out your write after about 30 seconds (adjust it to the size of the block you are send- ing). You can cancel the write with a call to PBKillIO. Keep in mind that during the write the ParamBlock and the ioBuffer are in-use and cannot be reused without disasterous results. (Make sure you don't dealocate them during a write). Sean