tstmodem, Part 3 of 4

Vernon C. Hoxie vern at zebra.UUCP
Sun Sep 10 14:07:49 AEST 1989


This is the third part of the series started yesterday.

----------------------------- cut here -------------------------------

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 3 (of 4)."
# Contents:  blazer.text help.txt tstmodem.2.c
# Wrapped by vern at zebra on Mon Aug 21 22:11:23 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f blazer.text -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"blazer.text\"
else
echo shar: Extracting \"blazer.text\" \(14519 characters\)
sed "s/^X//" >blazer.text <<'END_OF_blazer.text'
XE  Echo ON/OFF: 				( 0 or 1 ) [ 0 ]
X   Echo command characters back to computer when in command mode.
X   0 = off 	1 = on
X
XF Echoplex ON/OFF: 				( 0-2 ) [ 1 ]
X  Echo data characters back to computer.
X   0 = Echo 		1 = No Echo
X   2 = Send LF following CR
X
XM Speaker ON/OFF:				( 0-2 ) [ 1 ]
X   0 = off 		1 = on when dialing and connecting
X   2 = on at all times.
X
XQ Quit Mode:					( 0-7 ) [ 0 ]
X   Control the reporting of result codes of local and remote modems.
X   0 = Local Report, Remote Report.  4 = Local Partial 1, Remote Quiet.
X   1 = Local Quiet,  Remote Report.  5 = Local Partial 1, Remote Report.
X   2 = Local Report, Remote Quiet.   6 = Local Partial 2, Remote Quiet. 
X   3 = Local Quiet,  Remote Quiet.   7 = Local Partial 2, Remote Report.
X   See manual for explanation of Partial 1 and Partial 2.
X
XP Pulse Dialing. ( Enter 'T' to toggle to Touch Tone. )
X
XT Touch Tone Dialing. ( Enter 'P' to toggle to Pulse. )
X
XV Verbose:					( 0 or 1 ) [ 1 ]
X   0 = Return numeric result codes.
X   1 = Returns English descriptions of result codes.
X
XX Extended Result Codes: 			( 0-3 ) [ 1 ]
X  0 = Return codes 0-4.			2 = Return MNP codes.
X  1 = Return codes 0-52.		3 = Return MNP and PEP codes.
X
XS00 Number Of Rings Before Answering. 		( 0-255 ) [ 1 ]
X   S = 0 disables auto answer.
X
XS01 Count Of Rings Currently In Progress.  	( 0-255 ) [  ]
X   Read only register.
X
XS02 Escape Character. 				( 0-255 ) [ 43 = + ]
X    If S48 = 0 (eighth bit off) and S02 > 127 then no escape recognized.
X    Also see S12 and S55.
X
XS03 Carriage Return Character. 			( 0-255 ) [ 13 = CR ]
X     Character modem is to interpret as <cr> when in command mode.
X
XS04 Line Feed Character. 			( 0-255 ) [ 10 = LF ]
X     Character modem is to interpret as <lf> when in command mode.
X
XS05 Backspace Character. 			( 0-255 ) [ 8 = BS ]
X     Character modem is to interpret as <bs> when in command mode.
X
XS06 Wait For Dial Tone Time. ( seconds ) 	( 2-255 ) [ 2 ]
X     Length of time to wait for dial tone following a 'W' command.
X
XS07 Wait For Carrier Time. ( seconds ) 		( 1-255 ) [ 40 ]
X     Length of time modem is to wait for valid carrier from remote modem.
X
XS08 Comma Pause Time. ( seconds ) 		( 0-255 ) [ 2 ]
X     Time to wait following a comma in dialing sequence.
X
XS09 Carrier Detect Time. ( 100 msec ) 		( 1-255 ) [ 6 ]
X     Time to wait in slow mode after carrier detect and
X     before connecting to the line.
X
XS10 Carrier Loss To Disconnect Time. (100 msec) ( 1-255 ) [ 7 ]
X     Time to wait in slow mode after loss of carrier before
X     disconnecting from the line.
X
XS11 Touch Tone Timing. ( msec ) 		( 50-255 ) [ 70 ]
X     Duration and timing of touch tone dialing sequence.
X
XS12 Escape Sequence Guard Time. ( 20 msec )	( 0-255 ) [ 50 ]
X     Delay before and after entering an escape sequence.
X
XS45 Remote Access Enable. 			( 0 or 255 ) [ 0 ]
X     Permit remote control functions in PEP mode.
X     0 = disabled		255 = permit remote access.
X     Remote Access only meaningful if S50 = 255 or S50 = 0.
X
XS47 DSR Delay Time. ( 50 msec ) 		( 0-255 ) [ 4 ]
X     Delay before asserting DSR after losing carrier and S53 = 4.
X
XS48 Eighth Bit Comparison. 			( 0-1 ) [ 0 ]
X     This register defines how XON, XOFF and ESC will be interpreted.
X     0 = Sets eighth bit to zero. Caution. 
X     1 = Recognizes full eight bits.
X
XS49 Product Identification. 			( 0-1 ) [ 0 ]
X     0 = Reports model ID.  See Manual for interpretation.
X     1 = Reports "123".
X
XS50 Transmission Mode Between Modems. 		( 0-3 or 255 ) [ 0 ]
X     0 = Automatic. The result is dependent upon S90 and S91 settings.
X     1 = 300 bps Bell 103 mode.	        3 = 2440 bps V.22 bis mode.
X     2 = 1200 bps Bell 212A or V.22   255 = FAST operation,  PEP mode.
X
XS51 Interface Speed Between Modem and Local DTE. ( 0-5 or 255 ) [ 4 ]
X    Significant only in PEP mode or S66=1.
X    0 = 300 bps, 	2 = 2400 bps, 		4 = 9600 bps,
X    1 = 1200 bps, 	3 = 4800 bps    	5 = 19200 bps,
X  255 = Automatic, different rates until it receives an 'a' or 'A'.
X    The modem will go into search mode by:
X	(a) Power On.
X	(b) Reset by 'ATZ' command.
X	(c) Change of S51 to 255 while in Command Mode.
X	(d) 'Break' sent from local DTE with S51 = 255.
X
XS52 DTR Interpretation. 			( 0-2 ) [ 0 ]
X     0 = Assume DTR always true.  May not accept data if DTR is off.
X     1 = Modem disconnected with DTR off and will not auto answer.
X     2 = Same as 1 but reloads parameters from EEPROM when DTR goes off.
X
XS53 Data Carrier Detect and Data Set Ready		( 0-4 ) [ 0 ]
X     0 = DSR, ready to accept data.  DCD, always ON.
X     1 = DSR, ready to accept data.  DCD, when carrier is detected.
X     2 = DSR, only when DCD is ON.   DCD, when carrier is detected.
X     3 = DSR, when modem off hook.   DCD, when carrier is detected.
X     4 = DSR, ready to accept data.  DCD, when carrier is detected.
X         When carrier is lost, DSR goes off for time in S47 then restored.
X
XS54 Break Signal Interpretation.	 	( 0-4 ) [ 0 ]
X	 This is functional only in the PEP mode.
X     0 = Switch to command mode.  Will not switch if (a) S55 greater
X         than 0; or (b) S48 = 0 and S2 greater than 127.  In these
X         you must disconnect and start over.
X     1 = Discards buffered data and sends 'break' to remote DTE.
X     2 = Sends 'break' to remote DTE immediately.
X     3 = Sends 'break' in sequence with data stream.
X     4 = Ignores 'break' signal.
X	 Regardless of this setting, buffered data is flushed when a
X         'break' is received from the remote modem.
X
XS55 Escape Character/Sequence. 			( 0-3 ) [ 0 ]
X	 An escape sequence is three consecutive escape characters
X	 as defined in register S2.  It is used to enter Command Mode
X	 when operating in Data Mode.
X     0 = Send sequence to remote DTE then enter command mode.
X	 If both S54 and S55 are greater than zero, there is no way
X         to hangup except to manually disconnect and start over!!
X     1 = Discard buffered data and send escape character to remote DTE.
X     2 = Sends escape character to remote DTE immediately.
X     3 = Sends the escape character in sequence with the data streams.
X
XS56 XON Character. 				( 0-255 ) [ 17 = ^Q ]
X     Defines the character to resume data flow if XON/XOFF flow
X     control is selected by S58 or S68.
X
XS57 XOFF Character. 				( 0-255 ) [ 19 = ^S ]
X     Defines the character to suspend data flow if XON/XOFF flow
X     control is selected by S58 or S68.
X
XS58 Flow Control Issued By DTE.      		( 0-6 ) [ 3 ]
X     This register is valid in PEP Mode or when S66 = 1.  See S68 also.
X     0 = No flow control.		4 = Use both XON/XOF and hardware.
X     1 = Use RTS/CTS in half duplex.	5 = Use ENQ/ACK. see S68
X     2 = Use RTS for full duplex.	6 = Use ENQ/ACK and XON/XOFF.
X     3 = Use XON/XOFF.
X
XS59 Prompt Character. 				( 0-255 ) [ 0 ]
X	Prompt character for command mode.
X
XS60 Data Format Between Modem and Local DTE. 	( 0-23 ) [ 0 ]
X     0 = 8 bits, no parity, one stop	12 = 6 bits, no parity, one stop
X     1 = 8 bits, odd parity, one stop	13 = 6 bits, odd parity, one stop
X     2 = 8 bits, even parity, one stop	14 = 6 bits, even parity, one stop
X     3 = 8 bits, no parity, two stop	15 = 6 bits, no parity, two stop
X     4 = 8 bits, odd parity, two stop	16 = 6 bits, odd parity, two stop
X     5 = 8 bits, even parity, two stop	17 = 6 bits, even parity, two stop
X     6 = 7 bits, no parity, one	stop	18 = 5 bits, no parity, one stop
X     7 = 7 bits, odd parity, one stop	19 = 5 bits, odd parity, one stop
X     8 = 7 bits, even parity, one stop	20 = 5 bits, even parity, one stop
X     9 = 7 bits, no parity, two stop	21 = 5 bits, no parity, two stop
X    10 = 7 bits, odd parity, two stop	22 = 5 bits, odd parity, two stop
X    11 = 7 bits, even parity, two stop	23 = 5 bits, even parity, two stop
X    Refer to the Manual for additional discussion regarding parity.
X
XS61 Speaker Volume. 				( 0-255 ) [ 45 ]
X
XS62 Break Length Time. ( 50 msec ) 		( 2-255 ) [ 3 ]
X     Length of time to assert Receive Data (RD) to local DTE when a
X     'break' signal is received from the remote modem.
X
XS63 Attention Code On/Off. 			( 0 or 1 ) [ 1 ]
X     0 = "AT" prefix not required, all characters treated as commands.
X     1 = "AT" prefix required on each command line.
X
XS64 Dial/Answer Abort. 				( 0 or 1 ) [ 0 ]
X     0 = Abort if character received from DTE before connection is
X         established.
X     1 = Ignore any characters sent while dialing or answering.
X
XS65 XON/XOFF Failsafe. 				( 0 or 1 ) [ 0 ]
X     0 = Use Normal XON/XOFF control.
X     1 = Modem issues XOFF when flow control threshold is reached.
X         Then after each five characters are sent to the DTE.
X     This register is valid only if if S68 is 3, 4, 6, or
X     if S58 is 3, 4, 6 and S68 = 255.
X
XS66 Lock Interface Speed. 			( 0 or 1 ) [ 0 ]
X     Controls DTE interface speed when in slow modes.
X     0 = Forces DTE interface speed to connection speed, no flow control.
X     1 = Locks DTE interface speed and use flow control specified in
X         registers S58 and S68.
X
XS67 CTS Interpretation. 			( 0 or 1 ) [ 0 ]
X     Defines how modem uses Clear To Send (CTS) in relationship to
X     Request To Send (RTS) and carrier detect.  Depends upon settings
X     of S58 and S68.  This register is ignored if S58 = 1.
X     0 = CTS used for flow control per setting of S68.  Always on if
X         hardware flow control is not used.
X     1 = CTS comes on after RTS and carrier.  Goes off if carrier is
X         lost.  Flow control per S68.
X
XS68 Flow Control Issued By Modem. 		( 0, 2-6, or 255 ) [ 255 ]
X     0 = No flow control.		5 = ENQ/ACK flow control.
X     2 = CTS for flow control.          6 = ENQ/ACK and XON/XOFF control
X     3 = XON/XOFF flow control.       255 = Flow control per by S58.
X     4 = XON/XOFF and CTS control.
X
XS70 Instantaneous Transmit Rate. (read only)
X
XS71 Transmit Bits Per Channel Of All 511 Channels. (read only)
X
XS72 Instantaneous Receive Rate. (read only)
X
XS73 Receive Bits Per Channel. (read only)
X
XS74 Received Packets Retransmitted. (read only)
X
XS75 Packets Accepted. (read only)
X
XS76 Equivalent Line Noise Profile. (read only)
X
XS77 Frequency Offset. (read only)
X
XS78 Slow Mode Line Quality. (read only)
X
XS90 V.22 Mode Enable. 				( 0 or 1 ) [ 0 ]
X     0 = Bell 212A mode.  (2225 Hz. answer tone)
X     1 = V.22 mode. (2100 Hz. answer tone)
X     Significant for 1200 baud transmission only.
X
XS91 Guard Tone Select. 				( 0-2 ) [ 0 ]
X     0 = No guard tone.   1 = 1800 Hz guard tone  2 = 550 Hz guard tone.
X     Refer to S50 and S90 for more information.
X
XS92 Answering Sequence Select.  		( 0 or 1 ) [ 0 ]
X     This register effective only if S50 = 0.
X     0 = Use search sequence specified in S50.
X     1 = Issue PEP answer tones at the end of the search.
X         If answering modem has S92 = 1, then calling modem must have
X         firmware release R2.3 or greater and S50 = 255.  Also, S7
X         should be 60 seconds or more.  The answering modem should
X         not be have S7 less than the default of 40 seconds.
X
XS95 MNP Operating Mode.  			( 0-2 ) [ 0 ]
X     0 = Normal, MNP disabled.  Reports 'CONNECT xxxx'
X     1 = Attempts an MNP connection. If an MNP connection cannot be
X         made within 18 seconds of the establishment of the physical
X         link, the connection is dropped and 'NO CARRIER' is reported.
X         A successful MNP connection will report 'CONNECT xxxx/REL'.
X     2 = Tries for MNP connection then drops to normal if the MNP is not
X         established within 4 seconds of the physical link.
X         Reports appropriate 'CONNECTxxxx--' or CONNECTxxxx/REL.
X
XS100 Reverse Answer/Originate Mode. 		( 0-1 ) [ 0 ]
X      0 = Normal.
X      1 = Reversed. The modem will answer with originate type signals.
X          If rackmounted and connection by MI/MIC closure, connection
X          will attempted in answer mode.
X
XS101 Continuous Answer/Originate Mode. 		( 0-4 ) [ 0 ]
X      0 = Normal
X      1 = Attempt to connect every 20 seconds as answer modem.
X      2 = Attempt to connect every 20 seconds as originate modem.
X      3 = Immediate attempt to connect as answer modem.
X      4 = Immediate attempt to connect as originate modem.
X
XS102 Auxiliary A/A1 or MI/MIC Connections. 	( 0-2 ) [ 0 ]
X      Rackmounted versions only.
X      0 = Ignore auxiliary connections.
X      1 = Connected for A/A1 operation.
X      2 = Connected for MI/MIC operation.
X
XS102 Exclusive Access 				( 0 or 1 ) [ 0 ]
X      Rackmounted versions only and when properly connected to a 
X      Rackmounted Controller.
X      0 = Non-exclusive access.
X      1 = Data flow controlled Rackmounted Controller.
X
XS104 Automatic Dialing Options. 		( 0-2 ) [ 0 ]
X      0 = Disable automatic dialing.
X      1 = Automatic dialing controlled by off to on of local DTR.
X      2 = Enable automatic dialing whenever on hook and DTR is on.
X      For either S104 = 1 or 2, connection is per S100.
X
XS110 Data Compression. 				( 0, 1, or 255 ) [ 255 ]
X      This register effective only in PEP mode.
X      0 = Disable data compression.
X      1 = Enable data compression, remote modem S110 = 1 or 255.
X    255 = Enable data compression, remote modem S110 = 1.
X
XS111 Asychronous Protocols.  			( 0-255 ) [ 255 ]
X      This register effective only in PEP mode.
X      0 = No protocol supported.      13 = Kermit with mark partity.
X     10 = Kermit with no partity.     14 = Kermit with space partity.
X     11 = Kermit with odd partity.    20 = Xmodem/Ymodem protocol.
X     12 = Kermit with even partity.   30 = UUCP 'g' protocol.
X    255 = Use protocol specified by remote modem.  If both modems have
X          S111 = 255 then no protocol is supported.
X    If S111 is changed after the connection is established then the
X    '&R1' command must be issued to initiate renegotiations.
X    Refer to your "UUCP System Administration Guide" for configuring
X    with UUCP protocol support
X
XS112 Kermit Mark Character. 			( 0-127 ) [ 1 = SOH ]
X      This register only used when operating with Kermit protocol.
X
XS121 Echo Suppressor Compensation. 		( 0 or 1 ) [ 0 ]
X      0 = Do not compensate for echo compression.
X      1 = Enable echo suppression compensation.
X    Note: Both modems must have firmware version R2.3 or greater.
X    Changes to this register after connection is established, must
X    be followed by an '&R1' command to initiate renegotiations.
X
XN0 Stored telephone number.
X
XN1 Stored telephone number.
X
XN2 Stored telephone number.
X
XN3 Stored telephone number.
X
XN4 Stored telephone number.
X
XN5 Stored telephone number.
X
XN6 Stored telephone number.
X
XN7 Stored telephone number.
X
XN8 Stored telephone number.
X
XN9 Stored telephone number.
END_OF_blazer.text
if test 14519 -ne `wc -c <blazer.text`; then
    echo shar: \"blazer.text\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f help.txt -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"help.txt\"
