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);
85 struct timeval &timeout);
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
vrpn_SerialPort(const char *portname, long baud, int charsize=8, vrpn_SER_PARITY parity=vrpn_SER_PARITY_NONE)
Construct and open port.
void flush_output_buffer()
Throw out any characters (do not send) within the output buffer.
void close()
Close the serial port.
int read_available_characters(unsigned char *buffer, int count)
int write(std::string const &buffer)
void flush_input_buffer()
Throw out any characters within the input buffer.
void assign_rts(bool set)
void open(const char *portname, long baud, int charsize=8, vrpn_SER_PARITY parity=vrpn_SER_PARITY_NONE)
void drain_output_buffer()
Wait until all of the characters in the output buffer are sent, then return.
vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating system...