


TNC2 @DK0MWX     de:DK9AH  25.06.91 00:27   0   5972 Bytes
Hostmode.Doc 3/3: Hostmode Operation
*** Bulletin-ID: 182106DK0MAV ***

910218/0120z DB0EAM, 910218/0054z DB0KG , 910218/0039z DK0MAV
de DK9AH @ DK0MAV


                          HOST MODE OPERATION
                          ===================


        Host mode is intended to provide a user  interface  suitable
   for operation under control of a host  processor.   Commands  and
   information to the TNC, as well as status  and  information  from
   the TNC, are clearly identified to allow orderly and  unambiguous
   communication.  To alleviate any need for  hardware  or  software
   handshaking,  the  TNC  will  not  send  to  the  host  processor
   unsolicited,  and  all  exchanges  are  limited  to  256   bytes.
   Information transfers are fully transparent.

        When host mode is enabled, the first byte sent  to  the  TNC
   must be a channel number.  If  information  is  being  sent,  the
   second byte must be a binary 0.  If a command is being sent,  the
   second byte must be a binary 1.   The  third  byte  must  be  the
   binary length of the actual information or  command,  decremented
   by 1 (vacuous information or commands are  not  permitted).   The
   actual  information  or   command   bytes   must   follow   last.
   Information sent to channel 0 will be sent unproto.   Information
   sent to an unconnected channel 1 - 4 will be discarded.  The  TNC
   will respond to both information  and  commands  with  a  channel
   number first, followed by a binary code of 0, 1, or 2, signalling
   success or failure.  Codes of 1 or 2 will be followed by  a  null
   terminated message.  Channels may be  interrogated  for  incoming
   information or link status by using  the  'G'  command.   Monitor
   headers and monitor information will always be sent to channel 0,
   along with connect request link status messages.  All other  link
   status messages will be sent to the  appropriate  channel,  along
   with that channels connected information.  In response to  a  'G'
   command, the TNC  will  respond  with  a  channel  number  first,
   followed by a binary code of 0 if  nothing  is  available,  or  a
   binary code of 3 - 7, identifying the bytes that follow.  A  code
   of  4  indicates  the  monitored  frame  does  not   contain   an
   information field.  A code of 5  indicates  the  monitored  frame
   does contain an information field, and the next  'G'  command  on
   channel 0 will return that information field, preceeded by a code
   of 6.


            Host to Tnc
            -----------

   CHANNEL   CODE           DESCRIPTION
   -------   ----           -----------
      n       0        Information (preceeded by length-1)
      n       1        Command     (preceeded by length-1)


            Tnc to Host
            -----------

   CHANNEL   CODE           DESCRIPTION
   -------   ----           -----------
      n       0        Success (nothing follows)
      n       1        Success (message follows, null terminated)
      n       2        Failure (message follows, null terminated)
      n       3        Link Status (null terminated)
      n       4        Monitor Header (null terminated)
      n       5        Monitor Header (null terminated)
      n       6        Monitor Information (preceeded by length-1)
      n       7        Connect Information (preceeded by length-1)


   Success messages
   ----------------

   {channel status}
   {parameter value}
   CHANNEL NOT CONNECTED


   Failure messages
   ----------------

   INVALID CALLSIGN
   MESSAGE TOO LONG
   INVALID PARAMETER
   INVALID BAUD RATE
   NO SOURCE CALLSIGN
   INVALID COMMAND: ?
   NOT WHILE CONNECTED
   INVALID VALUE: ?????
   NO MESSAGE AVAILABLE
   INVALID CHANNEL NUMBER
   TNC BUSY - LINE IGNORED
   CHANNEL ALREADY CONNECTED
   STATION ALREADY CONNECTED
   INVALID EXTENDED COMMAND: ?


   Link Status messages
   --------------------

   BUSY fm {call} via {digipeaters}
   CONNECTED to {call} via {digipeaters}
   LINK RESET fm {call} via {digipeaters}
   LINK RESET to {call} via {digipeaters}
   DISCONNECTED fm {call} via {digipeaters}
   LINK FAILURE with {call} via {digipeaters}
   CONNECT REQUEST fm {call} via {digipeaters}
   FRAME REJECT fm {call} via {digipeaters} (x y z)
   FRAME REJECT to {call} via {digipeaters} (x y z)

   x y z = FRMR information bytes


   Monitor Header format
   ---------------------

   fm {call} to {call} via {digipeaters} ctl {name} pid {hex}


   Channel Status format
   ---------------------

   a b c d e f

   a = Number of link status messages not yet displayed
   b = Number of receive frames not yet displayed
   c = Number of send frames not yet transmitted
   d = Number of transmitted frames not yet acknowledged
   e = Number of tries on current operation
   f = Link state

       Possible link states are:

        0 = Disconnected
        1 = Link Setup
        2 = Frame Reject
        3 = Disconnect Request
        4 = Information Transfer
        5 = Reject Frame Sent
        6 = Waiting Acknowledgement
        7 = Device Busy
        8 = Remote Device Busy
        9 = Both Devices Busy
       10 = Waiting Acknowledgement and Device Busy
       11 = Waiting Acknowledgement and Remote Busy
       12 = Waiting Acknowledgement and Both Devices Busy
       13 = Reject Frame Sent and Device Busy
       14 = Reject Frame Sent and Remote Busy
       15 = Reject Frame Sent and Both Devices Busy

   NOTE 1:  Only items a and b are displayed for channel 0.
   NOTE 2:  Only states 0 - 4 are possible if version 1 is in use.




(TNC2) DD9EP de DK0MWX>c < host
