diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-21 21:41:34 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-10-21 21:41:34 +0000 |
commit | a5fdebc5f6375078ec1763850a4ca23ec7fe6458 (patch) | |
tree | bcf0a25c3d45a209a6e3ac37b233a4812f29c732 /ace/TTY_IO.h | |
download | ATCD-a5fdebc5f6375078ec1763850a4ca23ec7fe6458.tar.gz |
Initial revision
Diffstat (limited to 'ace/TTY_IO.h')
-rw-r--r-- | ace/TTY_IO.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/ace/TTY_IO.h b/ace/TTY_IO.h new file mode 100644 index 00000000000..0e348f244cb --- /dev/null +++ b/ace/TTY_IO.h @@ -0,0 +1,67 @@ +/* -*- C++ -*- */ +// $Id$ + + +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// TTY_IO.h +// +// = DESCRIPTION +// +// = AUTHOR +// Douglas C. Schmidt +// +// ============================================================================ + +#if !defined (ACE_TTY_H) +#define ACE_TTY_H + +#include "ace/Log_Msg.h" +#include "ace/OS.h" +#include "ace/DEV_Addr.h" +#include "ace/DEV_Connector.h" +#include "ace/DEV_IO.h" + +class ACE_TTY_IO : public ACE_DEV_IO + // = TITLE + // Class definitions for TTY-specific features. + // + // = DESCRIPTION + // This class represents an example interface for a specific + // device (a serial line) It extends the capability of the + // underlying DEV_IO class by adding a control method that takes + // a special structure (Serial_Params) as argument to allow a + // comfortable user interface (away from that annoying termios + // structure, which is very specific to UNIX). +{ +public: + enum Control_Mode + { + SETPARAMS, // Set control parameters. + GETPARAMS // Get control parameters. + }; + + struct Serial_Params + { + int baudrate; + int parityenb; + char *paritymode; + int databits; + int stopbits; + int readtimeoutmsec; + int ctsenb; + int rcvenb; + }; + + int control (Control_Mode cmd, Serial_Params * arg) const; + // Interface for reading/writing serial device parameters. + + operator ACE_DEV_IO &(); + // This is necessary to pass ACE_TTY_IO as parameter to DEV_Connector. +}; + +#endif /* ACE_TTY_H */ |