                   Smart Driver - Version 1.0
                         By Mel Patrick

           (Documentation for SMARTDVR/CMD & BYE/CMD)


    SMARTDVR is a machine language program for the HAYES
SMARTMODEM to allow any one computer to act as host to
another.  This means that the remote computer may control some
or all of the functions normally invoked by the host computer.

     SMARTDVR resides in the top 2K (2000) characters of
TRS-80 memory.  Any drivers you would normally use should be
below this address (FB00H).  Most drivers will automatically
relocate themselves under himem.  See the section for
installing high memory drivers for use with SMARTDVR.

                    HAYES DIP SWITCH SETTINGS

     In order for SMARTDVR to all of the input and output
(commonly refered to as I/O), it is necessary to configure the
dip swtiches located behind the HAYES front panel.  Refer to
the HAYES manual for information on removal of this front
panel.  Once removed you will notice 8 small dip switches on
the left hand side of the opening.  These should be set
according to the table shown below.

Switch    Position                      Comments
1.........UP........RS232 control DTR line for connection
                    (modem ready).
2.........UP........Verbose ON.  Result codes are sent in
                    English.
3.........DOWN......NON-QUIET.  Result codes are sent to your
                    video screen.
4.........UP........Modem will echo characters while on hook
                    condition.
5.........DOWN......Modem will not auto-answer phone.
6.........UP........Enables carrier detect line to be used.
7.........UP........Single line phone connection.
8.........NOT USED.

     By setting the switches to the configuration shown above
you can control the modem state (on-line vs off-line) with the
RS232 DTR signal line.  DTR (or Data Terminal Ready), is
normally in the ON state, but if you reset it, the modem will
terminate any currect phone connection.  Some DOS systems
automatically enable this DTR line (and reset the RS232) when
they are booted.  Others do not.  A simple check of this is
possible but booting your DOS (from a power down situation)
and observing the TR light on the HAYES front panel.  If this
light is off, your system does not control the DTR line, on;
then it does.  DOSPLUS controls this line on power up, NEWDOS
80 Version 2.0 does not.  Generally by using the DOS command
to read the RS232 status lines will also enable the DTR line.

                    BASIC CONTROL of DTR LINE

     If control of the DTR line is to be done from BASIC this
possible by doing the following from BASIC:

                          OUT (234),109

     This command will turn the DTR line ON, set the word
length, stop bits and parity used for communication.  To
disable (turn off) the DTR line from BASIC use :

                          OUT (234),15

     If you are using a DOS which does not enable the DTR line
(and reset the RS232 when first powered up), you must use the
following line to reset the RS232 and then control of the DTR
line is possible from BASIC:

             OUT (232),1:OUT (234),109:OUT (233),85

               CONTROL BITS / OPERATION / LOCATION

     When using SMARTDVR from BASIC or a machine language
program, there are certain bits in memory which control
certain aspects of the SMARTDVR operation.  These control bit
(or values) are simply numbers which reside in the locations
shown and have the effect on the SMARTDVR as shown.  From
BASIC these locations (and the values they contain) may be
changed with a simple POKE statement.  In machine language a
LD command to that address with the correct value will
accomplish the same thing.

     The following table will show all the addresses in both
decimal and hex as well as the operation and command values
(for ON or OFF).  All control bytes require only 1 byte
(value).

                          Control Table
--------------------------------------------------------------
ADDRESS  HEX   ON   OFF             Comments
--------------------------------------------------------------
     -1  FFFF  SEE DESCRIPTION Loss of carrier operation.
     -2  FFFE  1    0          Line Feeds w/ Carriage Returns.
     -3  FFFD  1    0          Normal or Video Backspace.
     -4  FFFC  1    0          UPPER/Lower case operation.
     -5  FFFB  1    0          MASK echo characters.
     -6  FFFA  1    0          Carrier Detect Byte.
     -7  FFF9  1    0          Hardcopy name to printer.
--------------------------------------------------------------

Control -1

     This byte tells SMARTDVR what to do in the event of a
LOSS of carrier.  This means when the remote system terminates
the connect (unexpectedly), what action should SMARTDVR take.
The control values here are from 0-3 and have the following
effect:

0 - Does a carriage return and continues normal processing.
1 - No carriage return, but continues normal processing.
2 - REBOOT SYSTEM.
3 - Enters DOS READY command mode.

     Normally '0' will be the value most often used.  This is
because of the fact that the program may be in an INPUT
command when the carrier is lost.  The carriage return will
cause the system to continue as though the remote was still
there.  Note if the carrier is lost, the STATUS byte (-6)
will change to zero from a 1.  This address should be checked
both before and after any input commands to ensure the
connection is still active.  If it is not, then you will
choose your course of action.

Control -2

     This value determines whether a line feed is send with
all carriage returns or not.  Some terminals (remotes) require
both a carriage return and a line feed.  If this is the case
set this address value to a 1.  Otherwise leave it at 0.

Control -3

     This value determines whether the backspace will be a
