#include <tty_interface.h>
Public Types | |
typedef ConexusPointer < TTYInterface > | pointer |
Public Member Functions | |
TTYInterface () | |
virtual | ~TTYInterface () |
virtual void | drain ()=0 |
waits until all output written to the object has been transmitted. | |
virtual void | flush_input ()=0 |
discards data received but not read | |
virtual void | flush_output ()=0 |
discards data written to the object but not transmitted | |
virtual void | flush ()=0 |
discards both data written to the object but not transmitted and data received but not read | |
virtual void | suspend_output ()=0 |
Suspends transmission of data by the object. | |
virtual void | restart_output ()=0 |
Resumes transmission of data by the object. | |
virtual void | suspend_input ()=0 |
Suspends reception of data by the object. | |
virtual void | restart_input ()=0 |
Resumes reception of data by the object. | |
virtual void | set_input_speed (unsigned speed, SetOption option=SET_NOW)=0 |
Sets the input line speed. | |
virtual void | set_output_speed (unsigned speed, SetOption option=SET_NOW)=0 |
Sets the output line speed. | |
virtual void | set_speed (unsigned speed, SetOption option=SET_NOW)=0 |
Sets both the input and output line speeds. | |
virtual unsigned | input_speed ()=0 |
Returns the current input line speed. | |
virtual unsigned | output_speed ()=0 |
Returns the current output line speed. | |
virtual void | set_parity (Parity parity, ParityError error=PARITY_ERROR_IGNORE, SetOption option=SET_NOW)=0 |
Sets parity mode. | |
virtual Parity | parity ()=0 |
Returns the current parity mode. | |
virtual ParityError | parity_error ()=0 |
Returns the current parity error mode. | |
virtual unsigned | byte_size ()=0 |
Get the current byte size in bits. | |
virtual void | set_byte_size (unsigned size, SetOption option=SET_NOW)=0 |
Sets the communication byte size Valid values are:
| |
virtual unsigned | stop_bits ()=0 |
Get the number of stop bits (1 or 2). | |
virtual void | set_stop_bits (unsigned size, SetOption option=SET_NOW)=0 |
Sets the stop bits; only values of 1 or 2 will be processed, all others will be ignored. | |
virtual FlowControl | flow_control ()=0 |
Returns the flow control method. | |
virtual void | set_flow_control (FlowControl flowcontrol, SetOption option=SET_NOW)=0 |
Sets the flow control flags according to the flow control method specified. | |
virtual bool | is_carrier_detect_enabled ()=0 |
True if the hardware carrier detect (DCD) is enabled, false otherwise. | |
virtual void | enable_carrier_detect (bool enable=true, SetOption option=SET_NOW)=0 |
Enables or disables a hardware carrier detect. | |
virtual bool | is_receiver_enabled ()=0 |
True if the receive side is enabled, false otherwise. | |
virtual void | enable_receiver (bool enable=true, SetOption option=SET_NOW)=0 |
If true the receiver will be enabled, and if false it will be disabled and no characters can be received. | |
virtual void | open ()=0 |
virtual void | open (const std::string &name, ReadWrite mode=READ_WRITE_UNCHANGED)=0 |
Opens the TTY in the specified mode, storing the original terminal mode, to be restored on close. | |
virtual void | close (bool force=false)=0 |
Restores the original terminal modes on the tty. | |
virtual void | inject (const std::string &buffer)=0 |
Injects the input buffer into the input queue. | |
virtual bool | is_reset_on_close_enabled ()=0 |
True if the terminal will be reset to original characteristics on close. | |
virtual void | enable_reset_on_close (bool reset=true)=0 |
Set to true if the terminal should reset to original characteristics on close. | |
virtual sigc::signal< void > & | signal_input_speed_changed ()=0 |
virtual sigc::signal< void > & | signal_output_speed_changed ()=0 |
virtual sigc::signal< void > & | signal_parity_changed ()=0 |
virtual sigc::signal< void > & | signal_byte_size_changed ()=0 |
virtual sigc::signal< void > & | signal_stop_bits_changed ()=0 |
virtual sigc::signal< void > & | signal_flow_control_changed ()=0 |
virtual sigc::signal< void > & | signal_carrier_detect_changed ()=0 |
virtual sigc::signal< void > & | signal_receiver_changed ()=0 |
typedef ConexusPointer<TTYInterface> Conexus::TTYInterface::pointer |
Conexus::TTYInterface::TTYInterface | ( | ) | [inline] |
virtual Conexus::TTYInterface::~TTYInterface | ( | ) | [inline, virtual] |
virtual unsigned Conexus::TTYInterface::byte_size | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::close | ( | bool | force = false |
) | [pure virtual] |
virtual void Conexus::TTYInterface::drain | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::enable_carrier_detect | ( | bool | enable = true , |
|
SetOption | option = SET_NOW | |||
) | [pure virtual] |
Enables or disables a hardware carrier detect.
If hardware carrier detect is enabled and this is a blocking TTY, an open will block until a DCD signal is received from the hardware (useful for modems). If this is not enabled, the TTY will behave as if the DCD is always asserted. The hardware carrier flag should usually be turned on for modems and off for local devices.
Implemented in Conexus::TTY.
virtual void Conexus::TTYInterface::enable_receiver | ( | bool | enable = true , |
|
SetOption | option = SET_NOW | |||
) | [pure virtual] |
If true the receiver will be enabled, and if false it will be disabled and no characters can be received.
Implemented in Conexus::TTY.
virtual void Conexus::TTYInterface::enable_reset_on_close | ( | bool | reset = true |
) | [pure virtual] |
Set to true if the terminal should reset to original characteristics on close.
Implemented in Conexus::TTY.
virtual FlowControl Conexus::TTYInterface::flow_control | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::flush | ( | ) | [pure virtual] |
discards both data written to the object but not transmitted and data received but not read
Implemented in Conexus::TTY.
virtual void Conexus::TTYInterface::flush_input | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::flush_output | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::inject | ( | const std::string & | buffer | ) | [pure virtual] |
virtual unsigned Conexus::TTYInterface::input_speed | ( | ) | [pure virtual] |
virtual bool Conexus::TTYInterface::is_carrier_detect_enabled | ( | ) | [pure virtual] |
virtual bool Conexus::TTYInterface::is_receiver_enabled | ( | ) | [pure virtual] |
True if the receive side is enabled, false otherwise.
If false, this TTY cannot receive characters.
Implemented in Conexus::TTY.
virtual bool Conexus::TTYInterface::is_reset_on_close_enabled | ( | ) | [pure virtual] |
True if the terminal will be reset to original characteristics on close.
Implemented in Conexus::TTY.
virtual void Conexus::TTYInterface::open | ( | const std::string & | name, | |
ReadWrite | mode = READ_WRITE_UNCHANGED | |||
) | [pure virtual] |
Opens the TTY in the specified mode, storing the original terminal mode, to be restored on close.
Implements Conexus::SerialInterface.
Implemented in Conexus::TTY.
virtual void Conexus::TTYInterface::open | ( | ) | [pure virtual] |
virtual unsigned Conexus::TTYInterface::output_speed | ( | ) | [pure virtual] |
virtual Parity Conexus::TTYInterface::parity | ( | ) | [pure virtual] |
virtual ParityError Conexus::TTYInterface::parity_error | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::restart_input | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::restart_output | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::set_byte_size | ( | unsigned | size, | |
SetOption | option = SET_NOW | |||
) | [pure virtual] |
Sets the communication byte size Valid values are:
Implemented in Conexus::TTY.
virtual void Conexus::TTYInterface::set_flow_control | ( | FlowControl | flowcontrol, | |
SetOption | option = SET_NOW | |||
) | [pure virtual] |
Sets the flow control flags according to the flow control method specified.
If FLOW_CUSTOM is specified, no change will occur.
Implemented in Conexus::TTY.
virtual void Conexus::TTYInterface::set_input_speed | ( | unsigned | speed, | |
SetOption | option = SET_NOW | |||
) | [pure virtual] |
Sets the input line speed.
These are generally defined in /usr/include/bits/termios.h The following is the recognized list:
Implemented in Conexus::TTY.
virtual void Conexus::TTYInterface::set_output_speed | ( | unsigned | speed, | |
SetOption | option = SET_NOW | |||
) | [pure virtual] |
virtual void Conexus::TTYInterface::set_parity | ( | Parity | parity, | |
ParityError | error = PARITY_ERROR_IGNORE , |
|||
SetOption | option = SET_NOW | |||
) | [pure virtual] |
virtual void Conexus::TTYInterface::set_speed | ( | unsigned | speed, | |
SetOption | option = SET_NOW | |||
) | [pure virtual] |
virtual void Conexus::TTYInterface::set_stop_bits | ( | unsigned | size, | |
SetOption | option = SET_NOW | |||
) | [pure virtual] |
Sets the stop bits; only values of 1 or 2 will be processed, all others will be ignored.
Implemented in Conexus::TTY.
virtual sigc::signal<void>& Conexus::TTYInterface::signal_byte_size_changed | ( | ) | [pure virtual] |
Implemented in Conexus::TTY.
virtual sigc::signal<void>& Conexus::TTYInterface::signal_carrier_detect_changed | ( | ) | [pure virtual] |
Implemented in Conexus::TTY.
virtual sigc::signal<void>& Conexus::TTYInterface::signal_flow_control_changed | ( | ) | [pure virtual] |
Implemented in Conexus::TTY.
virtual sigc::signal<void>& Conexus::TTYInterface::signal_input_speed_changed | ( | ) | [pure virtual] |
Implemented in Conexus::TTY.
virtual sigc::signal<void>& Conexus::TTYInterface::signal_output_speed_changed | ( | ) | [pure virtual] |
Implemented in Conexus::TTY.
virtual sigc::signal<void>& Conexus::TTYInterface::signal_parity_changed | ( | ) | [pure virtual] |
Implemented in Conexus::TTY.
virtual sigc::signal<void>& Conexus::TTYInterface::signal_receiver_changed | ( | ) | [pure virtual] |
Implemented in Conexus::TTY.
virtual sigc::signal<void>& Conexus::TTYInterface::signal_stop_bits_changed | ( | ) | [pure virtual] |
Implemented in Conexus::TTY.
virtual unsigned Conexus::TTYInterface::stop_bits | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::suspend_input | ( | ) | [pure virtual] |
virtual void Conexus::TTYInterface::suspend_output | ( | ) | [pure virtual] |