home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / GIFDEV.ZIP / CISGIFON.TXT < prev    next >
Text File  |  1989-02-10  |  16KB  |  380 lines

  1. NOTE: All references in this document to "B protocol" signify the com-
  2. plete original B protocol including the transport layer for dynamic error
  3. checking of the complete data stream.  Where the document references only
  4. the B protocol file transfer facility, or the specification differs from
  5. the current "Quick B" and "Full B Plus" implementations, I have added
  6. notations to the specific differences.  Where such references occur, [B]
  7. denotes the original B protocol, [QB] denotes the "Quick B" version (a
  8. subset of full B Plus), and [B+] denotes the complete "B Plus" implemen-
  9. tation.  For broader clarity, I have replaced hexidecimal representations
  10. of ASCII printable characters with their printing versions surrounded
  11. by double-quote marks.  Original document provided to me courtesy of Brion
  12. Jones, CompuServe Inc.           Steve Sneed  71520,77  10/11/88
  13.  
  14. This document was originally put in machine-readable form for a BPlus
  15. protocol developer friend.  I have added additional comments in this
  16. release for those wanting to implement online GIF decoders.  S.S.  11/10/88
  17.  
  18.         -------------------------------------------------------
  19.  
  20.  
  21.                             Interrogation
  22.  
  23. 1.1  Interrogation
  24.  
  25. Before protocol activity can occur between a host computer and a remote
  26. computer an interrogation process must be performed.  The host computer
  27. must determine that the remote computer is running a communications pro-
  28. gram which supports B protocol.  Otherwise communications will be incom-
  29. patable.
  30.  
  31.  
  32. 1.2  The Interrogation Procedure
  33.  
  34. The CompuServe interrogation procedure is used to determine whether a remote
  35. computer is running VIDTEX or another communications program.
  36.  
  37. The first step to the interrogation process is an automatic terminal recog-
  38. nition.  The CompuServe host computer first transmits an Enquiry Control
  39. Sequence to the remote computer.  The remote computer must reply with a
  40. correct enquiry response for host synchronization to occur.  This will
  41. contain the current B protocol packet number if the remote computer is
  42. running VIDTEX.  Otherwise further investigation will stop.
  43.  
  44. If the remote computer is not running VIDTEX, the current communications
  45. program may or may not support B protocol.  Software that does not support
  46. B protocol may substitute the following response:
  47.  
  48.    <DLE>"0"               [B]
  49.    <DLE>"+"<DLE>"0"       [QB]
  50.    <DLE>"+""+"<DLE>"0"    [B+]
  51.  
  52. If a valid packet number (or the above "generic" response) is received, the
  53. host computer continues its interrogation sequence:
  54.  
  55.    <ESC>"I"
  56.  
  57. The remote computer responds to an interrogation sequence with an interrogate
  58. response sequence.
  59.  
  60.  
  61. 1.3  The Interrogate Response Sequence
  62.  
  63. The interrogate response sequence describes the features supported by the
  64. remote computer, and can be used to satisfy interrogation requirements
  65. when the communications program supports B protocol, but is not VIDTEX.
  66.  
  67.  
  68. Syntax:
  69.  
  70.    "#"<Mod><Ver><F_Codes><CR>                       [B]
  71.    "#"<Mod><Ver><F_Codes><"+"><Check_Value><CR>     [QB][B+]
  72.  
  73. Sequence Information
  74.  
  75.    The value of <Mod> is one of the following three-character ASCII codes
  76.    used to describe the computer:
  77.  
  78.       AP1  Apple I
  79.       AP2  Apple II
  80.       AP3  Apple III
  81.       APX  Apple Macintosh/Lisa/MacII
  82.       AT8  Atari 400/800
  83.       ATX  Atari 8/16/32-bit
  84.       CC1  Commodore 4032
  85.       CC2  Commodore VIC-20
  86.       CC3  Commodore 64
  87.       CC4  Commodore 8032
  88.       CCX  Commodore C64 and Amiga 500/1000/2000
  89.       CPM  CP/M system
  90.       EH1  Electrohome
  91.       EH2  Electrohome 699
  92.       EH3  Electrohome 709
  93.       IB1  IBM PC
  94.       IB2  IBM PCjr
  95.       IBX  IBM compatable
  96.       RC1  RCA VP-3301
  97.       RS1  TRS-80 Model I (level I)
  98.       RS2  TRS-80 Model I (Level II)
  99.       RS3  TRS-80 Model II
  100.       RS4  TRS-80 Videotex
  101.       RS5  TRS-80 Color Computer
  102.       RS6  TRS-80 Model III
  103.       RS7  TRS-80 Model 12
  104.       RS8  TRS-80 Model 16
  105.       RS9  TRS-80 Model 100
  106.       RSA  TRS-80 Model 4
  107.       RSB  TRS-80 MC-10
  108.       RSC  TRS-80 CoCo II
  109.       RSD  Tandy 2000
  110.       RSE  TRS-80 CoCo III
  111.       RST  Radio Shack, not IBM or CoCo compatable
  112.       RSO  TRS-80 CoCo (other)
  113.       OT1  Bryan Egger's OrcTerm
  114.       OZ1  Steve Sneed's OZBEXT
  115.       TT1  Chris Dunford's Triple Talk
  116.       PCN  Professional Connection
  117.       CM1  McGuinness COMSH
  118.       DTE  Wilhite Dumb Terminal
  119.       HST  Wilhite Host
  120.       NAV  CompuServe Navigator for Macintosh
  121.       XXX  Other model/type (may also be used in place of above choices.)
  122.  
  123.    The value of <Ver> is the current ASCII software version.  This is up to
  124.    the developer, and can be up to ten of the following characters, concluded
  125.    with a comma:
  126.  
  127.      Letters
  128.      Digits
  129.      Period
  130.  
  131.  
  132.    Each <F_Code> value is a two character ASCII code used to describe a
  133.    function.  When more than one code is supplied they must be separated
  134.    by a comma.  The following values are supported:
  135.  
  136.       Cursor/Screen Control
  137.  
  138.          AC     ANSI Color  (not cursor)
  139.          CA     ANSI Cursor (ANSI/VT100 cursor control)
  140.                              (See note 1 at end of document. S.S.)
  141.  
  142.          CC     VIDTEX/VT52 Cursor control  (See note 2.  S.S.)
  143.          CW     "Wide Mode"                 (See note 3.  S.S.)
  144.          SSyx   Screen Size                 (See note 4.  S.S.)
  145.  
  146.  
  147.       Graphics support
  148.  
  149.          GF     GIF graphics
  150.          GH     RLE high-resolution mode graphics
  151.          GM     RLE medium-resolution mode graphics
  152.          NA     NAPLPS
  153.          NF     NAPLPS full
  154.  
  155.  
  156.       Protocols     (See note 5.  S.S.)
  157.  
  158.          AP     Application protocol
  159.          CB     Capture buffer
  160.          DT     B protocol disk transfer
  161.          PB     B protocol
  162.          PX     XMODEM protocol
  163.          PZ     ZMODEM protocol
  164.  
  165.  
  166.       Miscellanious
  167.  
  168.          HC     Hard copy (support for printer)
  169.          XX     Empty fields, ignored  (optional)
  170.  
  171.    All other two-character codes are reserved.   The empty fields (XX) code
  172.    is allowed so that a string can adopt a fixed length.  This allows for
  173.    future versions which might support additional features.
  174.  
  175.  
  176.    The value of <Check_Value> is the simple addition of characters as they are
  177.    transmitted, with ZERO being the initial value.  The check value is masked
  178.    down to a 16 bit value before conversion and does NOT include itself (See
  179.    note 6.  S.S.):
  180.  
  181.       1.  Check value = 0
  182.       2.  For i = 1 to n
  183.               begin
  184.               transmit response character [i]
  185.               check value = check value + ord (response character [i])
  186.               end
  187.           (NOTE: the response string includes the trailing ",+")
  188.       3.  check value = check value AND 0xFFFF
  189.       4.  Transmit check value as ASCII decimal value char string
  190.       5.  Transmit <CR>
  191.  
  192.    For example, a response string of "#IBM,CC,GH,GM,PB,+" would have a
  193.    <Check_Value) of 1085 and would be transmitted as:
  194.  
  195.       #IBM,CC,GH,GM,PB,+1085<CR>
  196.  
  197.    An interrogation Response Sequence must be less than 80 characters in
  198.    total length, including checkvalue digits.
  199.  
  200.         ---------------------------------------------------------
  201.  
  202.  
  203. NOTES:
  204.  
  205.   1.  Both DOS ANSI and the DEC VT100 emulation sets are improper and unequal
  206.       subsets of the complete ANSI X3.64 terminal control code standards.
  207.       CIS uses the DEC VT100 commands.  Due to inconsistancies in the various
  208.       "<ESC>[?J" clear part/all screen commands in the two emulations, you
  209.       cannot do all screen writes unfiltered via ANSI.SYS on a DOS system;
  210.       doing so will cause screen clears after menus are displayed but before
  211.       the final menu prompt is displayed (anoying!)  The specific ANSI "J"
  212.       commands should be mapped as follows:
  213.  
  214.       <ESC>[J or <ESC>[0J    Clear from cursor position to end of screen
  215.       <ESC>[1J               Clear from "Home" position thru cursor position
  216.       <ESC>[2J               Clear entire screen, "Home" cursor.
  217.  
  218.       The default numeric parameter for the "assumed" J command ( <ESC>[J )
  219.       under VT100 is "0", while under most versions of the DOS ANSI.SYS
  220.       driver it is "2" - hence the confusion.  Sigh...
  221.  
  222.       CIS uses 3 "private" ANSI commands, for GIF image data processing/
  223.       control.  These are:
  224.  
  225.       <ESC>[>0g   GIF support interrogation  (See the GIF 87a or 88h docs for
  226.                                               reply info.)
  227.       <ESC>[>1g   Start GIF screen image processing
  228.       <ESC>[>2g   Start GIF printer image processing
  229.  
  230.       Unless you want to support GIF image processing (a *real* chore!),
  231.       filter these private commands when received.  (DOS ANSI, not under-
  232.       standing these sequences, will blindly display them onscreen.  Yuk!)
  233.       If you do want to handle GIF, be aware that the host sends the private
  234.       escape scquences at N81, and expects the responses to also be at N81 -
  235.       even if the user is currently at E71!  A comm program must therefore,
  236.       upon receiving the <ESC>[>0g sequence, switch to N81 to send the
  237.       response... and then remain at N81 until it is sure the next incomming
  238.       data is not a <ESC>[>1g or 2g initiator sequence.  In most areas of
  239.       CIS, this is easy; the host does not interrogate for GIF support until
  240.       just before it is ready to initiate the actual image send, and you can
  241.       therefore switch to N81 and stay there until the image processing is
  242.       done.  HOWEVER... in COLMAPS, TREND and possibly some other areas of
  243.       CIS, the <ESC>[>0g interrogation is performed *on entry to the area*
  244.       rather than just before image send - you must switch *back* to E71
  245.       to handle the following prompts and replies.  Therefore, the comm prog
  246.       must, on seeing the <ESC>[>0g, switch to N81 and send the reply, then
  247.       see if the next 3 chars are "<ESC>[>" and switch back if they are not.
  248.       You must look at at least 3 chars.  In COLMAPS and TREND, the next
  249.       bytes sent are an ANSI clear-screen ( <ESC>[0J ) command if ANSI/VT100
  250.       support is in use, and the program must see that it is not the image
  251.       send init sequence before switching.  I chatted with Brion on this once
  252.       and agree with CIS' reasoning for doing it (the image, being LZW
  253.       compressed data, *must* be handled in 8bit format)... but it's a pain
  254.       in the butt to code around.  Of course, if the user is already at N81,
  255.       none of this processing is nessessary.  The easy way out is to tell the
  256.       user that he must be at N81 to work correctly.  Explain that to the
  257.       average novice user... <grin!>
  258.  
  259.  
  260.   2.  The VIDTEX terminal control set is an improper subset of the DEC VT52
  261.       control set.  However, unlike the ANSI/VT100 conflicts mentioned above
  262.       there are no known conflicts between like commands.  VIDTEX does contain
  263.       private special sequences for CIS-specific functions concerning printer
  264.       and hardware control, capture buffer control, RLE high- and medium-res
  265.       graphics, etc.  Most specifically, the <ESC>I Interrogation Sequence
  266.       is considered part of the CIS private VIDTEX set (although I have seen
  267.       it listed as the "who are you" command in the SCO Xenix termcap set
  268.       for some versions of the VT52.)  A document file that _used_ to be
  269.       available on CIS gave complete specs for the VIDTEX command set.  I
  270.       have a copy.  I'm afraid to open it for fear the pages will fall apart.
  271.       It's *OLD*!  If you need specific VIDTEX command information, let me
  272.       know and I can provide what you need (the document is circa 40 pages.)
  273.  
  274.   3.  Wide mode is an example of the VIDTEX commands.  <ESC>m  enters wide
  275.       (32/40 column) mode and  <ESC>l  returns to 64/80 column mode.  Easy
  276.       to do on a CGA card, but...  The functionality was originally designed
  277.       around the TRS-80 Model I, which could change between the two modes
  278.       without clearing the screen - and the VIDTEX document specifies that
  279.       the functionality is done without inherently clearing the screen.
  280.       I've never seen a CGA card that could switch between 40- and 80-col
  281.       modes without clearing the screen automatically.  I've also never
  282.       seen a use for it on CIS.  Oh, well...
  283.  
  284.   4.  The screen size (SSyx) parameter should always be provided, although
  285.       if it is not your default settings for screen size in GO TERMINAL will
  286.       be used automatically.  The values for "y" and "x" are the ASCII
  287.       equivalent of the screen coordinate plus 31 (considering a "home"
  288.       coordinate of 1,1.)  "Y" and "x" are, of course, the lines and columns
  289.       count respectively.  For example, a 24-line by 80-col screen would
  290.       be calculated as follows:
  291.  
  292.               Coord.    Add     NewValue      ASCII equiv.     HEX Value
  293.       Lines     24       31        55             "7"              37
  294.       Columns   80       31       111             "o"              6F
  295.  
  296.       and would be sent as:
  297.  
  298.       ...,SS7o,...
  299.  
  300.  
  301.   5.  Protocols - the AP (Application Protocol) designation refers to the
  302.       remote supporting the "Applications Layer" of the B protocol, an as-
  303.       yet-unused (with the possible exception of HMI, the code for which I
  304.       have no access to) extension of the B+ proto.  It is mentioned in the
  305.       B+ spec document and then dropped, and the original QB source as pro-
  306.       vided by CIS contained code to acknowledge an AP packet whereas the
  307.       later B+ code had the acknowledgement curiously missing.  I smell
  308.       something comming...
  309.  
  310.       While the PB and DT codes are listed in a manner that indicates either
  311.       may be inserted in the response string independently, in practice CIS
  312.       balks if the DT code is used without being preceeded in the string
  313.       by the PB code.  Sa la vie.
  314.  
  315.       The PZ code is accepted by the host.  I wish the protocol was!  Connie
  316.       has tested it and says it works fine.  It had to be run on a special
  317.       test host, however; I would suspect there would be some serious problems
  318.       implementing ZMODEM CRC-32 on a 36-bit architecture, 64K core system
  319.       with a large user load.
  320.  
  321.   6.  The <check_value> computation is straightforward.  Some documents and
  322.       example-source files on CIS show the 3-4 digit ASCII representation
  323.       being mapped down to the low-order 2 digits, or being ANDed with
  324.       0xFF rather than 0xFFFF - these are incorrect, and CIS will choke
  325.       if either of these incorrect methods are used.  I guess a response
  326.       string limited to 80 characters could exceed 0xFFFF... my code
  327.       doesn't even try to AND the check value as it's never even close
  328.       to that high a number.
  329.  
  330.  
  331.  
  332. As examples, I'm including the response strings my programs send:
  333.  
  334. OZBEXT
  335.    #OZ1,9.2h,AC,CA,CC,SS7o,PB,DT,+<chkval>
  336.  
  337. OZRLE
  338.    #OZ2,5.1g,AC,CA,CC,SS7o,GH,GM,GF,+<chkval>
  339.  
  340. OZQB
  341.    #OZ3,9.1b,AC,CA,CC,SS7o,HC,GH,GM,GF,PB,DT,+<chkval>
  342.  
  343.  
  344.  
  345. Here is an example GIF image startup in PICS: (r = remote  h = host)
  346.  
  347. (h)"<ESC>[>0g"
  348. (r switches to N81, sends response string, stays at N81)
  349. (h)"<ESC>[>1g"
  350. (r enters GIF processing mode)
  351. (h)...image data...
  352. (r processes image, returns to E71 and normal processing)
  353.  
  354.  
  355. Here is an example GIF image startup in COLMAPS: (r = remote  h = host)
  356.  
  357. (h)"<ESC>[>0g"
  358. (r switches to N81, sends response string, stays at N81)
  359. (h)"<ESC>[2J<ESC>[37;44m..."
  360. (r switches back to E71 and returns to normal processing)
  361. (h sends info and prompts)
  362. (r responds)
  363. (h)"<ESC>[>1g"
  364. (r switches back to N81, enters GIF processing mode)
  365. (h)...image data...
  366. (r processes image, returns to E71 and normal processing)
  367.  
  368.  
  369.  
  370.      ----------------------------------------------------------
  371.  
  372. I hope this info proves helpful.
  373.  
  374. Steve Sneed
  375. Ozarks West Software
  376. 71520,77
  377. BBS  805-925-0378 3/12/24
  378.  
  379. <eof>
  380.