conexus logo

tty_interface.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This file is part of the conexus library.                             *
00006  *                                                                         *
00007  *   The conexus library is free software; you can redistribute it and/or  *
00008  *   modify it under the terms of the GNU General Public License           *
00009  *   version 3 as published by the Free Software Foundation.               *
00010  *                                                                         *
00011  *   The conexus library is distributed in the hope that it will be        *
00012  *   useful, but WITHOUT ANY WARRANTY; without even the implied warranty   *
00013  *   of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   *
00014  *   General Public License for more details.                              *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU General Public License     *
00017  *   along with this software. If not see <http://www.gnu.org/licenses/>.  *
00018  ***************************************************************************/
00019 #ifndef CONEXUSTTY_INTERFACE_H
00020 #define CONEXUSTTY_INTERFACE_H
00021 
00022 #include <conexus/pointer.h>
00023 #include <conexus/enums.h>
00024 
00025 #include <conexus/serial_interface.h>
00026 
00027 #include <termios.h>
00028 #include <unistd.h>
00029 
00030 namespace Conexus
00031 {
00032 
00036   class TTYInterface: public virtual SerialInterface
00037   {
00038     public:
00039 
00040       typedef ConexusPointer<TTYInterface> pointer;
00041 
00042       TTYInterface() { }
00043 
00044       virtual ~TTYInterface() { }
00045 
00049       virtual void drain() = 0;
00050 
00054       virtual void flush_input() = 0;
00055 
00059       virtual void flush_output() = 0;
00060 
00065       virtual void flush() = 0;
00066 
00070       virtual void suspend_output() = 0;
00071 
00075       virtual void restart_output() = 0;
00076 
00080       virtual void suspend_input() = 0;
00081 
00085       virtual void restart_input() = 0;
00086 
00124       virtual void set_input_speed( unsigned speed, SetOption option = SET_NOW ) = 0;
00125 
00127       virtual void set_output_speed( unsigned speed, SetOption option = SET_NOW ) = 0;
00128 
00130       virtual void set_speed( unsigned speed, SetOption option = SET_NOW ) = 0;
00131 
00133       virtual unsigned input_speed() = 0;
00134 
00136       virtual unsigned output_speed() = 0;
00137 
00139       virtual void set_parity( Parity parity, ParityError error = PARITY_ERROR_IGNORE, SetOption option = SET_NOW ) = 0;
00140 
00142       virtual Parity parity() = 0;
00143 
00145       virtual ParityError parity_error() = 0;
00146 
00148       virtual unsigned byte_size() = 0;
00149 
00159       virtual void set_byte_size( unsigned size, SetOption option = SET_NOW ) = 0;
00160 
00162       virtual unsigned stop_bits() = 0;
00163 
00165       virtual void set_stop_bits( unsigned size, SetOption option = SET_NOW ) = 0;
00166 
00168       virtual FlowControl flow_control() = 0;
00169 
00174       virtual void set_flow_control( FlowControl flowcontrol, SetOption option = SET_NOW ) = 0;
00175 
00177       virtual bool is_carrier_detect_enabled() = 0;
00178 
00187       virtual void enable_carrier_detect( bool enable = true, SetOption option = SET_NOW ) = 0;
00188 
00193       virtual bool is_receiver_enabled() = 0;
00194 
00199       virtual void enable_receiver( bool enable = true, SetOption option = SET_NOW ) = 0;
00200 
00201       virtual void open() = 0;
00202 
00204       virtual void open( const std::string& name, ReadWrite mode = READ_WRITE_UNCHANGED ) = 0;
00205 
00207       virtual void close( bool force = false ) = 0;
00208 
00212       virtual void inject( const std::string& buffer ) = 0;
00213 
00215       virtual bool is_reset_on_close_enabled() = 0;
00216 
00218       virtual void enable_reset_on_close( bool reset = true ) = 0;
00219 
00220       virtual sigc::signal<void>& signal_input_speed_changed() = 0;
00221       virtual sigc::signal<void>& signal_output_speed_changed() = 0;
00222       virtual sigc::signal<void>& signal_parity_changed() = 0;
00223       virtual sigc::signal<void>& signal_byte_size_changed() = 0;
00224       virtual sigc::signal<void>& signal_stop_bits_changed() = 0;
00225       virtual sigc::signal<void>& signal_flow_control_changed() = 0;
00226       virtual sigc::signal<void>& signal_carrier_detect_changed() = 0;
00227       virtual sigc::signal<void>& signal_receiver_changed() = 0;
00228 
00229   };
00230 
00231 }
00232 
00233 #endif

Generated on Wed Jul 8 15:50:08 2009 for conexus by doxygen 1.5.8