Initial Patch of Auction House bot rev. 135
[auctionmangos.git] / dep / ACE_wrappers / ace / TTY_IO.h
blob1029966e56c0e7b1818a64df01df61105892071e
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file TTY_IO.h
7 * $Id: TTY_IO.h 82271 2008-07-09 09:23:03Z olli $
9 * @author Douglas C. Schmidt <schmidt@uci.edu>
11 //=============================================================================
13 #ifndef ACE_TTY_IO_H
14 #define ACE_TTY_IO_H
16 #include "ace/DEV_IO.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 /**
25 * @class ACE_TTY_IO
27 * @brief Class definitions for platform specific TTY features.
29 * This class represents an example interface for a specific
30 * device (a serial line). It extends the capability of the
31 * underlying DEV_IO class by adding a control method that takes
32 * a special structure (Serial_Params) as argument to allow a
33 * comfortable user interface (away from that annoying termios
34 * structure, which is very specific to UNIX).
36 class ACE_Export ACE_TTY_IO : public ACE_DEV_IO
38 public:
39 enum Control_Mode
41 SETPARAMS, ///< Set control parameters.
42 GETPARAMS ///< Get control parameters.
45 struct ACE_Export Serial_Params
47 Serial_Params (void);
49 /** Specifies the baudrate at which the communnication 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 & set CTS mode. Note that RTS & CTS are enabled/disabled
70 together on some systems (RTS/CTS is enabled if either
71 <code>ctsenb</code> or <code>rtsenb</code> is set). */
72 bool ctsenb;
73 /** Enable & set RTS mode. Note that RTS & CTS are enabled/disabled
74 together on some systems (RTS/CTS is enabled if either
75 <code>ctsenb</code> or <code>rtsenb</code> is set).
76 - 0 = Disable RTS.
77 - 1 = Enable RTS.
78 - 2 = Enable RTS flow-control handshaking (Win32).
79 - 3 = Specifies that RTS line will be high if bytes are available
80 for transmission. After transmission RTS will be low (Win32). */
81 unsigned char rtsenb;
82 /** Enable/disable software flow control on input. */
83 bool xinenb;
84 /** Enable/disable software flow control on output. */
85 bool xoutenb;
86 /** Specifies if device is a modem (POSIX). If not set modem status
87 lines are ignored. */
88 bool modem;
89 /** Enable/disable receiver (POSIX). */
90 bool rcvenb;
91 /** Controls whether DSR is disabled or enabled (Win32). */
92 bool dsrenb;
93 /** Controls whether DTR is disabled or enabled. */
94 bool dtrdisable;
95 /** Data bits. Valid values 5, 6, 7 and 8 data bits.
96 Additionally Win32 supports 4 data bits. */
97 unsigned char databits;
98 /** Stop bits. Valid values are 1 and 2. */
99 unsigned char stopbits;
102 /** Interface for reading/writing serial device parameters. */
103 int control (Control_Mode cmd, Serial_Params *arg) const;
105 #if defined (ACE_NEEDS_DEV_IO_CONVERSION)
106 /** This is necessary to pass ACE_TTY_IO as parameter to DEV_Connector. */
107 operator ACE_DEV_IO &();
108 #endif /* ACE_NEEDS_DEV_IO_CONVERSION */
111 ACE_END_VERSIONED_NAMESPACE_DECL
113 #endif /* ACE_TTY_IO_H */