54 void open(
const char *portname,
long baud,
int charsize = 8,
67 int write(std::string
const &buffer);
68 int write(
const unsigned char *buffer,
int bytes);
76 int read_available_characters(
unsigned char *buffer,
int count);
80 std::string read_available_characters(
int count = -1);
84 int read_available_characters(
unsigned char *buffer,
int count,
85 struct timeval &timeout);
89 std::string read_available_characters(
int count,
struct timeval &timeout);
97 void flush_input_buffer();
101 void flush_output_buffer();
105 void drain_output_buffer();
118 void assign_rts(
bool set);
135 void requiresOpen()
const;
147 : std::logic_error(
"Tried to open a serial port that was already open.")
154 : std::logic_error(
"Tried to use a serial port that was not yet open.")
161 : std::runtime_error(
162 "Received an error when trying to open serial port.")
169 : std::runtime_error(
170 "Received an error when trying to close serial port.")
177 : std::runtime_error(
"Failed to modify serial port RTS status.")
184 : std::runtime_error(
"Failure on serial port read.")
191 : std::runtime_error(
"Failure on serial port write.")
198 : std::runtime_error(
"Failure on serial port flush.")
205 : std::runtime_error(
"Failure on serial port drain.")
222inline void vrpn_SerialPort::requiresOpen()
const
A simple class wrapping the functionality of vrpn_Serial.h with RAII, object-orientation,...
void assign_rts(bool set)
vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating system...