home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 3 Comm / 03-Comm.zip / RXCOMM.ZIP / RXCOMM.DOC < prev    next >
Text File  |  1990-12-23  |  7KB  |  196 lines

  1.                    RxComm REXX/SAA Communications facility
  2.                       Written (C) 1990 by Mark Smith
  3.  
  4. RxComm is a DLL that is used by REXX/SAA to communicate with the 
  5. Communications port under OS/2 release 1.2 EE or 1.3 SE.
  6.  
  7. Note that this documentation was written based on early design, and not
  8. really updated since.  There may be discrepencies between the code and
  9. docs (aren't there always - at least I warn you!!!)
  10.  
  11. For an example on how to use these functions, see REXCOMM.cmd
  12.  
  13. Functions:
  14.  
  15. ----------------------------------------------------------------------------
  16.  
  17. RxCommOpen (handle)
  18.    where 'handle' is a valid COMM port in the form of:
  19.                          'COM1'
  20.                          'COM2'
  21.                          ..etc..
  22.  
  23.    Return Values:
  24.                     0   -  Port was opened Ok.
  25.                    -1   -  Handle specified was invalid
  26.                    -2   -  Port not found, or already open
  27.                    xx   -  Return code from DOSOPEN command
  28.                            (usually a 110 for prot. violation)
  29.  
  30. -----------------------------------------------------------------------------
  31.  
  32. RxCommClose (handle)
  33.    where 'handle' is a valid COMM port in the form of:
  34.                          'COM1'
  35.                          'COM2'
  36.                          ..etc..
  37.  
  38.    Return Values:
  39.                     0   -  Port was closed Ok.
  40.                    -1   -  Handle specified was invalid
  41.                    -2   -  Port not found (ie: not opened)
  42.    
  43. -----------------------------------------------------------------------------
  44.  
  45. RxCommPut (handle, string)
  46.    where 'handle' is a valid COMM port in the form of:
  47.                          'COM1'
  48.                          'COM2'
  49.                          ..etc..
  50.   
  51.    and 'string' is a valid REXX string or variable containing a string
  52.                 to output to the COMM port
  53.  
  54.    Return Values:
  55.                     0   -  Characters sent Ok.
  56.                    -1   -  Handle specified was invalid
  57.                    -2   -  Port not found (ie: not opened)
  58.  
  59. -----------------------------------------------------------------------------
  60.  
  61. RxCommGet (handle)
  62.    where 'handle' is a valid COMM port in the form of:
  63.                          'COM1'
  64.                          'COM2'
  65.                          ..etc..
  66.  
  67.    Returns:
  68.                Count String
  69.  
  70.       where 'Count' is the count of characters returned
  71.         and 'String' is the characters found on that port.
  72.  
  73.    OR:
  74.                    -1   -  Handle specified was invalid
  75.                    -2   -  Port not found (ie: not opened)
  76.  
  77.  
  78. -----------------------------------------------------------------------------                  
  79.  
  80. RxCommCheck (handle)
  81.    where 'handle' is a valid COMM port in the form of:
  82.                          'COM1'
  83.                          'COM2'
  84.                          ..etc..
  85.  
  86.    Returns:
  87.                Count of characters available on that port
  88.    OR:
  89.                    -1   -  Handle specified was invalid
  90.                    -2   -  Port not found (ie: not opened)
  91.  
  92. -----------------------------------------------------------------------------
  93.  
  94. RxCommGetParams (handle)
  95.    where 'handle' is a valid COMM port in the form of:
  96.                          'COM1'
  97.                          'COM2'
  98.                          ..etc..
  99.  
  100.    Returns:
  101.              string in the form of:
  102.       'BAUD=xxxx PARITY=xxxx DATABITS=xx STOPBITS=xx CTS=xx DSR=xx RI=xx
  103.        CD=xx DTR=xx RTS=xx'
  104.  
  105.    OR:
  106.                    -1   -  Handle specified was invalid
  107.                    -2   -  Port not found (ie: not opened)
  108.    
  109. -----------------------------------------------------------------------------
  110.  
  111. RxCommSetParams (handle, BAUD, DATABITS, PARITY, STOPBITS)
  112.    where 'handle' is a valid COMM port in the form of:
  113.                          'COM1'
  114.                          'COM2'
  115.                          ..etc..
  116.  
  117.          'baud' is a valid baud rate: 110, 150, 300, 1200, 2400, 4800,
  118.                                      9600, 19200 (on PS/2s)
  119.          'databits' is a valid setting: 5, 6, 7, 8
  120.          'parity' is a valid setting 'EVEN', 'ODD', 'NONE', 'MARK', 'SPACE'
  121.                    -NOTE- this may be shortened to 1st letter
  122.          'stopbits' is a valid stopbits setting: 1 or 2
  123.  
  124.          All values DO NOT need to be specified
  125.             ie: RxCommSetParams(handle,,DATABITS) is valid.
  126.          Any unspecified values will retain their current value.
  127.          Any invalid values will retain their current value.
  128.  
  129.     RETURNS:
  130.                     0   -  Change Ok
  131.                    -1   -  Handle specified was invalid
  132.                    -2   -  Port not found (ie: not opened)
  133.                    -3   -  IOCTL error
  134.  
  135. ----------------------------------------------------------------------------
  136.  
  137. RxCommSetDTR (handle, value)
  138.    where 'handle' is a valid COMM port in the form of:
  139.                          'COM1'
  140.                          'COM2'
  141.                          ..etc..
  142.  
  143.    and 'value' is 'ON' or 'OFF'.
  144.  
  145.          Any invalid values will retain their current value.
  146.   
  147.    RETURNS:
  148.               previous setting for the DTR line.
  149.    OR
  150.                    -1   -  Handle specified was invalid
  151.                    -2   -  Port not found (ie: not opened)
  152.                    -3   -  IOCTL error
  153.  
  154. ----------------------------------------------------------------------------
  155.  
  156. RxCommSendBreak (handle, time)
  157.    where 'handle' is a valid COMM port in the form of:
  158.                          'COM1'
  159.                          'COM2'
  160.                          ..etc..
  161.  
  162.    and 'time' is the time in milliseconds to send the break character
  163.  
  164.    RETURNS:
  165.                     0   -  Ok
  166.                    -1   -  Handle specified was invalid
  167.                    -2   -  Port not found (ie: not opened)
  168.  
  169. ----------------------------------------------------------------------------
  170.  
  171. RxGetChar (option)
  172.    where 'option' is either blank or 'NOECHO'.  If it is 'NOECHO', the
  173.    character read will not be echoed to the screen.  If it is blank, the
  174.    character returned is echoed to the console.
  175.  
  176.    RETURNS:
  177.                      character read from keyboard or string if extended
  178.                      character.
  179.  
  180. Notes:
  181.        extended characters (such as Function keys) are returned as a 
  182. string containing the key pressed.  For example, if the F1 key is pressed,
  183. the resulting string will be 'F1'.  These strings are NEVER echoed to the
  184. console regardless of the option selected.
  185.  
  186. ----------------------------------------------------------------------------
  187.  
  188. RxSay (string)
  189.    where 'string' is a valid REXX string.  It will be printed to the 
  190.    console EXACTLY as it is in the string.  No CR/LF will be added so if
  191.    a newline is required, either use the Say instruction or add one to the
  192.    end of the string.
  193.  
  194. ----------------------------------------------------------------------------
  195.  
  196.