home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / XFER10.ZIP / XFER10.DOC < prev   
Encoding:
Text File  |  1990-01-20  |  7.3 KB  |  219 lines

  1.  
  2.  
  3. XFER 1.0
  4.  
  5. By Andrew Bartels
  6.  
  7. A Product of Digital Innovations
  8.  
  9.  
  10.  
  11. In  the  interest of programming, yes, please do distribute copies
  12. of this program and source code!
  13.  
  14. This  program  is  placed  in the Public Domain, January, 1990, By
  15. Andrew Bartels.
  16.  
  17. If there are any questions, you may contact me at:
  18.  
  19.     Digital Innovations
  20.     Andrew Bartels
  21.     1859 East 8th Street
  22.     Mesa, AZ 85203-6649
  23.  
  24.     (602) 827-1934   - Home
  25.     (602) 834-1565   - Work
  26.  
  27.  
  28. You  are  using this program at your own risk.  Neither the author
  29. nor  Digital  Innovations  is  responsible  for  any  damages as a
  30. result  of  use, misuse, or failure to perform on the part of this
  31. program.
  32.  
  33.  
  34. This  source  code  will  compile  under  Turbo  Pascal  5 or 5.5,
  35. Copyright (C) 1987, 1989 Borland International, Inc.
  36.  
  37. Many  thanks  go  to  Wayne  Conrad of Pascalaholics Anonymous BBS
  38. (602-484-9356,  300/1200/2400  baud)  for  writing  the IBMCOM 3.0
  39. unit  and  placing  it in the Public Domain.  Without IBMCOM, this
  40. program would not have been possible.
  41.  
  42.  
  43. This  program  provides full support for Xmodem Checksum, CRC, and
  44. 1K  file  transfers  for  the IBM PC and compatibles.  Great pains
  45. have  been  taken  to heavily document the code for clarity in the
  46. operations  that take place in an Xmodem transfer.  I realize that
  47. there  are  other much more sophisticated programs out there which
  48. support  Xmodem  **  AND  A BUNCH MORE PROTOCOLS **, which you all
  49. will  be  using  for  transfers with your terminal programs.  This
  50. program  does  not  intend  to  compete  with these other protocol
  51. drivers.    Its  main  attraction is the fact that I have made the
  52. source  code  open  and available to all programmers to review. It
  53. is  dedicated  to  all  those  fine individuals who once helped me
  54. with  questions  or  problems  in  programming,  and I release the
  55. source  code  to  all  in  hopes  that it may be of help to others
  56. attempting to support Xmodem.
  57.  
  58.  
  59.  
  60.  
  61. Use  of  this  program  is very simple.  The program is invoked by
  62. entering  a  command  line according to the following description:
  63.  
  64.  
  65. XFER [Port n] [Speed n] Command [Options] Path\File
  66.  
  67.  
  68. [Port n] :
  69.  
  70. This  optional  parameter tells XFER which COM Port to use for the
  71. transfer.    This can be from 1 to 4.  If [port n] is omitted, the
  72. default port is 1.
  73.  
  74.  
  75. [Speed n] :
  76.  
  77. This  optional parameter sets the speed of the transfer.  This can
  78. be  300,  600,  1200,  2400,  4800,  9600, or 19200 baud.  If this
  79. parameter  is  omitted,  the  current speed of the port being used
  80. becomes default.
  81.  
  82.  
  83. Command :
  84.  
  85. This  parameter  indicates which operation to perform.  As of this
  86. version,  you  may  use  'sx'  to  send Xmodem, or 'rx' to receive
  87. Xmodem.   It is expected that other protocols will be supported in
  88. later versions.
  89.  
  90. [Options] :
  91.  
  92. These  consist  of  '-C'  for  CRC  mode  transfers,  and '-K' for
  93. support  of  Xmodem 1K transfers.  If no options are selected, the
  94. protocol becomes Xmodem Checksum, with 128 byte blocks.
  95.  
  96. Path\File :
  97.  
  98. This  parameter  determines  which file is to be sent or received.
  99. Wild  cards  are  not permitted, as Xmodem transfers are not batch
  100. transfers.    As batch protocols become available, wild cards will
  101. be supported.
  102.  
  103.  
  104.  
  105.  
  106. When  exiting,  this  program  provides an error code which can be
  107. detected  by  ERRORLEVEL  in batch files.  The following are valid
  108. codes, followed by their meanings.
  109.  
  110.  
  111.     Code    Definition
  112. ------------------------------------------------------------------
  113.       0     No error occurred.  Transfer terminated normally.
  114.  
  115.       1     Error opening file.  Possibly bad disk, or file
  116.             is not found.
  117.  
  118.       2     Operator aborted transfer by pressing a key during
  119.             the transfer.
  120.  
  121.       3     Remote computer cancelled transfer
  122.  
  123.       4     Maximum number of timeouts or other block errors
  124.             has been exceeded (usually 10), and transfer is
  125.             aborting.
  126.  
  127.       5     Block received out of sequence.  Protocol aborts
  128.             promptly under these conditions.
  129.  
  130.       6     Timeout while waiting for final EOT from
  131.             transmitter.  Some implementations of Xmodem do
  132.             not wait for the final EOT to be ACK'd before
  133.             exiting, and thus will not re-send it when it is
  134.             NAK'd the first time.  This causes a timeout while
  135.             waiting for the second EOT, and not receiving one.
  136.             Nothing serious is wrong here, except that the
  137.             transmitter is not fully supporting the now
  138.             recognized Xmodem standard.  When this code is
  139.             received, it is nothing more than a warning,  and
  140.             should only be worried about if the file received
  141.             seems incomplete at the end.
  142.  
  143.       7     No carrier.  Must have carrier to transfer.
  144.  
  145.     252     Invalid operation on command line.  The only valid
  146.             operations are SX (send Xmodem) and RX (receive
  147.             Xmodem).  Any others will cause this exit code.
  148.  
  149.     253    Invalid [Options] selected on command line.  Only
  150.             -C and -K are valid, any others will cause this
  151.             exit code.
  152.  
  153.     254     Invalid baud rate specified.  This is caused when
  154.             using [Speed n] to select a baud rate that is
  155.             other than 300, 600, 1200, 2400, 4800, 9600, and
  156.             19200.
  157.  
  158.     255     Invalid COM Port number.  This is caused by using
  159.             [Port n] to specify a COM port other than 1 - 4,
  160.             or when specifying a COM port that does not exist.
  161.             For example, specifying 'PORT 3' on a system that
  162.             only has two COM ports, will cause this error.
  163.  
  164. ------------------------------------------------------------------
  165.  
  166.  
  167. Examples of use:
  168.  
  169.     Specify Xmodem Checksum send, COM1, current baud:
  170.         xfer sx myfile.zip
  171.  
  172.     Specify Xmodem CRC send, COM1, current baud:
  173.         xfer sx -c myfile.zip
  174.  
  175.     Specify Xmodem 1K send, COM1, current baud:
  176.         xfer sx -k myfile.zip      or
  177.         xfer sx -k -c myfile.zip
  178.  
  179.     Specify Xmodem Checksum receive, COM1, current baud:
  180.         xfer rx myfile.zip
  181.  
  182.     Specify Xmodem CRC or 1K receive, COM1, current baud:
  183.         xfer rx -c myfile.zip      or
  184.         xfer rx -c -k myfile.zip   or
  185.         xfer rx -k myfile.zip
  186.     *  Note that all three of these commands will receive
  187.        Xmodem 1K or Xmodem CRC, whichever the xmitter decides
  188.        to transmit.  As always, if the xmitter does not support
  189.        CRC, the protocol will drop back to Xmodem Checksum.
  190.        All Xmodem 1K transfers are assumed to be CRC by default
  191.        (thus the third command line possibility is listed as
  192.        an alternative to the second one).  It is possible to
  193.        initiate an Xmodem Checksum 1K transfer if the xmitter
  194.        forces a drop back to checksum, but then sends 1K
  195.        blocks (this is not recommended due to the checksum
  196.        being less accurate as block size increases).
  197.  
  198.     Specify Xmodem Checksum send, COM2, current baud rate:
  199.         xfer port 2 sx myfile.zip
  200.  
  201.     Specify Xmodem CRC send, COM4, at 9600 baud:
  202.         xfer port 4 speed 9600 sx -c myfile.zip
  203.  
  204.  
  205. Files in this archive:
  206.  
  207.  
  208.     XFER.PAS    Main source code file.  Contains
  209.             constant definitions, CRC calculation code
  210.             and command line parameter processing.
  211.  
  212.     SXRX.INC    Include file for XFER.PAS.  Contains
  213.             functions to send and receive Xmodem.
  214.  
  215.     XFER10.DOC    This documentation file.
  216.  
  217.     XFER.EXE    The complete compiled version, in case you
  218.             don't have the IBMCOM unit or Turbo Pascal.
  219.