home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 3 / hamradioversion3.0examsandprograms1992.iso / bbs / bpq402a / bpqhost.doc < prev    next >
Text File  |  1990-12-22  |  4KB  |  152 lines

  1.             G8BPQ Host Mode
  2.  
  3. From Version 4.00, a new application interface to the switch will be provided.
  4. This will replace the existing interfaces (TNC2, PK Host and KISS). New
  5. software should if possible use the new interface - interface routines
  6. supporting the old modes, and WA8DED Host mode, will be provided as TSRs
  7. to support existing application software.
  8.  
  9. The interface is called using INT 7Fh. The function required is in AH,
  10. and the stream in AL. The system supports 64 streams, or sessions, numbered
  11. from 1 - 64.
  12.  
  13. ;
  14. ;
  15. ;    COMMANDS SUPPORTED ARE
  16. ;
  17. ;    AH = 1    Set application mask to value in DL.
  18. ;        Set application flags to value in CL.
  19. ;          If top bit of CL is set, monitored frames will be available.
  20. ;          Use function 11 to receive them. 
  21. ;
  22. ;    AH = 2    Send frame in ES:SI (length CX)
  23. ;
  24. ;
  25. ;    AH = 3    Receive frame into buffer at ES:DI, length of frame returned
  26. ;        in CX.  BX returns the number of outstanding frames still to
  27. ;        be received (ie. after this one) or zero if no more frames
  28. ;        (ie. this is last one).
  29. ;
  30. ;
  31. ;
  32. ;    AH = 4    Get stream status.  Returns:
  33. ;
  34. ;        CX = 0 if stream disconnected or CX = 1 if stream connected
  35. ;        DX = 0 if no change of state, or DX = 1 if
  36. ;               the connected/disconnected state has changed.
  37. ;
  38. ;    AH = 5    ACK stream status change.
  39. ;
  40. ;
  41. ;    AH = 6    Session control.
  42. ;
  43. ;        CX = 1 connect to node
  44. ;        CX = 2 disconnect
  45. ;        CX = 3 return user to node
  46. ;
  47. ;
  48. ;    AH = 7    Get buffer counts for stream.  Returns:
  49. ;
  50. ;        BX = number of frames queued for receive
  51. ;        CX = number of un-acked frames to be sent
  52. ;        DX = number of buffers left in node
  53. ;
  54. ;
  55. ;    AH = 8    Port control/information.  Called with a stream number
  56. ;        in AL returns:
  57. ;
  58. ;        ES:DI = CALLSIGN (10 bytes space padded)
  59. ;
  60. ;        The following are not supported by the current version,
  61. ;        but I expect to add them soon.
  62. ;
  63. ;        AX = Radio port on which channel is connected (if level 2)
  64. ;        BX = L2 paclen for the session
  65. ;        CX = L2 maxframe for the radio port (if level 2 session) 
  66. ;        DX = L4 window size (if L4 circuit, or zero)
  67. ;
  68. ;
  69. ;    AH = 10    RAW (KISS) transmit frame.  Data pointed to by ES:SI, of
  70. ;        length CX, is transmitted as a HDLC frame on the radio
  71. ;        port (not stream) in AL.
  72. ;
  73. ;
  74. ;    AH = 11 Get Trace (RAW Data) Frame into ES:DI, Length to CX
  75. ;
  76. ;
  77. ;    The following additions have been proposed. Similar functions may
  78. ;    be provided, but not necessarily in this format.
  79. ;
  80. ;
  81. ;    AH = 0    Get node/switch version number and description.  On return
  82. ;        AH = major version number and AL = minor version number,
  83. ;        and user's buffer pointed to by ES:SI is set to the text
  84. ;        string normally output by the USERS command. CX is set to the
  85. ;        length of the text string.
  86. ;
  87. ;
  88. ;    AH = 9    Fetch node/application callsign & alias or application names
  89. ;
  90. ;        AL = application
  91. ;        BL = 0 to get Callsign, 1 to get Application Name
  92. ;
  93. ;        number:
  94. ;
  95. ;        0 = node
  96. ;        1 = BBS
  97. ;        2 = HOST
  98. ;        3 = SYSOP etc. etc.
  99. ;
  100. ;        Returns string with alias & callsign or application name in
  101. ;        user's buffer pointed to by ES:SI length CX.  For example:
  102. ;
  103. ;        "WORCS:G8TIC"  or "TICPMS:G8TIC-10".
  104. ;
  105. ;
  106.  
  107. The application code should check for the presence of the interface as
  108. follows:
  109.  
  110. ;
  111. ;    THE 7 BYTES PRECEEDING THE INT 7F ENTRY CONTAIN THE STRING
  112. ;    'G8BPQ', FOLLOWED BY THE MAJOR AND MINOR VERSION NUMBERS
  113. ;
  114. G8BPQ        DB    'G8BPQ'
  115.  
  116. INIT:
  117. ;
  118. ;    CHECK SWITCH IS PRESENT, AND GET NODE VERSION
  119. ;
  120.     PUSH    DS
  121.  
  122.     XOR    AX,AX
  123.     MOV    DS,AX
  124.  
  125.     LDS    SI,DS:[1FCH]        ; GET POINTER TO INT 7F CODE
  126.  
  127.     SUB    SI,7
  128.     MOV    DI,OFFSET G8BPQ
  129.     MOV    CX,5
  130.     REP CMPSB            ; MAKE SURE SWITCH IS LOADED
  131.  
  132.     JE    SWITCHOK
  133.  
  134.     POP    DS
  135. ..
  136. ..
  137. ..    SWITCH NOT PRESENT CODE
  138. ..
  139. ..
  140.  
  141. SWITCHOK:
  142.  
  143.     MOV    AL,DS:[SI]
  144.     MOV    MAJORVERSION,AL
  145.  
  146.     MOV    AL,DS:1[SI]
  147.     MOV    MINORVERSION,AL
  148.  
  149.     POP    DS
  150. ..
  151. ..
  152.