normal CHR$(8) or one which requires a CP/M type of backspace.
The CP/M backspace is normally called a VIDEO BACKSPACE.  This
is somewhat different than a normal TRS-80 one.  The TRS-80
normally uses the CHR$(8).  CP/M requires a backspace, a
space, and then a backspace again.  This moves the cursor back
on their screen and then steps ahead and erases the character
(with the space), then backs up the cursor again.  Normal
backspace value is 0.

Control -4

     This value determines whether the system will allow both
upper and lower case, or will allow only UPPER.  If the remote
sends lower case and this value is a 0 (UPPER CASE ONLY), it
will automatically be converted by SMARTDVR for your system.
A value of 1 will enable reception of both.

Control -5

     This value determines whether the same characters are
send back to the remote as received or a defferent character
is sent back.  An example of where this would be used is
during the password prompt during the sign-on process.  This
ensures that the remote has privacy during the password entry.
Note that the characters will be displayed in their correct
text on the host system, but the remote will receive only '#'
(pound) signs.  A value of 1 will enable the mask, 0 will be
normal.

Control -6

     This value should not be changed by the programmer unless
they are familiar with SMARTDVR operation.  It is only a test
for the program to see if the remote system is still on line.
In otherwords, it is a carrier detect value.  A value of 1
indicates that there is a carrier present.  A value of 0
indicates no carrier.  This is the bit that should be tested
before and after any INPUT commands.

Control -7

     This value determines whether the remote callers name
will be printed on the line printer or just forgotten about.
A value of 1 will indcate the name to be printed on the line
printer.  A value of 0 will ignore any name.

                      CHARACTER TRANSLATION

     SMARTDVR does a certain amount of checking on validity on
the incoming characters.  For example although the <BREAK> key
will work on the HOST computer, it won't work if sent from the
remote.  The only control characters accepted from the remote
system are :

                     BACKSPACE / ENTER / TAB
                         08       13     09

     In addition to the aforementioned codes, there is a
command which may be issued from BASIC will with cause instant
termination of any connection.  A PRINT CHR$(1) will tell the
modem to hangup on the remote.  Normally this would be used
when terminating a call (from remote).

                        REMOVING SMARTDVR

     At some time or other it may be necessary to remove the
SMARTDVR program from memory so that the computer will not be
waiting for call and in use.  If this need arises, simply
press your systems <BREAK> key when at the WAITING FOR
CONNECTION message is on the screen.  Doing this will reset
any vectors used by the SMARTDVR program, reset memory size,
and return to the DOS READY mode.  It will also reset the
HAYES SMARTMODEM so that it will not answer any incoming
calls.

                       INSTALLING SMARTDVR

     Installing SMARTDVR is very simple.  Ensure that no high
memory drivers are used.  Type in:

                        SMARTDVR <ENTER>

     SMARTDVR will take over all input and output control of
the computer and wait for a caller.  When a call comes
through, they will be asked for their name, and a password to
access your system.  Although the name is not used (other than
a optional copy to the line printer), the password is
critical.  The caller has three chances to enter the correct
password.  If they fail doing this, the connection will be
terminated.  After which the program will automatically
recycle for the next caller.

     Providing the caller does know the correct password, they
will be informed that they are entering the DOS READY mode.
From there they may do what ever they want with the host from
their remote system.

                       HIGH MEMORY DRIVERS

     If high memory drivers are to be used with SMARTDVR,
first ensure that they are not loaded in when you boot (power
up) the DOS.  Normal procedure for installing SMARTDVR with
drivers is:

1. BOOT SYSTEM (no drivers in memory for now).
2. SET HIGH MEMORY = FB00H
3. INITIALIZE ANY DRIVERS (they will relocate under the high
   mem address).
4. SMARTDVR <ENTER>

                    TERMINATION USING BYE/CMD

     As an additional program, BYE/CMD will automatically
terminate the connection and recycle in SMARTDVR with the
sign-on process again.  This will permit a remote system to
log-on to your HOST, enter to DOS mode, do whatever was the
intention of signing on, and type in BYE to exit and recycle
for the next caller.  Since BYE is a machine language program,
it should be executed from the DOS READY mode.

                   USING XMODEM WITH SMARTDVR

     XMODEM is a file transfer utility which handles error
checking file transfer between a remote and the host systems.
If a block (128 bytes) is received incorrectly, XMODEM will
automatically re-transmit it.  XMODEM has been tested with
SMARTDVR and works perfectly.  In addition XMODEM has been
tested with the OMNITERM 1.6 version of file transfer.  Again
it works perfectly.

     To use XMODEM, first ensure that it is available on one
of the host drives.  From this point there are two commands
available to the remote user.  They may elect to either send
or receive a file.  The command structure is shown below :

XMODEM S filespec[:d]    (will send from HOST to remote;
                         filespec)
XMODEM R filespec[:d]    (will receive a file from remote
                         and store it)

     Only one other TRS-80 terminal program offers the XMODEM
protocol and that is MODEM80 (or sometimes called M80).  This
program was available from THE ALTERNATE SOURCE.
