TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Steven Hendriks
from: David Muir
date: 1995-08-05 06:30:40
subject: Serial I/O {2 of 10}

(* ----------------------------- VARIABLES ------------------------------- *)
(***************************************************************************)

VAR
  Fport     : hfile;     { File Handle returned by dosopen }
  EAptr     : pointer;   { Pointer to "Eaop" defined in OS2BASE }
  Error     : word;      { All purpose error holder }
  BufferRec : buffrec;   { holds info from last call to TX or RX buffer }

(***************************************************************************)
(* ------------------------ INTERFACE FUNCTIONS -------------------------- *)
(***************************************************************************)

Function Openport( Var Pname : Pchar ) : Boolean;
   { Opens "Pname" for communications and sets "Fport"
to the file
     handle returned by "dosopen" as required for almost
"all" other
     Functions and Procedures. Returns true upon success. }

Function Carrier : Boolean;
   { Carrier Detect - Returns true if DCD is active }

Function Isring : Boolean;
   { Ring Detect - Returns true if 'RING' detected }

Function RaiseDTR : Boolean;

Function LowerDTR : Boolean;

Function DTRActive : Boolean;

Function RaiseRTS : Boolean;

Function LowerRTS : Boolean;

Function RTSActive : Boolean;

Function DSRActive : Boolean;

Function CTSActive : Boolean;

Function TX_free : word;
   { Returns the amount of "free" space in the Transmit (TX) buffer
     For buffer size or number of chars in TX buffer,
     query bufferec immediately after this call}

Function RX_free : word;
   { Returns the amount of "free" space in the Receive (RX) buffer
     For buffer size or number of chars in RX buffer,
     query bufferec immediately after this call}

Function SetBaud (Bitrate : word) : word;
   { Sets the Bit Rate (BPS), returns the actual Bit rate that was set
     For Bit Rates higher than 57600 use 'SetEBaud' }

Function SetEBaud (Bitrate : longint) : longint;
   { Sets the Bit Rate (BPS), returns the actual Bit rate that was set}

Function GetBaud : word;
   { Returns the current Bit Rate (BPS)
     For Bit Rates higher than 57600 use 'GetEBaud' }

Function GetEbaud (which : byte) : longint;
   { which = 1 returns the current Bit Rate (BPS)
     which = 2 returns the minimum supported Bit Rate (BPS)
     which = 3 returns the maximum supported Bit Rate (BPS) }

Function SetLine (D_bits, Parity, S_bits : byte) : Boolean;
   { Sets Data bits, Parity and Stop bits as follows

     Data bits must be in [5,7,8]

     Parity    -  0 = NO
                  1 = ODD
                  2 = EVEN
                  3 = MARK  (1)
                  4 = SPACE (0)

     Stop Bits -  0 = 1
                  1 = 1+1/2 (only valid with Data Bits = 5 )
                  2 = 2
     }

Procedure Getline (Var D_bits : byte;
                   Var Parity : byte;
                   Var S_bits : byte;
                   Var brk    : byte);
   { Get Data bits, Parity and Stop bits.
     "brk" returns true of "break" is being sent. For
values see "SetLine" }

Procedure GetDCB (Var dest : DCBREC);
   { Get Device Control Block }

Procedure SetDCB (Var Src : DCBREC);
   { Set Device Control Block }

Function Waiting : Boolean;
   { True if one or more characters is in the RX buffer }

___ Blue Wave/QWK v2.12
--- Renegade v10-05 Exp

* Origin: Scrawled From the Tomb..(416-255-2164) (1:250/346)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 515 628 704 713/888 800/1 7877/2809
@PATH: 250/346 426 702 3615/50 396/1 270/101 105/103 42 712/515 711/808
@PATH: 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.