Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / TTY_IO.h
blob45ea6601b2d37dea9f7116eb89782ad146a16992
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file TTY_IO.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //=============================================================================
11 #ifndef ACE_TTY_IO_H
12 #define ACE_TTY_IO_H
14 #include "ace/DEV_IO.h"
16 #if !defined (ACE_LACKS_PRAGMA_ONCE)
17 # pragma once
18 #endif /* ACE_LACKS_PRAGMA_ONCE */
20 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
22 /**
23 * @class ACE_TTY_IO
25 * @brief Class definitions for platform specific TTY features.
27 * This class represents an example interface for a specific
28 * device (a serial line). It extends the capability of the
29 * underlying DEV_IO class by adding a control method that takes
30 * a special structure (Serial_Params) as argument to allow a
31 * comfortable user interface (away from that annoying termios
32 * structure, which is very specific to UNIX).
34 class ACE_Export ACE_TTY_IO : public ACE_DEV_IO
36 public:
37 ACE_TTY_IO ();
39 enum Control_Mode
41 SETPARAMS, ///< Set control parameters.
42 GETPARAMS ///< Get control parameters.
45 struct ACE_Export Serial_Params
47 Serial_Params ();
49 /** Specifies the baudrate at which the communication port operates. */
50 int baudrate;
51 /** Specifies the minimum number of bytes in input buffer before XON char
52 is sent. Negative value indicates that default value should
53 be used (Win32). */
54 int xonlim;
55 /** Specifies the maximum number of bytes in input buffer before XOFF char
56 is sent. Negative value indicates that default value should
57 be used (Win32). */
58 int xofflim;
59 /** Specifies the minimum number of characters for non-canonical
60 read (POSIX). */
61 unsigned int readmincharacters;
62 /** Specifies the time to wait before returning from read. Negative value
63 means infinite timeout. */
64 int readtimeoutmsec;
65 /** Specifies the parity mode. POSIX supports "none", "even" and
66 "odd" parity. Additionally Win32 supports "mark" and "space"
67 parity modes. */
68 const char *paritymode;
69 /** Enable/disable input parity checking. This option is only applicable
70 on systems which support the POSIX termios API */
71 bool inpckenb;
72 /** Enable & set CTS mode. Note that RTS & CTS are enabled/disabled
73 together on some systems (RTS/CTS is enabled if either
74 <code>ctsenb</code> or <code>rtsenb</code> is set). */
75 bool ctsenb;
76 /** Enable & set RTS mode. Note that RTS & CTS are enabled/disabled
77 together on some systems (RTS/CTS is enabled if either
78 <code>ctsenb</code> or <code>rtsenb</code> is set).
79 - 0 = Disable RTS.
80 - 1 = Enable RTS.
81 - 2 = Enable RTS flow-control handshaking (Win32).
82 - 3 = Specifies that RTS line will be high if bytes are available
83 for transmission. After transmission RTS will be low (Win32). */
84 unsigned char rtsenb;
85 /** Enable/disable software flow control on input. */
86 bool xinenb;
87 /** Enable/disable software flow control on output. */
88 bool xoutenb;
89 /** Specifies if device is a modem (POSIX). If not set modem status
90 lines are ignored. */
91 bool modem;
92 /** Enable/disable receiver (POSIX). */
93 bool rcvenb;
94 /** Controls whether DSR is disabled or enabled (Win32). */
95 bool dsrenb;
96 /** Controls whether DTR is disabled or enabled. */
97 bool dtrdisable;
98 /** Data bits. Valid values 5, 6, 7 and 8 data bits.
99 Additionally Win32 supports 4 data bits. */
100 unsigned char databits;
101 /** Stop bits. Valid values are 1 and 2. */
102 unsigned char stopbits;
105 /** Interface for reading/writing serial device parameters. */
106 int control (Control_Mode cmd, Serial_Params *arg) const;
109 ACE_END_VERSIONED_NAMESPACE_DECL
111 #endif /* ACE_TTY_IO_H */