From:	SMTP%"reece@eco.twg.com" 17-MAY-1994 12:41:14.71
To:	EVERHART
CC:	
Subj:	Re: Need DTR dropper pgm.

From: reece@eco.twg.com (Reece R. Pollack)
X-Newsgroups: comp.os.vms
Subject: Re: Need DTR dropper pgm.
Date: 17 May 1994 14:46:37 GMT
Organization: The Wollongong Group, Inc.
Lines: 205
Sender: reece@crasheco.twg.com (Reece R. Pollack)
Distribution: world
Message-ID: <2ralcd$qcf@scoop.eco.twg.com>
Reply-To: reece@eco.twg.com
NNTP-Posting-Host: crash.eco.twg.com
To: Info-VAX@CRVAX.SRI.COM
X-Gateway-Source-Info: USENET


In article <1994May16.105149.1396@gems.vcu.edu>, agnew@gems.vcu.edu (Brainwave Surfer) writes:
|>  I heard of one program many years ago that toggled the DTR lead of a
|>modem port, just so you could turn off the autoanswer of hte modem.
|>
|>Now, many moons later, i need such a beastie.  I'd rather not reinvent
|>the wheel, but if i must, I'll offer it.  Any ones out there who have
|>such an animal laying around?  I'll post summaries unless requested not.

I have a pair of MACRO programs which turn on and off the DTR signal
on a /NOMODEM terminal port. They will not work on a terminal port which
is set /MODEM because then the TTDRIVER has control of modem signals.

Sources attached below the sig...

--
Reece R. Pollack
Senior Software Engineer
The Wollongong Group, Inc.



------ CUT HERE ------ CUT HERE ------ CUT HERE ------ CUT HERE ------

	.TITLE	DTR_ON Turn on DTR & RTS on a /NOMODEM terminal
	.IDENT	/V1.0-000/
 
;++
; FACILITY: Handy utilities
;
; FUNCTIONAL DESCRIPTION:
; 
;	This program turns on the DTR and RTS modem
;	signals on a terminal which is set /NOMODEM.
;
;	The terminal to be set is referenced via
;	the logical name MODEM_PORT.
;
; ENVIRONMENT: VAX-VMS, User mode
;
; AUTHOR: Reece R. Pollack, CREATION-DATE: 30-Aug-1991
;
; MODIFIED BY: 
;
;--

	.PAGE
	.SUBTITLE DECLARATIONS
;
; INCLUDE FILES:
;
	$IODEF
	$TTDEF

;
; OWN STORAGE:
;
iosb:	.BLKW	4		; I/O Status Block
chan:	.BLKW	1		; I/O Channel number

;
; Modem mode parameter blocks
;
assert_modem:
	.WORD	0
	.BYTE   TT$M_DS_DTR!TT$M_DS_RTS
	.BYTE   0
	.LONG	0

;
; Terminal port name descriptor and string
;
port:	.ASCID	/MODEM_PORT/

	.PAGE
	.SUBTITLE Executable code

	.ENTRY	DTR_ON,^M<>

;
;	Assign channel to MODEM_PORT device
;
	$ASSIGN_S -
		 devnam = port, -
		 chan   = chan
	BLBC	R0, error	; On error, exit with $ASSIGN failure code

;
;	Assert DTR and RTS on the modem port
;
	$QIOW_S -
		chan	= chan, -
		func	= #<IO$_SETMODE!IO$M_SET_MODEM!IO$M_MAINT>, -
		iosb	= iosb, -
		p1	= assert_modem
	BLBC	R0, error	; On error, exit with $QIOW failure code

;
;	Deassign the channel
;
	$DASSGN_S -
		chan   = chan
	BLBC	R0, error	; On error, exit with $DASSGN failure code

;
;	Everything OK, exit with I/O status
;
	MOVZWL	iosb, R0
error:
	RET

	.END	DTR_ON

------ CUT HERE ------ CUT HERE ------ CUT HERE ------ CUT HERE ------

	.TITLE	DTR_ON Turn off DTR & RTS on a /NOMODEM terminal
	.IDENT	/V1.0-000/
 
;++
; FACILITY: Handy utilities
;
; FUNCTIONAL DESCRIPTION:
; 
;	This program turns off the DTR and RTS modem
;	signals on a terminal which is set /NOMODEM.
;
;	The terminal to be set is referenced via
;	the logical name MODEM_PORT.
;
; ENVIRONMENT: VAX-VMS, User mode
;
; AUTHOR: Reece R. Pollack, CREATION-DATE: 30-Aug-1991
;
; MODIFIED BY: 
;
;--

	.PAGE
	.SUBTITLE DECLARATIONS
;
; INCLUDE FILES:
;
	$IODEF
	$TTDEF

;
; OWN STORAGE:
;
iosb:	.BLKW	4		; I/O Status Block
chan:	.BLKW	1		; I/O Channel number

;
; Modem mode parameter blocks
;
deassert_modem:
	.WORD	0
	.BYTE   0
	.BYTE   TT$M_DS_DTR!TT$M_DS_RTS
	.LONG	0

;
; Terminal port name descriptor and string
;
port:	.ASCID	/MODEM_PORT/

	.PAGE
	.SUBTITLE Executable code

	.ENTRY	DTR_OFF,^M<>

;
;	Assign channel to MODEM_PORT device
;
	$ASSIGN_S -
		 devnam = port, -
		 chan   = chan
	BLBC	R0, error	; On error, exit with $ASSIGN failure code

;
;	Assert DTR and RTS on the modem port
;
	$QIOW_S -
		chan	= chan, -
		func	= #<IO$_SETMODE!IO$M_SET_MODEM!IO$M_MAINT>, -
		iosb	= iosb, -
		p1	= deassert_modem
	BLBC	R0, error	; On error, exit with $QIOW failure code

;
;	Deassign the channel
;
	$DASSGN_S -
		chan   = chan
	BLBC	R0, error	; On error, exit with $DASSGN failure code

;
;	Everything OK, exit with I/O status
;
	MOVZWL	iosb, R0
error:
	RET

	.END	DTR_OFF

------ CUT HERE ------ CUT HERE ------ CUT HERE ------ CUT HERE ------

