#include <serialIO.h>
Public Member Functions | |
void | closePort () |
void | enqueueData (std::vector< ioData_t > data) |
void | enqueueData (const char *data, size_t len) |
bool | isOpen () |
int | openPort (std::string devicestring, int baudrate) |
int | readData (std::string &value, size_t nBytes) |
bool | recover () |
int | sendData (std::string value) |
int | sendData (const char *data, size_t len) |
SerialIO () | |
void | start () |
void | stop () |
~SerialIO () | |
Private Member Functions | |
speed_t | getBaudFromInt (int baud) |
void | run () |
Private Attributes | |
int | _baudrate |
boost::condition_variable | _condition |
std::string | _device_string |
int | _fd |
boost::mutex | _mutex |
ConcurrentQueue< std::vector< struct ioData > > | _oQueue |
boost::shared_ptr< boost::thread > | _thread |
struct termios | port_settings |
Static Private Attributes | |
static const int | maxUpdateRate = 50 |
Definition at line 39 of file serialIO.h.
SerialIO::SerialIO | ( | ) |
Definition at line 25 of file serialIO.cpp.
SerialIO::~SerialIO | ( | ) |
Definition at line 30 of file serialIO.cpp.
void SerialIO::closePort | ( | ) |
Definition at line 152 of file serialIO.cpp.
void SerialIO::enqueueData | ( | std::vector< ioData_t > | data | ) |
Definition at line 130 of file serialIO.cpp.
void SerialIO::enqueueData | ( | const char * | data, |
size_t | len | ||
) |
Definition at line 135 of file serialIO.cpp.
|
private |
Definition at line 175 of file serialIO.cpp.
bool SerialIO::isOpen | ( | ) |
Definition at line 146 of file serialIO.cpp.
int SerialIO::openPort | ( | std::string | devicestring, |
int | baudrate | ||
) |
Definition at line 37 of file serialIO.cpp.
int SerialIO::readData | ( | std::string & | value, |
size_t | nBytes | ||
) |
Definition at line 83 of file serialIO.cpp.
bool SerialIO::recover | ( | ) |
Definition at line 161 of file serialIO.cpp.
|
private |
Definition at line 117 of file serialIO.cpp.
int SerialIO::sendData | ( | std::string | value | ) |
Definition at line 63 of file serialIO.cpp.
int SerialIO::sendData | ( | const char * | data, |
size_t | len | ||
) |
Definition at line 73 of file serialIO.cpp.
void SerialIO::start | ( | ) |
Definition at line 101 of file serialIO.cpp.
void SerialIO::stop | ( | ) |
Definition at line 107 of file serialIO.cpp.
|
private |
Definition at line 89 of file serialIO.h.
|
private |
Definition at line 80 of file serialIO.h.
|
private |
Definition at line 87 of file serialIO.h.
|
private |
Definition at line 83 of file serialIO.h.
|
private |
Definition at line 79 of file serialIO.h.
|
private |
Definition at line 76 of file serialIO.h.
|
private |
Definition at line 78 of file serialIO.h.
|
staticprivate |
Definition at line 94 of file serialIO.h.
|
private |
Definition at line 85 of file serialIO.h.