home *** CD-ROM | disk | FTP | other *** search
- UNIT OSIO;
-
- INTERFACE
- uses CRT, DOS;
-
- {
- This Unit contains the Object SERIAL_IO. SERIAL_IO has the following
- methods available to it:
-
- Open_Port(Port_Number : Byte;
- Baud_Rate: Integer;
- Bits: Byte;
- Stop_Bits: Byte;
- Parity: Char) - Initalizes the selected Com Port, installs
- an interrupt driver to send and receive
- characters from that port.
- Parity can be set in three ways:
- 'O' : Odd Parity
- 'E' : Even Parity
- 'N' : No Parity
- Returns TRUE if port was correctly opened,
- FALSE if the port could not be opened.
-
- Close_Port(Port_Number : Byte) - Closes the selected Com Port, and removes
- the interrupt driver installed by Open_Port.
- Returns TRUE if the port was closed, FALSE
- if the port could not be closed.
-
- Carrier_Status(Port_Number : Byte) - Returns TRUE if Carrier is detected,
- FALSE if no Carrier is detected.
-
- Get_Character(Port_Number : Byte;
- var Character : Char) - Returns TRUE if character received, or
- FALSE if there was an error. Returns
- character received in Character.
-
- Send_Character(Port_Number : Byte;
- Character : Char) - Sends the specified character out the
- specified port. Always returns TRUE.
-
- Query_Buffer(Port_Number : Byte) - Returns TRUE if the buffer contains characters, FALSE if
- empty.
-
- The interrupt routine which Open_Port installs has a 1K input buffer.
-
- BE SURE TO ALWAYS USE CLOSE_PORT before your program terminates.
-
- Due to the nature of Object Oriented Programming, you should have no need
- to directly change any of the variables or Methods associated with this
- unit. Tampering with any of them may render the unit unusable due to the
- delicate nature of all I/O procedures, and especially those which rely on
- Interrupts.
-
- This unit is Copyright <C> February 16th, 1990 by Ryan S. Dancey
- No restrictions on the use of this package have been made. However,
- if you find it of value, please be sure to pass it on to any source you
- deem needful!
- }
-
- type
- Serial_Port = Object
- Function Open_Port(Port_Number : Byte;
- Baud_Rate: Word;
- Bits: Byte;
- Stop_Bits: Byte;
- Parity: Char) : Boolean;
-
- Function Close_Port(Port_Number : Byte) : Boolean;
- Private
- Function SET_INTERRUPTS(Port_Number : Byte) : Boolean;
- Procedure CANCEL_INTERRUPTS(Port_Number : Byte);
- Function IS_PORT_OPEN(Port_Number : Byte) : Boolean;
- Procedure MARK_PORT_OPEN(Port_Number : Byte);
- Procedure MARK_PORT_CLOSED(Port_Number : Byte);
- end;
-
- Serial_Utilities = Object(Serial_Port)
- Function Carrier_Status(Port_Number : Byte) : Boolean;
- end;
-
- Serial_IO = Object(Serial_Utilities)
- Function Get_Character(Port_Number : Byte;
- var Character : Char) : Boolean;
- Function Send_Character(Port_Number : Byte;
- Character : Char) : Boolean;
- Function Query_Buffer(Port_Number : Byte) : Boolean;
- end;
-
-
- UNIT OSIO;
-
- INTERFACE
- uses CRT, DOS;
-
- {
- This Unit contains the Object SERIAL_IO. SERIAL_IO has the following
- methods available to it:
-
- Open_Port(Port_Number : Byte;
- Baud_Rate: Integer;
- Bits: Byte;
- Stop_Bits: Byte;
- Parity: Char) - Initalizes the selected Com Port, installs
- an interrupt driver to send and receive
- characters from that port.
- Parity can be set in three ways:
- 'O' : Odd Parity
- 'E' : Even Parity
- 'N' : No Parity
- Returns TRUE if port was correctly opened,
- FALSE if the port could not be opened.
-
- Close_Port(Port_Number : Byte) - Closes the selected Com Port, and removes
- the interrupt driver installed by Open_Port.
- Returns TRUE if the port was closed, FALSE
- if the port could not be closed.
-
- Carrier_Status(Port_Number : Byte) - Returns TRUE if Carrier is detected,
- FALSE if no Carrier is detected.
-
- Get_Character(Port_Number : Byte;
- var Character : Char) - Returns TRUE if character received, or
- FALSE if there was an error. Returns
- character received in Character.
-
- Send_Character(Port_Number : Byte;
- Character : Char) - Sends the specified character out the
- specified port. Always returns TRUE.
-
- Query_Buffer(Port_Number : Byte) - Returns TRUE if the buffer contains characters, FALSE if
- empty.
-
- The interrupt routine which Open_Port installs has a 1K input buffer.
-
- BE SURE TO ALWAYS USE CLOSE_PORT before your program terminates.
-
- Due to the nature of Object Oriented Programming, you should have no need
- to directly change any of the variables or Methods associated with this
- unit. Tampering with any of them may render the unit unusable due to the
- delicate nature of all I/O procedures, and especially those which rely on
- Interrupts.
-
- This unit is Copyright <C> February 16th, 1990 by Ryan S. Dancey
- No restrictions on the use of this package have been made. However,
- if you find it of value, please be sure to pass it on to any source you
- deem needful!
- }
-
- type
- Serial_Port = Object
- Function Open_Port(Port_Number : Byte;
- Baud_Rate: Word;
- Bits: Byte;
- Stop_Bits: Byte;
- Parity: Char) : Boolean;
-
- Function Close_Port(Port_Number : Byte) : Boolean;
- Private
- Function SET_INTERRUPTS(Port_Number : Byte) : Boolean;
- Procedure CANCEL_INTERRUPTS(Port_Number : Byte);
- Function IS_PORT_OPEN(Port_Number : Byte) : Boolean;
- Procedure MARK_PORT_OPEN(Port_Number : Byte);
- Procedure MARK_PORT_CLOSED(Port_Number : Byte);
- end;
-
- Serial_Utilities = Object(Serial_Port)
- Function Carrier_Status(Port_Number : Byte) : Boolean;
- end;
-
- Serial_IO = Object(Serial_Utilities)
- Function Get_Character(Port_Number : Byte;
- var Character : Char) : Boolean;
- Function Send_Character(Port_Number : Byte;
- Character : Char) : Boolean;
- Function Query_Buffer(Port_Number : Byte) : Boolean;
- end;
-
-
-