[comp.sys.amiga.tech] drop DTR

papa@pollux.usc.edu (Marco Papa) (02/16/89)

I am posting here since my responses to personal e-mail have all
bounced back, and this might be of general interest.

Doing a simple:

CloseDevice(..);
OpenDevice(..);

of a serial device will NOT drop DTR.  Doing instead:

CloseDevice(..);
Delay(50L);
OpenDevice(..);

will ALWAYS drop the DTR line.  This is all from "empirical" results
using the built-in serial device.  I have NEVER been able to have the
DTR line dropped on ANY of my modems WHITHOUT the 1 sec. delay.

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) (02/18/89)

:of a serial device will NOT drop DTR.  Doing instead:
:
:CloseDevice(..);
:Delay(50L);
:OpenDevice(..);
:
:will ALWAYS drop the DTR line.  This is all from "empirical" results
:using the built-in serial device.  I have NEVER been able to have the
:DTR line dropped on ANY of my modems WHITHOUT the 1 sec. delay.

	Also, remember that you must make an SDCMD_SETPARAMS call after
reopenning the serial.device to get back whatever your old serial
modes were.  I always have an auxillary IOExtSer structure with the
modes I want.  Remember to specify a dummy request in the OpenDevice()
(as opposed to the aux structure which has your original modes)
because the serial.device will overwrite it with the default prefs
params.

	Most people already know that you cannot do the SDCMD_SETPARAMS call
if there are outstanding requests.  In my opinion, this is stupid, but
that is the way it goes!

				-Matt

papa@pollux.usc.edu (Marco Papa) (02/18/89)

In article <8902172041.AA06747@postgres.Berkeley.EDU| dillon@POSTGRES.BERKELEY.EDU (Matt Dillon) writes:
|:I (Marco Papa) write:
|:of a serial device will NOT drop DTR.  Doing instead:
|:
|:CloseDevice(..);
|:Delay(50L);
|:OpenDevice(..);
|:
|:will ALWAYS drop the DTR line.  This is all from "empirical" results
|:using the built-in serial device.  I have NEVER been able to have the
|:DTR line dropped on ANY of my modems WHITHOUT the 1 sec. delay.
|
|	Also, remember that you must make an SDCMD_SETPARAMS call after
|reopenning the serial.device to get back whatever your old serial
|modes were.  I always have an auxillary IOExtSer structure with the
|modes I want.  Remember to specify a dummy request in the OpenDevice()
|(as opposed to the aux structure which has your original modes)
|because the serial.device will overwrite it with the default prefs
|params.

Yes, the whole thing looks like this in A-Talk III:

DropDTR()
{
MyAbortIO(Read_request);
CloneSer(Read_request,local);		/* copy the IOExtSer byte by byte */
CloseDevice(Read_request);
Delay(50L);
OpenDevice(serdevice, serunit, .....);	/* check for errors, of course */
CloneSer(local, Read_request);
CloneSer(local, Write_request);
SetParams(Read_Request);
InitRWCommands();		/* reset CMD_READ, CMD_WRITE in io_Command */
}

Works like a champ!

-- Marco Papa 'Doc'
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
uucp:...!pollux!papa       BIX:papa       ARPAnet:pollux!papa@oberon.usc.edu
 "There's Alpha, Beta, Gamma and Diga!" -- Leo Schwab [quoting Rick Unland]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=