else
echo shar: Extracting \"help.txt\" \(15315 characters\)
sed "s/^X//" >help.txt <<'END_OF_help.txt'
X
XHELP SCREEN:
X	Up Arrow: 	Scroll one line toward the beginning of the file.
X	Down Arrow:	Scroll one line toward the end of the file.
X	Page:		Scroll one page toward the end of the file.
X	Shift Page:	Scroll one page toward the beginning of the file.
X	Home:		Display the first page of the messages.
X	Shift Home:	Display the last page of the messages.
X	Exit:		Return to the previous display.
X
Xtst.hlp < 0
X
XSelect the "/dev/xxx" to which the modem you are testing is connected.
X
X	Left Arrow:	Move cursor left one space
X	Right Arrow:	Move cursor right one space.
X	Dlete Char: 	Delete the character under the cursor.
X	Back Space:	Delete the character to the left of the cursor.
X	Help:		Display a message about "Help" screens.
X	Exit:		Return to the device name display.
X	All Alpha-Numeric Keys:
X
XAlso see the <Help> message for the Optional Logging prompt.
X
Xtst.hlp < 1
X
XOptional Logging:
X
X	"A" or "a":	Append the data generated in this session to
X			existing "tst.log" file.
X	"N" or "n":	Overwrite any exixting data in "tst.log".
X	Return:		Enter the dislayed device path.
X	Exit:		Return to the previous display.
X
X	If no "tst.log is present, one will be created.
X
Xtst.hlp < 2
X
X	The routine which used this help message has been deleted.
X	help( 2 ) is available for other applications.
X
Xtst.hlp < 3
X
XCOMMAND Mode:
X
XRAW:
XF1:		Records all data sent to the modem or received from the
X		modem in 'raw' format.  Standard control characters are
X		displayed as:
X			\n for new line, ascii LF 0X0A
X			\r for carriage return, ascii CR 0X0D
X			\s for space, ascii ' ' 0X20
X			\t for tab, ascii HT 0X09
X			\b for backspace, ascii BS 0X08
X
X		All other control characters are reprsented in caret format.
X		For example:
X			^@ represents the NULL character.
X			^A represents 'control A'.
X
X		The DEL character ( 0x7F ) is represented as ^?.
X
X		Any characters which have the seventh bit ( the sign bit )
X		set, are represented in the Meta format.
X		For example:
X
X				0x82 will be M-^B.
X				0xA2 will be M-".
X				0xC2 will be M-B.
X				0xE2 will be M-b.
X
X		This mode does not effect the nature of the characters
X		actually being sent.  It is for display purposes only
X		as an aid in the recognition of the non-printing characters.
X		It does not effect the settings of the termio(7) structure.
X		Use the TERMIO, F7, key to modify the termio(7) data.  Lines
X		may appear fractured unles CANON is set in termio(7).
X
XCHAT:
XF2:		This mode aids in testing of expect/send sequences. 
X		A reminder that the first sequence is always an 'expect'
X		sequence is represented by preloading the data line with
X		the "" characters.  These may be erased if desired.
X
X		Sequences are delimited by a space, ' '.  If your sequence
X		requires a space, use the \s symbol.
X
X	The following substituions are inplemented:
X
X		""		Expect a null string.
X		EOT	0X04	Send an End Of File charater.
X		BREAK		Send a hardware "Break" signal.
X		\b	0X08	Send or expect a back-space.
X		\c		Suppress the 'new line' character at the
X				end of the sequence.
X		\d		Perform a delay of 1 second between the
X				characters.
X		\K		Insert a break.  This and the BREAK
X				command are implemented by using the
X				'ioctl( fd, TCSBRK, 0 )' command.
X		\n	0X0A	Send or expect a new line character.
X		\N	0X00	Send a NULL character.
X		\p		Pause for 0.5 seconds.
X		\r	0X0D	Send or expect a carriage return.
X		\s		Send or expect a space.
X		\t	0x09	Send or expect a tab.
X		\\		Send a back slash caharacter.
X		\xxx		Excape to convert an octal numeral to the
X				corresponding ascii character.
X
X		\C		A special mode for converting '\n's to '\r'.
X
XSYNC:
XF3:		Syncronize the computer baud rate to the modem.  S51
X		should be set to a fixed speed before syncronizing.
X		If this command fails.  Press the CONTROL key ( F5 )
X		and then RESET the modem to the EEPROM values. 
X
X		Del:
X		Shift Esc:  Abort SYNC attempts.
X
XSTATS:
XF4:		Read the statistics collected by the modem concerning
X		communication line quality and transmission information.
X		The connection is tested by issueing an "AT" to the modem.
X		If "OK" is returned immediately, it is assumed that the
X		modem is in Command Mode and the special select prompts
X		are displayed.
X
X		If "OK" is not returned immediately the "+++" escape
X		sequence is sent to place the modem into Command Mode.
X		Upon leaving STATS, the modem is reconnected to Data Mode.
X
XCONTROL:
XF5:		A quick means of inserting control characters onto the
X		data entry line.  Also permits sending a 'break', a modem
X		reset or sending an 'escape' sequence ( +++ ).  See the
X		<Help> screen after entering CONTROL.  Exit: or 'sp' will
X		return you to the regular COMMAND mode.
X
XRETURN:
XF6:		Will exit from 'tstmodem'.
X
XTERMIO:
XF7: 		Enter the TERMIO interactive screen for making changes to
X		the termio(7) structure.  See the <Help> screen there for
X		more information.
X
XMODEM:
XF8: 		Enter the Modem Register interactive screen for viewing
X		and setting the modems control registers.
X
XUp Arrow: 	Moves the cursor from the lower data entry line to the
X		upper data entry line.  When the cursor is on the upper
X		data entry line, this key will scroll the log display
X		one line toward the beginning of the log.
X
XDown Arrow: 	Moves the cursor from the upper data entry line	to the
X		lower data entry line.  When the cursor is on the lower
X		data entry line, the log display will scroll one line
X		toward the end of the log.
X
XLeft Arrow: 	Moves the cursor to the left on the data entry line.
X		Deletions and insertions may then be made.
X
XRight Arrow: 	Moves the cursor to the right over existing characters.
X		It will not move past the last character on the line and
X		cannot normally be used to move from the upper to lower
X		data entry line.
X
XNext: 		Move the cursor past the next word on the line.
X
XPrev: 		Move the cursor over the previous word on the line.
X
XHome: 		Move to the first page of data in the log.
X
XShift Home: 	Move to the last page of data in the log.
X
XPage: 		Display the next page of data in the log.
X
XShift Page: 	Display the previous page of data in the log.
X
XExit: 		Leave this mode to the mode you were in before
X		entering COMMAND.  The same as LEAVE F6:.
X
XDlete Char: 	Delete the character under the cursor.
X
XShift Dlete Char: Delete the character to the left of the
X		cursor.
X
XBack Space: 	Delete the character to the left of the cursor.
X
XDlete:		Delete the whole line on which the cursor rests.
X
XReturn: 	Send the data on the data entry lines.
X
XEnter: 		Send the data on the data entry lines.
X
X
XNotes:
X	The two lines following the 'Enter Data' or 'Chat Data' line are
Xavailable for sending up to 160 characters.  This is convenient when
Xcomplex chat scripts are being developed.  Use the Up arrow> or < Down
Xarrow> to change lines.  A <Return> will send the date already entered.
X
X	Normal data entry mode erases the data after each transmission
Xbut the data is retained for editing purposes in the 'chat' mode.
X
Xtst.hlp < 4
X
XCONTROL MODE
X	To produce control characters which cannot normally be entered
X	onto the data entry lines.  Also, generate special hardware
X	control functions to the modem.
X
XXON:
XF1:		Produce the control Q, ^Q, character.
X
XOFF:
XF2:		Produce the control S, ^S, character.
X
XACK:
XF3:		Produce the control F, ^F, character.
X
XNAK:
XF4:		Produce the control U, ^U, character.
X
XOTHERS:
XF5:		Produce any control character by entering its printable
X		equivalent.  That is, OTHER and D (or d) will produce the
X		control D, ^D, character and return you to COMMAND.  The
X		desired control charater will have been entered on the
X		data entry line.
X
XBREAK:
XF6:		Send a 'break' to the modem using the
X			'ioctl( fd, TCSBRK, 0 ) command.
X
XRESET:
XF7:		Resets the modem to the EEPROM values by seeting the
X		computers speed to B0.  This removes DTR.  The computers
X		speed is then reset to 9600 baud.
X
XESCAPE:
XF8:		Sends the standard escape sequence of '\d\c+++\c\d\c'
X		to the modem to return you to Command mode if S2=43
X		( + ) and S55=000.
X
X		Any other key will return you to main COMMAND mode.
X
Xtst.hlp < 5
X
XSTATS:
X
X	You can access the special data registers of the modem in this
Xmode.  These registers reflect the line quality of the connection.  Keys
X<F1> through <F6> are effective only in the PEP mode.
X
XTX RATE:
XF1:		Send 'S70?' then read the instantaneous rate at which data
X		is being transmitted.
X
XTX BITS:
XF2:		Send 'S71?' then read the number of bits assigned to each of
X		the 511 PEP mode channels.
X
XRX RATE:
XF3:		Send 'S72?' then read the instantaneous rate at which data
X		is being received.
X
XRX BITS:
XF4:		Send 'S73?' then read the number of bits beig received on
X		each of the 511 channels of the PEP mode.
X
XPACKS:
XF5:		Send 'S74?S75?' then read the number of packets transmitted
X		and received.
X
XNOISE:
XF6:		Send 'S76?' then read "Equivalent Line Noise Profile" of each
X		of the 511 PEP mode channels/
X
XFREQ OFF:
XF7:		Send 'S77?' then read frequency offset in Hertz.
X
XLINE Q:
XF8:		Send 'S78?' then read "Slow Mode Line Quality".
X
XHelp:		Display a message about "Help" screens.
X
XExit:		Return to the main COMMAND mode screen.
X
Xtst.hlp < 6
X
XTERMIO
X
X	The data struct termio(7) is displayed in columnar form.  The
Xparameters shown in Upper Case letters are set to '1' while those
Xdisplayed in Lower Case are set to '0'.  Highlighted parameters may be
Xtoggled On/Off by the 'Mark' key.
X
X	When an item in the 'c_cc[NCC]' column is toggled, the cursor
Xmoves into the column where the characters are displayed.  Data may be
Xentered using most conventional means.  This includes the ^x notation,
Xoctal, decimal or hexadecimal value or the ASCII abreviation such as
X'ESC'.  A 'Return' is required to mark the end of the entry.
X
X	The values displayed are written to the active termio(7) data
Xstructure when this mode is exited by either the 'Exit' key or the
X'RETURN' ( F7 ) key.
X
XActive Keys:
X
XHelp:
XCommand:	Display this help screen.
X
XDown Arrow:	Move the highlighted area down one line.
X
XUp Arrow:	Move the highlighted area up one line.
X
XPrev:
XLeft Arrow:	Move the highlighted area on column to the left.
X
XNext:
XRight Arrow:	Move highlighted area one column to the right.
X
XMark:		Toggle the highlighted parameter.
X
XRefresh:	Refresh the screen.
X
XOLD I/O:
XF1:		Display the data structure termio(7) which was in use
X		when 'tstmodem' was started.  Note that the display
X		which is active upon leaving TERMIO becomes the active
X		NEW I/O.
X
XNEW I/O:
XF2:		Redisplay the data structure in use before entering
X		TERMIO.
X
XRETURN:
XF7:		Return to the whatever mode you were using before
X		entering TERMIO.
X
Xtst.hlp < 7
X
XMODEM
X
X	This mode provides and interactive media for reading and changing
Xthe various control registers in a Telenit Trailblazer.  Regisaters are
Xselected by moving the highlighted area around the screen with the 'Up',
X'Down', 'Right' and 'Left' Arrow keys.  As each register is selected,
Xa summarary of it's function is displayed in a 'prompt area' of the screen.
X
X	The value of the highlighted register may be changed by entering
Xany numeric value from the keyboard.  The 'Up', 'Down', 'Enter' or 'Save'
Xkeys will queque the data for a later SEND comand and return you to the
Xnormal mode.  The 'Exit' or 'Cancl' keys will return you to the normal
Xmode without saving any changes.  The 'Left Arrow' or 'Right Arrow' keys
Xwill position the cursor within the numeric area of the register display.
XThree digits are normally required to change the value of a register.
X
X	When a reverse video 'Opts' box is displayed in the lower right
Xcorner of the prompt area of the screen, the prompt message may be
Xscrolled up and down after pressing the "Opts" or <Shift> "Page" key.
XA reverse vodeo 'MORE' will appear in the upper right corner of the prompt
Xarea to remind you that additional information is above that which is
Xbeing displayed.  Leave the scroll prompt mode with any one of "Opts",
X<Shift> "Page", "Left Arrow", "Right Arrow", or "Exit".
X
XREAD:
XF1:		Issue the 'ATN?' command to the modem then display
X		the full set of registers.
X
XSEND:
XF2:		Send all quequed changes to the modem.  You will be
X		informed of what changes are to be sent in a reverse
X		video display.  You can cancel the 'send' action by
X		pressing the "Cancl" key.  The change will be
X		accomplished by pressing the "Enter" or "F2" key.
X		"Cancl" will return to the main screen without send-
X		the changes to the modem.
X
XWRITE:
XF3:		Write the volatile memory to the EEPROM.  You must
X		press the "Enter" or "F3" in response to the highlighted
X		cautionary message.  "Cancl" will return you to the main
X		screen without issueing the write command to the modem.
X
XEEPROM:
XF4:		Read the EEPROM to the volatile memory and display the
X		results.
X
XFACTORY:
XF5:		Read the factory default settings to the volatile memory
X		and display the results.
X
XF6:		Not programmed.
X
XTERMIO:
XF7:		Go to the TERMIO mode of 'tstmodem'.
X
XRETURN:
XF8:		Return to COMMAND mode.  The same as the 'Exit' key.
X
XShift Page:
XOpts:		Scroll prompts
X
XHelp:
XCommand: 	Display this help screen.
X
XLeft Arrow: 	Move highlighted area on column to the left.
X
XUp Arrow: 	Move highlighted area up one line.
X
XRight Arrow: 	Move highlighted area one register to the right.
X
XDown Arrow: 	Move highlighted area down one line.
X
XExit:		Return the COMMAND mode.
X
Xtst.hlp < 8
X
XScroll prompts:
X
XInterpretation of display:
X
XS11 Touch Tone Timing. ( msec ) 		( 50-255 ) [ 70 ]
X^^^
XRegister Number
X
XS11 Touch Tone Timing. ( msec ) 		( 50-255 ) [ 70 ]
X    ^^^^^^^^^^^^^^^^^
X    Register Name
X
XS11 Touch Tone Timing. ( msec ) 		( 50-255 ) [ 70 ]
X			 ^^^^
X			units
X
XS11 Touch Tone Timing. ( msec ) 		( 50-255 ) [ 70 ]
X						  ^^^^^^
X						  range
X
XS11 Touch Tone Timing. ( msec ) 		( 50-255 ) [ 70 ]
X							     ^^
X							factory default
X
XActive Keys:
X
XUp Arrow:	Scroll the prompt message one line toward the beginning
X		of the message.
X
XDown Arrow:	Scroll the prompt message one line toward the end of the
X		meassage.
X
XOpts:
XExit:
XLeft Arrow:
XRight Arrow:
X<Shift> Page:	Return to the main display.
X
XNote:	A reverse video word 'MORE' appearing at the upper or lower
X	right hand corner of the prompt display area indicates that
X	additional information is in the message in the direction
X	indicated by the the position of "MORE".
X
Xtst.hlp < 9
X
XTo change data:
X
XAny Numeric Key:
X'P', 'p':
X'T', 't':	When any numeric key ( '1' to '0' ) or 'T' or 'P' is pressed,
X		the working area is reduced to the numeric portion of the
X		highlighted area.  Leading 'zeros' must be entered to change
X		the value of a register.
X
XLeft Arrow:	Move the cursor one space to the left in the numeric area.
X
XRight Arrow:	Move the cursor on space to the right in the numeric area.
X
XUp Arrow:
XDown Arrow:
XEnter:
XSave:		Queque the data for a later SEND command, then return
X		to the normal mode.
X
XExit:
XCancl:		Return to the normal mode without saving any changes.
X
Xtst.hlp < 10
X
XSEND
X
X	All changes entered since the last READ command are displayed near
X	the bottom of the screen for review.  If any inaccuraies appear:
X
XCancl:		Return to the main display  and reenter the correct settings.
X
XEnter:		The entries display are sent to the volitile memory of the
XF2:		modem and the fresh settings of the modems registers is
X		read and displayed.
X
Xtst.hlp < 11
X
XQUERY
X
X	A warning message is displayed concerning the life expectancy of
X	an EEPROM.
X
XCancl:		Abort the write to the modems EEPROM.
X
XEnter:		Continue with the write sequence.
XF2:
X
Xtst.hlp < 12
END_OF_help.txt
if test 15315 -ne `wc -c <help.txt`; then
    echo shar: \"help.txt\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f tstmodem.2.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"tstmodem.2.c\"
