Path: utzoo!attcan!uunet!cs.utexas.edu!asuvax!mcdphx!phx.mcd.mot.com!teroach!dbk From: teroach!dbk@phx.mcd.mot.com (Dave Kinzer) Newsgroups: comp.sys.amiga.tech Subject: Re: Multi serial/parallel ports Summary: DTR using Dialin/Dialout Message-ID: <13918@mcdphx.phx.mcd.mot.com> Date: 29 Oct 90 20:24:51 GMT References: <77.2727B691@myamiga.UUCP> <6910@sugar.hackercorp.com> Sender: listen@mcdphx.phx.mcd.mot.com Reply-To: teroach!dbk@phx.mcd.mot.com (Dave Kinzer) Followup-To: comp.sys.amiga.tech Organization: Motorola Analog Integrated Circuits Division Lines: 33 >In article <77.2727B691@myamiga.UUCP> smp@myamiga.UUCP (Steve Palm) writes: >>Suppose you had a few tasks up and running. One that was watching for dialins >>on the serial port, and one that was calling out. The one calling out >>wouldn't adversely affect the one waiting for calls by messing around with the >>DTR, but the one waiting for calls would stop the dialout program from >>dropping the DTR using open-close techniques. > In article <6910@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes: >Would Matt Dillon please speak up and explain just how he solves this problem >in his getty program? I'm not Matt, nor play on on TV, but... The proper way: The dialin (monitor) program periodically wakes up, allocates the serial device for exclusive use (if refused, port is busy with dialout program), and asks the state of the DTR line. If busy or DTR inactive, go back to sleep otherwise proceed with the dialin program. The less proper but more CPU efficient method: The dialin program periodically wakes up and looks at the serial port hardware directly. If the DTR line has gone from inactive to active since the last time it woke up, try to allocate the serial device for exclusive use. If no change in DTR state or refused the serial device, go back to sleep, otherwise proceed with the dialin program. Example source code for this method was written by myself and available on a Fish disk somewhere around disk 250. * * * Imminent use of deathnet predicted. * * * // Dave Kinzer (602)897-3085 asuvax!mcdphx!teroach!dbk Opinions are mine. \X/