Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

TTY_IO.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    TTY_IO.h
00006  *
00007  *  $Id: TTY_IO.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Douglas C. Schmidt <schmidt@uci.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef ACE_TTY_IO_H
00014 #define ACE_TTY_IO_H
00015 
00016 #include "ace/OS.h"
00017 
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 # pragma once
00020 #endif /* ACE_LACKS_PRAGMA_ONCE */
00021 
00022 #include "ace/DEV_IO.h"
00023 
00024 /**
00025  * @class ACE_TTY_IO
00026  *
00027  * @brief Class definitions for platform specific TTY features.
00028  *
00029  * This class represents an example interface for a specific
00030  * device (a serial line) It extends the capability of the
00031  * underlying DEV_IO class by adding a control method that takes
00032  * a special structure (Serial_Params) as argument to allow a
00033  * comfortable user interface (away from that annoying termios
00034  * structure, which is very specific to UNIX).
00035  */
00036 class ACE_Export ACE_TTY_IO : public ACE_DEV_IO
00037 {
00038 public:
00039   enum Control_Mode
00040   {
00041     /// Set control parameters.
00042     SETPARAMS,
00043     /// Get control parameters.
00044     GETPARAMS
00045   };
00046 
00047   struct ACE_Export Serial_Params
00048   {
00049     Serial_Params (void);
00050 
00051     // Common params
00052     int baudrate;
00053     int parityenb;
00054     const char *paritymode;
00055     int databits;
00056     int stopbits;
00057     int readtimeoutmsec;
00058     int ctsenb;  // CTS & RTS are the same under unix
00059     int rtsenb;  // enable & set rts mode (win32)
00060     int xinenb;  // enable xon/xoff  reception
00061     int xoutenb;  // enable xon/xoff transmission
00062 
00063     // Posix - unix variant
00064     int modem;
00065     int rcvenb;
00066 
00067     //Win32
00068     int dsrenb;  // SadreevAA
00069 
00070     int xonlim;  // min bytes in input buffer before xon
00071     int xofflim; // max bytes in input buffer before xoff
00072   };
00073 
00074   /// Interface for reading/writing serial device parameters.
00075   int control (Control_Mode cmd,
00076                Serial_Params *arg) const;
00077 
00078 #if defined (ACE_NEEDS_DEV_IO_CONVERSION)
00079   /// This is necessary to pass ACE_TTY_IO as parameter to DEV_Connector.
00080   operator ACE_DEV_IO &();
00081 #endif /* ACE_NEEDS_DEV_IO_CONVERSION */
00082 };
00083 
00084 #endif /* ACE_TTY_IO_H */

Generated on Mon Jun 16 11:21:59 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002