// ********************** START OF BIOSPORT.H ********************** // // Source code from: // // Serial Communications: A C++ Developer's Guide, 2nd Edition // by Mark Nelson, IDG Books, 1999 // // Please see the book for information on usage. // // // This header file has all of the definitions and prototypes // needed to use the BIOSPort and EBIOSPort classes. This file // should be included by and module that needs to access either // of the classes. #ifndef _BIOSPORT_DOT_H #define _BIOSPORT_DOT_H #include #include "rs232.h" class BIOSPort : public RS232 { protected : int line_status; int first_debug_output_line; RS232Error write_settings( void ); virtual int read_buffer( char *buffer, unsigned int count ); virtual int write_buffer( char *buffer, unsigned int count = -1 ); virtual int read_byte( void ); virtual int write_byte( int c ); BIOSPort( void ); public : BIOSPort( enum RS232PortName port_name, long baud_rate = UNCHANGED, char parity = UNCHANGED, int word_length = UNCHANGED, int stop_bits = UNCHANGED, int dtr = SET, int rts = SET, int xon_xoff = DISABLE, int rts_cts = DISABLE, int dtr_dsr = DISABLE ); virtual ~BIOSPort( void ); virtual RS232Error Set( long baud_rate = UNCHANGED, int parity = UNCHANGED, int word_length = UNCHANGED, int stop_bits = UNCHANGED ); virtual int TXSpaceFree( void ); virtual int RXSpaceUsed( void ); virtual int Cd( void ); virtual int Ri( void ); virtual int Cts( void ); virtual int Dsr( void ); virtual int ParityError( int clear = UNCHANGED ); virtual int BreakDetect( int clear = UNCHANGED ); virtual int FramingError( int clear = UNCHANGED ); virtual int HardwareOverrunError( int clear = UNCHANGED ); virtual int FormatDebugOutput( char *buffer = 0, int line_number = -1 ); }; class EBIOSPort : public BIOSPort { protected : RS232Error write_settings( void ); void read_settings( void ); int first_debug_output_line; int break_on; public : EBIOSPort( enum RS232PortName port_name, long baud_rate = UNCHANGED, char parity = UNCHANGED, int word_length = UNCHANGED, int stop_bits = UNCHANGED, int dtr = SET, int rts = SET, int xon_xoff = DISABLE, int rts_cts = DISABLE, int dtr_dsr = DISABLE ); ~EBIOSPort( void ); virtual RS232Error Set( long baud_rate = UNCHANGED, int parity = UNCHANGED, int word_length = UNCHANGED, int stop_bits = UNCHANGED ); virtual int Break( long milliseconds = 300 ); virtual int Dtr( int setting = UNCHANGED ); virtual int Rts( int setting = UNCHANGED ); virtual int FormatDebugOutput( char *buffer = 0, int line_number = -1 ); }; #endif // #ifndef _BIOSPORT_DOT_H // ************************ END OF BIOSPORT.H ***********************