Path: utzoo!attcan!uunet!samsung!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!mimsy!mojo!russotto From: russotto@eng.umd.edu (Matthew T. Russotto) Newsgroups: comp.sys.mac.programmer Subject: Re: RAM serial driver and event handling Message-ID: <1990Sep19.193147.15445@eng.umd.edu> Date: 19 Sep 90 19:31:47 GMT References: <1021.26f75aef@iccgcc.decnet.ab.com> Sender: news@eng.umd.edu (The News System) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 32 In article <1021.26f75aef@iccgcc.decnet.ab.com> milikich@iccgcc.decnet.ab.com (Mike Milikich, Allen-Bradley Company) writes: >I am writing an application which needs to communicate with an external device >(a network bridge, actually) through the modem or printer ports. I have two >questions : > >0) Can anyone direct me to some sample code which uses the RAM serial driver to >read and write bytes to/from either port? In fact, is the RAM serial driver the >best way to do something like this (what are the options / pros / cons)? The Ram Serial driver is old and obselete-- use the new ROM serial driver, which has more functionality. There are many tech notes on using it, though some are contradictory. (If anyone knows how to close the new ROM serial driver, please tell me-- CloseDriver is _bad_, right?) >1) Is it a safe or sanctioned operation to use nullEvent to read any received >data from the serial port? What I need to do is allow event processing to >continue while I am waiting for replies. Something that might simplify this is >that there are no unsolicited responses, so I know when to look for received >data : only after I've sent some out. But while I am waiting for a reply packet, >I want to continue to respond to user input. Seems reasonable. If your reply packet will fit within the buffer size, set with SerSetBuf, there will be no problem. If it won't, you will have to check the buffer every time to make sure it isn't full, and if it is getting close, process even if it ISN'T a null event. Watch out for MenuSelect, though. Your program can lose control for a long time that way. (Same with TrackControl) -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu .sig under construction, like the rest of this campus.