home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
RXCOMM.ZIP
/
RXCOMM.DOC
< prev
next >
Wrap
Text File
|
1990-12-23
|
7KB
|
196 lines
RxComm REXX/SAA Communications facility
Written (C) 1990 by Mark Smith
RxComm is a DLL that is used by REXX/SAA to communicate with the
Communications port under OS/2 release 1.2 EE or 1.3 SE.
Note that this documentation was written based on early design, and not
really updated since. There may be discrepencies between the code and
docs (aren't there always - at least I warn you!!!)
For an example on how to use these functions, see REXCOMM.cmd
Functions:
----------------------------------------------------------------------------
RxCommOpen (handle)
where 'handle' is a valid COMM port in the form of:
'COM1'
'COM2'
..etc..
Return Values:
0 - Port was opened Ok.
-1 - Handle specified was invalid
-2 - Port not found, or already open
xx - Return code from DOSOPEN command
(usually a 110 for prot. violation)
-----------------------------------------------------------------------------
RxCommClose (handle)
where 'handle' is a valid COMM port in the form of:
'COM1'
'COM2'
..etc..
Return Values:
0 - Port was closed Ok.
-1 - Handle specified was invalid
-2 - Port not found (ie: not opened)
-----------------------------------------------------------------------------
RxCommPut (handle, string)
where 'handle' is a valid COMM port in the form of:
'COM1'
'COM2'
..etc..
and 'string' is a valid REXX string or variable containing a string
to output to the COMM port
Return Values:
0 - Characters sent Ok.
-1 - Handle specified was invalid
-2 - Port not found (ie: not opened)
-----------------------------------------------------------------------------
RxCommGet (handle)
where 'handle' is a valid COMM port in the form of:
'COM1'
'COM2'
..etc..
Returns:
Count String
where 'Count' is the count of characters returned
and 'String' is the characters found on that port.
OR:
-1 - Handle specified was invalid
-2 - Port not found (ie: not opened)
-----------------------------------------------------------------------------
RxCommCheck (handle)
where 'handle' is a valid COMM port in the form of:
'COM1'
'COM2'
..etc..
Returns:
Count of characters available on that port
OR:
-1 - Handle specified was invalid
-2 - Port not found (ie: not opened)
-----------------------------------------------------------------------------
RxCommGetParams (handle)
where 'handle' is a valid COMM port in the form of:
'COM1'
'COM2'
..etc..
Returns:
string in the form of:
'BAUD=xxxx PARITY=xxxx DATABITS=xx STOPBITS=xx CTS=xx DSR=xx RI=xx
CD=xx DTR=xx RTS=xx'
OR:
-1 - Handle specified was invalid
-2 - Port not found (ie: not opened)
-----------------------------------------------------------------------------
RxCommSetParams (handle, BAUD, DATABITS, PARITY, STOPBITS)
where 'handle' is a valid COMM port in the form of:
'COM1'
'COM2'
..etc..
'baud' is a valid baud rate: 110, 150, 300, 1200, 2400, 4800,
9600, 19200 (on PS/2s)
'databits' is a valid setting: 5, 6, 7, 8
'parity' is a valid setting 'EVEN', 'ODD', 'NONE', 'MARK', 'SPACE'
-NOTE- this may be shortened to 1st letter
'stopbits' is a valid stopbits setting: 1 or 2
All values DO NOT need to be specified
ie: RxCommSetParams(handle,,DATABITS) is valid.
Any unspecified values will retain their current value.
Any invalid values will retain their current value.
RETURNS:
0 - Change Ok
-1 - Handle specified was invalid
-2 - Port not found (ie: not opened)
-3 - IOCTL error
----------------------------------------------------------------------------
RxCommSetDTR (handle, value)
where 'handle' is a valid COMM port in the form of:
'COM1'
'COM2'
..etc..
and 'value' is 'ON' or 'OFF'.
Any invalid values will retain their current value.
RETURNS:
previous setting for the DTR line.
OR
-1 - Handle specified was invalid
-2 - Port not found (ie: not opened)
-3 - IOCTL error
----------------------------------------------------------------------------
RxCommSendBreak (handle, time)
where 'handle' is a valid COMM port in the form of:
'COM1'
'COM2'
..etc..
and 'time' is the time in milliseconds to send the break character
RETURNS:
0 - Ok
-1 - Handle specified was invalid
-2 - Port not found (ie: not opened)
----------------------------------------------------------------------------
RxGetChar (option)
where 'option' is either blank or 'NOECHO'. If it is 'NOECHO', the
character read will not be echoed to the screen. If it is blank, the
character returned is echoed to the console.
RETURNS:
character read from keyboard or string if extended
character.
Notes:
extended characters (such as Function keys) are returned as a
string containing the key pressed. For example, if the F1 key is pressed,
the resulting string will be 'F1'. These strings are NEVER echoed to the
console regardless of the option selected.
----------------------------------------------------------------------------
RxSay (string)
where 'string' is a valid REXX string. It will be printed to the
console EXACTLY as it is in the string. No CR/LF will be added so if
a newline is required, either use the Say instruction or add one to the
end of the string.
----------------------------------------------------------------------------