else
echo shar: Extracting \"tstmodem.2.c\" \(13091 characters\)
sed "s/^X//" >tstmodem.2.c <<'END_OF_tstmodem.2.c'
X/* Version 1.0		Aug 21, 1989 */
X
X/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
X *									 *
X *		Copyright (c) Aug 21, 1989 by Vernon C. Hoxie		 *
X *									 *
X *	This source code may be freely distributed as long as this	 *
X *	copyright notice is included.  No monetary charges should	 *
X *	be made in excess of the cost of copying and distribution.	 *
X *									 *
X *	Any profits which might be derived from the sale of this	 *
X *	work must be shared with me.  Other monetary contributions	 *
X *	will be gratefully accepted.					 *
X *									 *
X *		Vernon C. Hoxie						 *
X *									 *
X * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
X
X/* This section displays the termio options in a form and permits */
X/* them to be changed by operating the 'mark' key */
X
X#include "tstmodem.h"
X
XWINDOW *w2;
XWINDOW *p2;
X
Xextern char *load_prompts();
Xextern do_err();
Xextern logit();
X
Xstruct termio *ptio;
X
Xchar *pbuf, *pptr[100];
X/* array for pointers to strings to be displayed at bottom of screen.
X * These strings are loaded from the file "termio.strgs" during the
X * "load_prompts" routine.
X *  CAUTION: the "termio.strgs" file has inbedded NUL characters which
X *  are normally not displayed with many editors.
X *  To modify "termio.strgs", see "stgfilter.c" */
X
Xstatic int oldcol = 0, oldcurs = 0;
Xint col, curs, mrk, suppress; /* global variables */
X
X/* Strings for display in the main body of the screen */
Xstatic char *param[] = {"ignbrk", "brkint", "ignpar", "parmrk", "inpck",
X	"istrip", "inclr", "igncr", "icrnl", "iuclc", "ixon", "ixany",
X	"ixoff", "opost", "olcuc", "onlcr", "ocrnl", "onocr", "onlret",
X	"ofill", "ofdel", "nldly", "crdly", "tabdly", "bsdly", "vtdly",
X	"ffdly", "b19200", "csize", "cstopb", "cread", "parenb", "parodd",
X	"hupcl", "clocal", "ctscd", "hdx", "isig", "icannon", "xcase",
X	"echo", "echoe", "echok", "echonl", "noflsh", "","intr", "quit",
X	"erase", "kill", "eof", "eol", "min", "time"};
Xstatic char *control[] = {"nul", "soh", "stx", "etx", "eot", "enq",
X	"ack", "bel", "bs", "ht", "lf", "vt", "ff", "cr", "so", "si",
X	"dle", "dc1", "dc2", "dc3", "dc4", "nak", "syn", "etb", "can",
X	"em", "sub", "esc", "fs", "gs",	"rs", "us", "sp"};
Xstatic char *sub1[] = {"CR0", "CR1", "CR2", "CR3",
X			"TAB0", "TAB1", "TAB2", "TAB3"};
Xstatic char *sub2[] = {"B0", "B50", "B75", "B110", "B134",
X	"B150",	"B200", "B300", "B600", "B1200", "B1800",
X	"B2400", "B4800", "B9600", "B19200", "EXTB",
X	"CS5", "CS6", "CS7","CS8" };
X
Xvoid show_item();		/* display one entry on main screen */
Xvoid full_screen();		/* cycle thru all ontions */
Xvoid flip_it();			/* change nature of selected parameter */
Xint mask_it();			/* set masking bits */
Xvoid binary();			/* a routine to display binarys */
Xunsigned short convert();	/* convert input c_cc values */
X
X/* return the number of lines in current column */
X
Xint last( col )
Xint col;
X{
X	switch ( col )
X	{
X		case 0: return( 12 );
X		case 1: return( 13 );
X		case 2: return( 9 );
X		case 3: return( 7 );
X		case 4: return( 0 );
X		case 5: return( 7 );
X	}
X	return( 0 );
X}	/* last */
X
X/* The main selector window for TERMIO mode. */
X
Xvoid main_part()
X
X{
X	chtype mch;
X	mch = KEY_REFRESH;		/* cause a refresh */
X	col = oldcol;
X	curs = oldcurs;
X	labels( w2, 1 );
X	noecho();
X	do
X	{
X		switch ( mch )
X		{
X			case KEY_F(1): ptio = &oldgetty;
X				       full_screen();
X				       break;
X			case KEY_F(2): ptio = &newgetty;
X				       full_screen();
X				       break;
X			case KEY_F(6):
X			case KEY_F(7):
X			case KEY_F(8): break;
X			case KEY_HELP:
X			case KEY_COMMAND: sho_help( 7 );
X					  touchwin( w2 );
X					  break;
X			case KEY_DOWN:
X				curs++;
X				break;
X			case KEY_UP  :
X				curs <= 0?
X					curs = 0:
X					curs -= 1;
X				break;
X			case KEY_PREVIOUS:
X			case KEY_LEFT:
X				col <= 0?
X					col = 0:
X					col -= 1;
X				break;
X			case KEY_NEXT:
X			case KEY_RIGHT:
X				col >= 5?
X					col = 5:
X					col += 1;
X				break;
X			case KEY_MARK :
X				mrk += 1;
X				break;
X			case KEY_REFRESH:
X				full_screen();
X				break;
X			default:
X				if (! ERR ) beep(); break;
X		}
X		if ( curs >= last( col ))
X			curs = last( col );
X		if ( col != oldcol || curs != oldcurs )
X		{	/* clear old highlights */
X			suppress = 1; /* don't flip or reverse video */
X			show_item( oldcurs, oldcol );
X			suppress = 0;
X			oldcol = col;
X			oldcurs = curs;
X		}
X		if ( mrk )
X		{
X			flip_it( curs, col );
X			mrk = 0;
X		}	/* if (mark != 0) */
X		show_item( curs, col );
X		wnoutrefresh( p2 );
X		wnoutrefresh( w2 );
X		doupdate();
X		mch = wgetch( w2 );
X	} while ( mch != KEY_F(7) && mch != KEY_EXIT );
X	return;
X}	/* main_part */
X
X/* Rewrite the full screen after changes have been made. */
X
Xvoid full_screen()
X{
X	suppress = 1;
X	werase( w2 );
X	labels( w2, 1 );
X 	for ( col = 0; col < 6; col++ )
X 	  	for( curs = 0; curs <= last( col ); curs++ )
X		{
X			if ( col < 4) flip_it( curs, col );
X			show_item( curs, col );
X		}
X	curs = oldcurs;
X	col = oldcol;
X	mvwprintw( w2, 0, 0,
X"Use arrow keys to select variable, then <mark> to change it.");
X	mvwprintw( w2, 3, 0, "c_iflag" );
X	mvwprintw( w2, 3, 10, "c_oflag" );
X	mvwprintw( w2, 3, 20, "c_cflag" );
X	mvwprintw( w2, 3, 30, "c_lflag" );
X	mvwprintw( w2, 3, 40, "c_line" );
X	mvwprintw( w2, 3, 50, "c_cc[NCC]" );
X	suppress = 0;
X}	/* full_screen */
X
X/* This routine performs the new data input operations */
X
Xvoid flip_it( curs, col )
Xint curs, col;
X
X{
X	int j, temp, mask, num, pick;
X	unsigned short code;
X	unsigned short strg[10];
X	switch ( col )			/* set num and read flags */
X			/* num is the index to the *params[] array */
X	{
X		case 0: num = curs;
X			code = ptio->c_iflag; break;
X		case 1: num = 13 + curs;
X			code = ptio->c_oflag; break;
X		case 2: num = 27 + curs;
X			code = ptio->c_cflag; break;
X		case 3: num = 37 + curs;
X			code = ptio->c_lflag; break;
X/* unix-pc doesn't have line disipline options so no input here */
X		case 4: return;
X/* case 5 performs the changes to the c_cc[] characters */
X		case 5:	mvwprintw( w2, 1, 0, "Enter value, <cr>." );
X			wclrtoeol( w2 );
X			wrefresh( w2 );
X			for ( j = 0; j < 10; strg[j++] = 0 );
X			j = 0;
X			echo();
X			nocbreak();
X			wmove( w2, curs+5, 60 );
X			wclrtoeol( w2 );
X			do
X			{
X				code = wgetch( w2 );
X				if ( code == '\n' )
X				{
X					if ( j == 0 ) strg[j++] = code;
X					strg[ j ] = 0;
X					break;
X				}
X				else strg[ j++ ] = code;
X			} while ( j < 10 );
X			ptio->c_cc[ curs ] = convert( strg, curs );
X			wmove( w2, 1, 0 );
X			wclrtoeol( w2 );
X			halfdelay( 1 );
X			noecho();
X			return;
X	}				/* end of switch (col) */
X	pick = mask_it( curs, col );
X	switch ( num )
X	{
X		case 22: mask = 003000; break;
X		case 23: mask = 014000; break;
X		case 27: mask = 000017; break;
X		case 28: mask = 000060; break;
X		default: mask = pick; break;
X	}
X	temp = ( code & mask );		/* save pertinent bits */
X	if ( !suppress )	/* don't toggle when initilizing */
X	{
X		code = ( code & ~mask );/* remove pertinent bits */
X		temp = temp + pick;	/* increment  */
X		temp = temp & mask;	/* clip off carry bit */
X		code = temp | code;	/* put correction back in */
X		switch (col)
X		{
X			case 0: ptio->c_iflag = code; break;
X			case 1: ptio->c_oflag = code; break;
X			case 2: ptio->c_cflag = code; break;
X			case 3: ptio->c_lflag = code; break;
X			case 4: ptio->c_line  = code; break;
X			case 5: break;
X		}
X	}				/* end of !suppress */
X	switch ( num )
X	{
X		case 22: mask = temp >> 9;
X			 param[ 22 ] = sub1[ mask ];
X			 break;
X		case 23: mask = temp >> 11;
X			 param[ 23 ] = sub1[ mask + 4 ];
X			 break;
X		case 27: param[ 27 ] = sub2[ temp ];
X			 break;
X		case 28: mask = temp >> 4;
X			 param[ 28 ] = sub2[ mask + 16 ];
X			 break;
X	}
X}	/* flip_it */
X
X/* This routine performs the various conversions required for c_cc[] */
X/* It allows a variety of entry styles e.g. ascii(NUL), cntl(^@)
X   octal(0nn), hex(0xnn) or decimal(nnn) */
X
Xunsigned short convert( strg, curs )
Xunsigned short strg[ 10 ];
Xint curs;
X
X{
X	int i, j, scale;
X	char hold[ 10 ];
X	for ( i = 0; i < 10; i++ )
X		strg[ i ] = 0x7f & strg[ i ];	/* strip attributes */
X	if (strg[ 0 ] < ' ')			/* do control chars */
X	{
X		if (strg[ 0 ] == 27 && strg[ 1 ] == 'P')
X		{			/* unix-pc numeric row */
X			switch (strg[ 2 ])
X			{
X			case 'b': return( 0 );		/* ^@ */
X			case 'f': return( 30 ); 	/* ^^ */
X			case 'k': return( 31 ); 	/* ^_ */
X			}
X		}
X		return( strg[ 0 ]); 	/* control chars entered */
X	}
X	if ( isgraph( strg[ 0 ]) && strg[ 1 ] == '\0' && curs < 6)
X		return( strg[ 0 ]);
X	if ( isalpha( strg[ 0 ]))	/* control mneumonics */
X	{
X		for ( i = 0; i < 10; i++ )
X			hold[ i ] = tolower( strg[ i ]);
X		if ( strcmp( hold,"del" ) == 0) return( 127 );
X		for ( i = 0; i <= 32; i++ )
X			if ( strcmp( hold, control[ i ]) == 0 )
X					return( i );
X		return( 0 );
X	} 
X	j = 0;
X	if ( strg[ 0 ] == '^' )	/* alternate control chars */
X	{
X		if ( strg[ 1 ] == '~' ) return( 30 );
X		if ( strg[ 1 ] == '?' ) return( 127 );
X		if ( strg[ 1 ] > 95 ) strg[ 1 ] = strg[ 1 ] - 32;
X		if ( strg[ 1 ] > 63 ) return( strg[ 1 ] - 64 );
X		j++;
X	}
X	if ( strg[ j ] != '0' ) scale = 10; /* scale factor to decimal */
X	else			 /* set scale factor to octal or hex */
X	{
X		j++;
X		if ( strg[ j ] == 'x' || strg[ j ] == 'X') 
X		{
X			j++;
X			scale = 16;
X		}
X		else scale = 8;
X	}
X	i = 0;
X	while ( j < 10 && ( strg[ j ] != '\0' )) /* form integer values */
X	{
X		if ( isdigit( strg[ j ]))
X		{
X			i *= scale;
X			i +=( strg[ j ] & 0x0f );
X		}
X		else if ( isxdigit( strg[ j ]))
X		{
X			i *= 16;
X			i += ( strg[ j ] - 55);
X		}
X		j++;
X	}
X	if ( curs < 6 ) i = ( i & 0x7f );   /* lock to char */
X	else if ( i > 0xff ) i = 0xff;	/* lock to max unsigned char */
X	return( i );
X}	/* convert() */
X
X/* Generate mask for the bits under scrutiny */
X
Xint mask_it( curs, col )
Xint curs, col;
X
X{
X	int pick, mask;
X	pick = curs;
X	if ( col == 1 )
X	{
X		if ( curs > 9 ) pick++;
X		if ( curs > 10 ) pick++;
X	}
X	else if ( col == 2 )
X	{
X		if ( curs > 0 ) pick += 3;
X		if ( curs > 1 ) pick++;
X	}
X	mask = ( 1 << pick );
X	return( mask );
X}	/* mask_it */
X
X/* Write the information at the bottom of the screen */
X/* This uses the strings in file "termio.strgs" */
X
Xvoid doinfo( num )
Xint num;
X
X{
X	char *wptr;
X	wmove( p2, 0, 0 );
X	for ( wptr = pptr[ num ]; *wptr != 0; *wptr++ )
X		waddch( p2, *wptr );
X}	/* doinfo */
X
Xvoid show_cntrl( xch )
Xunsigned short xch;
X{
X	if ( xch == 127 )
X	{
X		wprintw( w2, "del" );
X		return;
X	}
X	switch ( xch )
X	{	/* these four characters don't print in curses */
X		case 8:
X		case 9:
X		case 10:
X		case 13: wprintw( w2, "%s", control[ xch & 0x3f ]);
X			 return;
X		default: waddch( w2, xch );
X	}
X}	/* show_cntrl */
X
X/* write the mneumonic for the bits under scrutiny */
X
Xvoid show_item( curs, col )
Xint curs, col;
X
X{
X	int code, num, mask, here, column;
X	int j;
X	unsigned short ich;
X	char *cptr;
X	switch ( col )
X	{
X		case 0: num = curs;
X			column = 0;
X			code = ptio->c_iflag;
X			break;
X		case 1: num = 13 + curs;
X			column = 10;
X			code = ptio->c_oflag;
X			break;
X		case 2: num = 27 + curs;
X			column = 20;
X			code = ptio->c_cflag;
X			break;
X		case 3: num = 37 + curs;
X			column = 30;
X			code = ptio->c_lflag;
X			break;
X		case 4: num = 45;
X			column = 40;
X			if ( !suppress ) wattron( w2, A_REVERSE );
X			mvwprintw( w2, 5, 40, "0x%x", ptio->c_line );
X			wattroff( w2, A_REVERSE );
X			break;
X		case 5: num = 46 + curs;
X			column = 50;
X			code = 0;
X			wmove( w2, curs + 5, 60 );
X			if ( curs < 6 )	/* print all control chars */
X 				show_cntrl( ptio->c_cc[ curs ]);
X			else
X				wprintw( w2, "%d", ptio->c_cc[ curs ]);
X			wclrtoeol( w2 );
X			break;
X	}
X	mask = mask_it( curs, col );
X	here = mask & code;
X	if ( num == 22 || num == 23 || num == 27 || num == 28 )
X	{		/* overwrite old entry with blanks */
X		wmove( w2, ( curs + 5 ), column );
X		for ( j = 0; j < 7; j++ ) waddch( w2, ' ' );
X	}
X	wmove( w2, ( curs + 5 ), column );
X	cptr = param[ num ];
X	for ( j = 0; j < 7 && ( ich = *cptr ) != 0; cptr++ )
X	{
X		if ( here > 0) ich = toupper( ich );
X		if ( !suppress ) ich = ich | A_REVERSE;
X		waddch( w2, ich );
X	}
X	werase( p2 );
X	if ( !suppress ) doinfo( num );
X}	/* show_item */
X
X/* This routine was used during testing only */
Xvoid binary( wye, ex, num )
Xint ex, wye;
Xunsigned short num;
X{
X	int j;
X	unsigned short i;
X	wmove( w2, wye, 0 );
X	wclrtoeol( w2 );
X	wmove( w2, wye, ex );
X	i = 0x8000;
X	for ( j = 0; j < 16; j++ )
X	{
X		i & num ? waddch( w2, '1' ) : waddch( w2, '0' );
X		i = ( i >> 1 );
X	}
X}
X
X/* This is the initialization routine upon entry into the TERMIO mode. */
X
Xvoid edit_tio()
X
X{
X	char line[ 81 ];
X	char *lptr;
X	char *malbuf;
X	int i, j;
X	w2 = newwin( 0, 0, 0, 0 );	/* set main window */
X	p2 = subwin( w2, 2, 80, 20, 0 );/* set subwindow */
X	keypad( w2, TRUE );
X	malbuf = load_prompts( "termio.strgs", pptr, 100 );
X	ptio = &newgetty;
X	if (( ioctl( tiofd, TCGETA, &newgetty )) == -1)
X	{
X		do_err( "TCGETA" );
X	}
X	else main_part();
X	if ( ioctl( tiofd, TCSETA, &newgetty ) == -1)
X	{
X		do_err( "TCSETA" );
X	}
X	what( 6 );
X	for ( j = 3; j < 19; j++ )
X	{
X		lptr = line;
X		for ( i = 0; i < 78; lptr++, i++ )
X			*lptr = ( mvwinch( w2, j, i ) & 0x7f );
X  		while ( *lptr <= ' ' ) *lptr-- = '\0';
X		*++lptr = '\n';
X		logit( line );
X	}
X	free( malbuf );
X	echo();
X	keypad( w2, FALSE );
X	wclear( w2 );
X	wrefresh( w2 );
X	delwin( p2 );
X	delwin( w2 );
X	return;
X}	/* edit_tio */
END_OF_tstmodem.2.c
if test 13091 -ne `wc -c <tstmodem.2.c`; then
    echo shar: \"tstmodem.2.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 3 \(of 4\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
-- 
Vernon C. Hoxie		       {ncar,nbires,boulder,isis}!scicom!zebra!vern
3975 W. 29th Ave.					voice: 303-477-1780
Denver, Colo., 80212				  TB+	 uucp: 303-455-2670



More information about the Unix-pc.sources mailing list