diff --git a/docs/index.html b/docs/index.html index db189b9..58d0502 100644 --- a/docs/index.html +++ b/docs/index.html @@ -37,6 +37,7 @@
|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/bc_s.png b/docs/v1.0.1/bc_s.png
new file mode 100644
index 0000000..51ba006
Binary files /dev/null and b/docs/v1.0.1/bc_s.png differ
diff --git a/docs/v1.0.1/bdwn.png b/docs/v1.0.1/bdwn.png
new file mode 100644
index 0000000..d0b575b
Binary files /dev/null and b/docs/v1.0.1/bdwn.png differ
diff --git a/docs/v1.0.1/class_serial_1_1_scoped_read_lock.html b/docs/v1.0.1/class_serial_1_1_scoped_read_lock.html
new file mode 100644
index 0000000..b9517fa
--- /dev/null
+++ b/docs/v1.0.1/class_serial_1_1_scoped_read_lock.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+Public Member Functions | |
| ScopedReadLock (SerialImpl *pimpl) | |
| ~ScopedReadLock () | |
| serial::Serial::ScopedReadLock::ScopedReadLock | +( | +SerialImpl * | +pimpl | ) | + [inline] |
+
: pimpl_(pimpl) {
+ this->pimpl_->readLock();
+ }
+| serial::Serial::ScopedReadLock::~ScopedReadLock | +( | +) | + [inline] |
+
{
+ this->pimpl_->readUnlock();
+ }
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/class_serial_1_1_scoped_write_lock.html b/docs/v1.0.1/class_serial_1_1_scoped_write_lock.html
new file mode 100644
index 0000000..ee56ce7
--- /dev/null
+++ b/docs/v1.0.1/class_serial_1_1_scoped_write_lock.html
@@ -0,0 +1,166 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+Public Member Functions | |
| ScopedWriteLock (SerialImpl *pimpl) | |
| ~ScopedWriteLock () | |
| serial::Serial::ScopedWriteLock::ScopedWriteLock | +( | +SerialImpl * | +pimpl | ) | + [inline] |
+
: pimpl_(pimpl) {
+ this->pimpl_->writeLock();
+ }
+| serial::Serial::ScopedWriteLock::~ScopedWriteLock | +( | +) | + [inline] |
+
{
+ this->pimpl_->writeUnlock();
+ }
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/classes.html b/docs/v1.0.1/classes.html
new file mode 100644
index 0000000..c3d41ea
--- /dev/null
+++ b/docs/v1.0.1/classes.html
@@ -0,0 +1,123 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
|
| Serial (serial) | |||
| SerialExecption (serial) | |||||
| IOException (serial) | Serial::ScopedReadLock | SerialImpl (serial::serial::Serial) | |||
| Serial::ScopedWriteLock |
| |||
| PortNotOpenedException (serial) | Timeout (serial) | ||||
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/classserial_1_1_i_o_exception.html b/docs/v1.0.1/classserial_1_1_i_o_exception.html
new file mode 100644
index 0000000..7fa76db
--- /dev/null
+++ b/docs/v1.0.1/classserial_1_1_i_o_exception.html
@@ -0,0 +1,280 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
#include <serial.h>
+Public Member Functions | |
| IOException (std::string file, int line, int errnum) | |
| IOException (std::string file, int line, const char *description) | |
| virtual | ~IOException () throw () |
| IOException (const IOException &other) | |
| int | getErrorNumber () |
| virtual const char * | what () const throw () |
| serial::IOException::IOException | +( | +std::string | +file, | +
| + | + | int | +line, | +
| + | + | int | +errnum | +
| + | ) | + [inline, explicit] |
+
: file_(file), line_(line), e_what_ (strerror (errnum)), errno_(errnum) {}
+| serial::IOException::IOException | +( | +std::string | +file, | +
| + | + | int | +line, | +
| + | + | const char * | +description | +
| + | ) | + [inline, explicit] |
+
: file_(file), line_(line), e_what_ (description), errno_(0) {}
+| virtual serial::IOException::~IOException | +( | +) | + throw () [inline, virtual] |
+
{}
+| serial::IOException::IOException | +( | +const IOException & | +other | ) | + [inline] |
+
{
+ e_what_ = other.e_what_;
+ }
+| int serial::IOException::getErrorNumber | +( | +) | + [inline] |
+
{ return errno_; }
+| virtual const char* serial::IOException::what | +( | +) | + const throw () [inline, virtual] |
+
{
+ std::stringstream ss;
+ if (errno_ == 0)
+ ss << "IO Exception: " << e_what_;
+ else
+ ss << "IO Exception (" << errno_ << "): " << e_what_;
+ ss << ", file " << file_ << ", line " << line_ << ".";
+ return ss.str ().c_str ();
+ }
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/classserial_1_1_port_not_opened_exception.html b/docs/v1.0.1/classserial_1_1_port_not_opened_exception.html
new file mode 100644
index 0000000..a204408
--- /dev/null
+++ b/docs/v1.0.1/classserial_1_1_port_not_opened_exception.html
@@ -0,0 +1,189 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
#include <serial.h>
+Public Member Functions | |
| PortNotOpenedException (const char *description) | |
| PortNotOpenedException (const PortNotOpenedException &other) | |
| virtual const char * | what () const throw () |
| serial::PortNotOpenedException::PortNotOpenedException | +( | +const char * | +description | ) | + [inline] |
+
: e_what_ (description) {}
+| serial::PortNotOpenedException::PortNotOpenedException | +( | +const PortNotOpenedException & | +other | ) | + [inline] |
+
{
+ e_what_ = other.e_what_;
+ }
+| virtual const char* serial::PortNotOpenedException::what | +( | +) | + const throw () [inline, virtual] |
+
{
+ std::stringstream ss;
+ ss << e_what_ << " called before port was opened.";
+ return ss.str ().c_str ();
+ }
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/classserial_1_1_serial.html b/docs/v1.0.1/classserial_1_1_serial.html
new file mode 100644
index 0000000..cb45f5b
--- /dev/null
+++ b/docs/v1.0.1/classserial_1_1_serial.html
@@ -0,0 +1,1532 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
#include <serial.h>
+Data Structures | |
| class | ScopedReadLock |
| class | ScopedWriteLock |
+Public Member Functions | |
| Serial (const std::string &port="", uint32_t baudrate=9600, Timeout timeout=Timeout(), bytesize_t bytesize=eightbits, parity_t parity=parity_none, stopbits_t stopbits=stopbits_one, flowcontrol_t flowcontrol=flowcontrol_none) | |
| virtual | ~Serial () |
| void | open () |
| bool | isOpen () const |
| void | close () |
| size_t | available () |
| size_t | read (uint8_t *buffer, size_t size) |
| size_t | read (std::vector< uint8_t > &buffer, size_t size=1) |
| size_t | read (std::string &buffer, size_t size=1) |
| std::string | read (size_t size=1) |
| size_t | readline (std::string &buffer, size_t size=65536, std::string eol="\n") |
| std::string | readline (size_t size=65536, std::string eol="\n") |
| std::vector< std::string > | readlines (size_t size=65536, std::string eol="\n") |
| size_t | write (const uint8_t *data, size_t size) |
| size_t | write (const std::vector< uint8_t > &data) |
| size_t | write (const std::string &data) |
| void | setPort (const std::string &port) |
| std::string | getPort () const |
| void | setTimeout (Timeout &timeout) |
| void | setTimeout (uint32_t inter_byte_timeout, uint32_t read_timeout_constant, uint32_t read_timeout_multiplier, uint32_t write_timeout_constant, uint32_t write_timeout_multiplier) |
| Timeout | getTimeout () const |
| void | setBaudrate (uint32_t baudrate) |
| uint32_t | getBaudrate () const |
| void | setBytesize (bytesize_t bytesize) |
| bytesize_t | getBytesize () const |
| void | setParity (parity_t parity) |
| parity_t | getParity () const |
| void | setStopbits (stopbits_t stopbits) |
| stopbits_t | getStopbits () const |
| void | setFlowcontrol (flowcontrol_t flowcontrol) |
| flowcontrol_t | getFlowcontrol () const |
| void | flush () |
| void | flushInput () |
| void | flushOutput () |
| void | sendBreak (int duration) |
| void | setBreak (bool level=true) |
| void | setRTS (bool level=true) |
| void | setDTR (bool level=true) |
| bool | waitForChange () |
| bool | getCTS () |
| bool | getDSR () |
| bool | getRI () |
| bool | getCD () |
Class that provides a portable serial port interface.
+| serial::Serial::Serial | +( | +const std::string & | +port = "", |
+
| + | + | uint32_t | +baudrate = 9600, |
+
| + | + | Timeout | +timeout = Timeout(), |
+
| + | + | bytesize_t | +bytesize = eightbits, |
+
| + | + | parity_t | +parity = parity_none, |
+
| + | + | stopbits_t | +stopbits = stopbits_one, |
+
| + | + | flowcontrol_t | +flowcontrol = flowcontrol_none |
+
| + | ) | ++ |
Creates a Serial object and opens the port if a port is specified, otherwise it remains closed until serial::Serial::open is called.
+| port | A std::string containing the address of the serial port, which would be something like 'COM1' on Windows and '/dev/ttyS0' on Linux. |
| baudrate | An unsigned 32-bit integer that represents the baudrate |
| timeout | A serial::Timeout struct that defines the timeout conditions for the serial port. |
| bytesize | Size of each byte in the serial transmission of data, default is eightbits, possible values are: fivebits, sixbits, sevenbits, eightbits |
| parity | Method of parity, default is parity_none, possible values are: parity_none, parity_odd, parity_even |
| stopbits | Number of stop bits used, default is stopbits_one, possible values are: stopbits_one, stopbits_one_point_five, stopbits_two |
| flowcontrol | Type of flowcontrol used, default is flowcontrol_none, possible values are: flowcontrol_none, flowcontrol_software, flowcontrol_hardware |
| PortNotOpenedException |
| Serial::~Serial | +( | +) | + [virtual] |
+
Destructor
+{
+ delete pimpl_;
+}
+| size_t Serial::available | +( | +) | ++ |
Return the number of characters in the buffer.
+{
+ return pimpl_->available ();
+}
+| void Serial::close | +( | +) | ++ |
Closes the serial port.
+{
+ pimpl_->close ();
+}
+| void Serial::flush | +( | +) | ++ |
Flush the input and output buffers
+{
+ ScopedReadLock(this->pimpl_);
+ ScopedWriteLock(this->pimpl_);
+ pimpl_->flush ();
+ read_cache_.clear ();
+}
+| void Serial::flushInput | +( | +) | ++ |
Flush only the input buffer
+{
+ ScopedReadLock(this->pimpl_);
+ pimpl_->flushInput ();
+}
+| void Serial::flushOutput | +( | +) | ++ |
Flush only the output buffer
+{
+ ScopedWriteLock(this->pimpl_);
+ pimpl_->flushOutput ();
+ read_cache_.clear ();
+}
+| uint32_t Serial::getBaudrate | +( | +) | +const | +
Gets the baudrate for the serial port.
+| InvalidConfigurationException |
{
+ return uint32_t(pimpl_->getBaudrate ());
+}
+| bytesize_t Serial::getBytesize | +( | +) | +const | +
Gets the bytesize for the serial port.
+| InvalidConfigurationException |
{
+ return pimpl_->getBytesize ();
+}
+| bool Serial::getCD | +( | +) | ++ |
Returns the current status of the CD line.
+{
+ return pimpl_->getCD ();
+}
+| bool Serial::getCTS | +( | +) | ++ |
Returns the current status of the CTS line.
+{
+ return pimpl_->getCTS ();
+}
+| bool Serial::getDSR | +( | +) | ++ |
Returns the current status of the DSR line.
+{
+ return pimpl_->getDSR ();
+}
+| flowcontrol_t Serial::getFlowcontrol | +( | +) | +const | +
Gets the flow control for the serial port.
+| InvalidConfigurationException |
{
+ return pimpl_->getFlowcontrol ();
+}
+| parity_t Serial::getParity | +( | +) | +const | +
Gets the parity for the serial port.
+| InvalidConfigurationException |
{
+ return pimpl_->getParity ();
+}
+| string Serial::getPort | +( | +) | +const | +
Gets the serial port identifier.
+| InvalidConfigurationException |
{
+ return pimpl_->getPort ();
+}
+| bool Serial::getRI | +( | +) | ++ |
Returns the current status of the RI line.
+{
+ return pimpl_->getRI ();
+}
+| stopbits_t Serial::getStopbits | +( | +) | +const | +
Gets the stopbits for the serial port.
+| InvalidConfigurationException |
{
+ return pimpl_->getStopbits ();
+}
+| serial::Timeout Serial::getTimeout | +( | +) | +const | +
Gets the timeout for reads in seconds.
+ {
+ return pimpl_->getTimeout ();
+}
+| bool Serial::isOpen | +( | +) | +const | +
Gets the open status of the serial port.
+{
+ return pimpl_->isOpen ();
+}
+| void Serial::open | +( | +) | ++ |
Opens the serial port as long as the port is set and the port isn't already open.
+If the port is provided to the constructor then an explicit call to open is not needed.
+| std::invalid_argument | |
| serial::SerialExecption | |
| serial::IOException |
{
+ pimpl_->open ();
+}
+| size_t Serial::read | +( | +uint8_t * | +buffer, | +
| + | + | size_t | +size | +
| + | ) | ++ |
Read a given amount of bytes from the serial port into a given buffer.
+The read function will return in one of three cases:
+| buffer | An uint8_t array of at least the requested size. |
| size | A size_t defining how many bytes to be read. |
{
+ ScopedReadLock (this->pimpl_);
+ return this->pimpl_->read (buffer, size);
+}
+| size_t Serial::read | +( | +std::vector< uint8_t > & | +buffer, | +
| + | + | size_t | +size = 1 |
+
| + | ) | ++ |
Read a given amount of bytes from the serial port into a give buffer.
+| buffer | A reference to a std::vector of uint8_t. |
| size | A size_t defining how many bytes to be read. |
{
+ ScopedReadLock (this->pimpl_);
+ uint8_t *buffer_ = new uint8_t[size];
+ size_t bytes_read = this->pimpl_->read (buffer_, size);
+ buffer.insert (buffer.end (), buffer_, buffer_+bytes_read);
+ delete[] buffer_;
+ return bytes_read;
+}
+| size_t Serial::read | +( | +std::string & | +buffer, | +
| + | + | size_t | +size = 1 |
+
| + | ) | ++ |
Read a given amount of bytes from the serial port into a give buffer.
+| buffer | A reference to a std::string. |
| size | A size_t defining how many bytes to be read. |
{
+ ScopedReadLock (this->pimpl_);
+ uint8_t *buffer_ = new uint8_t[size];
+ size_t bytes_read = this->pimpl_->read (buffer_, size);
+ buffer.append (reinterpret_cast<const char*>(buffer_), bytes_read);
+ delete[] buffer_;
+ return bytes_read;
+}
+| string Serial::read | +( | +size_t | +size = 1 | ) | ++ |
Read a given amount of bytes from the serial port and return a string containing the data.
+| size | A size_t defining how many bytes to be read. |
{
+ std::string buffer;
+ this->read (buffer, size);
+ return buffer;
+}
+| size_t serial::Serial::readline | +( | +std::string & | +buffer, | +
| + | + | size_t | +size = 65536, |
+
| + | + | std::string | +eol = "\n" |
+
| + | ) | ++ |
Reads in a line or until a given delimiter has been processed.
+Reads from the serial port until a single line has been read.
+| buffer | A std::string reference used to store the data. |
| size | A maximum length of a line, defaults to 65536 (2^16) |
| eol | A string to match against for the EOL. |
| std::string serial::Serial::readline | +( | +size_t | +size = 65536, |
+
| + | + | std::string | +eol = "\n" |
+
| + | ) | ++ |
Reads in a line or until a given delimiter has been processed.
+Reads from the serial port until a single line has been read.
+| size | A maximum length of a line, defaults to 65536 (2^16) |
| eol | A string to match against for the EOL. |
| vector< string > Serial::readlines | +( | +size_t | +size = 65536, |
+
| + | + | std::string | +eol = "\n" |
+
| + | ) | ++ |
Reads in multiple lines until the serial port times out.
+This requires a timeout > 0 before it can be run. It will read until a timeout occurs and return a list of strings.
+| size | A maximum length of combined lines, defaults to 65536 (2^16) |
| eol | A string to match against for the EOL. |
{
+ ScopedReadLock (this->pimpl_);
+ std::vector<std::string> lines;
+ size_t eol_len = eol.length ();
+ uint8_t *buffer_ = static_cast<uint8_t*>
+ (alloca (size * sizeof (uint8_t)));
+ size_t read_so_far = 0;
+ size_t start_of_line = 0;
+ while (read_so_far < size) {
+ size_t bytes_read = this->read_ (buffer_+read_so_far, 1);
+ read_so_far += bytes_read;
+ if (bytes_read == 0) {
+ if (start_of_line != read_so_far) {
+ lines.push_back (
+ string (reinterpret_cast<const char*> (buffer_ + start_of_line),
+ read_so_far - start_of_line));
+ }
+ break; // Timeout occured on reading 1 byte
+ }
+ if (string (reinterpret_cast<const char*>
+ (buffer_ + read_so_far - eol_len), eol_len) == eol) {
+ // EOL found
+ lines.push_back(
+ string(reinterpret_cast<const char*> (buffer_ + start_of_line),
+ read_so_far - start_of_line));
+ start_of_line = read_so_far;
+ }
+ if (read_so_far == size) {
+ if (start_of_line != read_so_far) {
+ lines.push_back(
+ string(reinterpret_cast<const char*> (buffer_ + start_of_line),
+ read_so_far - start_of_line));
+ }
+ break; // Reached the maximum read length
+ }
+ }
+ return lines;
+}
+| void Serial::sendBreak | +( | +int | +duration | ) | ++ |
Sends the RS-232 break signal. See tcsendbreak(3).
+{
+ pimpl_->sendBreak (duration);
+}
+| void Serial::setBaudrate | +( | +uint32_t | +baudrate | ) | ++ |
Sets the baudrate for the serial port.
+Possible baudrates depends on the system but some safe baudrates include: 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 56000, 57600, 115200 Some other baudrates that are supported by some comports: 128000, 153600, 230400, 256000, 460800, 921600
+| baudrate | An integer that sets the baud rate for the serial port. |
| InvalidConfigurationException |
{
+ pimpl_->setBaudrate (baudrate);
+}
+| void Serial::setBreak | +( | +bool | +level = true | ) | ++ |
Set the break condition to a given level. Defaults to true.
+{
+ pimpl_->setBreak (level);
+}
+| void Serial::setBytesize | +( | +bytesize_t | +bytesize | ) | ++ |
Sets the bytesize for the serial port.
+| bytesize | Size of each byte in the serial transmission of data, default is eightbits, possible values are: fivebits, sixbits, sevenbits, eightbits |
| InvalidConfigurationException |
{
+ pimpl_->setBytesize (bytesize);
+}
+| void Serial::setDTR | +( | +bool | +level = true | ) | ++ |
Set the DTR handshaking line to the given level. Defaults to true.
+{
+ pimpl_->setDTR (level);
+}
+| void Serial::setFlowcontrol | +( | +flowcontrol_t | +flowcontrol | ) | ++ |
Sets the flow control for the serial port.
+| flowcontrol | Type of flowcontrol used, default is flowcontrol_none, possible values are: flowcontrol_none, flowcontrol_software, flowcontrol_hardware |
| InvalidConfigurationException |
{
+ pimpl_->setFlowcontrol (flowcontrol);
+}
+| void Serial::setParity | +( | +parity_t | +parity | ) | ++ |
Sets the parity for the serial port.
+| parity | Method of parity, default is parity_none, possible values are: parity_none, parity_odd, parity_even |
| InvalidConfigurationException |
{
+ pimpl_->setParity (parity);
+}
+| void Serial::setPort | +( | +const std::string & | +port | ) | ++ |
Sets the serial port identifier.
+| port | A const std::string reference containing the address of the serial port, which would be something like 'COM1' on Windows and '/dev/ttyS0' on Linux. |
| InvalidConfigurationException |
| void Serial::setRTS | +( | +bool | +level = true | ) | ++ |
Set the RTS handshaking line to the given level. Defaults to true.
+{
+ pimpl_->setRTS (level);
+}
+| void Serial::setStopbits | +( | +stopbits_t | +stopbits | ) | ++ |
Sets the stopbits for the serial port.
+| stopbits | Number of stop bits used, default is stopbits_one, possible values are: stopbits_one, stopbits_one_point_five, stopbits_two |
| InvalidConfigurationException |
{
+ pimpl_->setStopbits (stopbits);
+}
+| void Serial::setTimeout | +( | +serial::Timeout & | +timeout | ) | ++ |
Sets the timeout for reads and writes using the Timeout struct.
+There are two timeout conditions described here:
+Read and write functions will return in one of three cases. When the reading or writing is complete, when a timeout occurs, or when an exception occurs.
+| timeout | A serial::Timeout struct containing the inter byte timeout, and the read and write timeout constants and multipliers. |
{
+ pimpl_->setTimeout (timeout);
+}
+| void serial::Serial::setTimeout | +( | +uint32_t | +inter_byte_timeout, | +
| + | + | uint32_t | +read_timeout_constant, | +
| + | + | uint32_t | +read_timeout_multiplier, | +
| + | + | uint32_t | +write_timeout_constant, | +
| + | + | uint32_t | +write_timeout_multiplier | +
| + | ) | + [inline] |
+
Sets the timeout for reads and writes.
+ {
+ Timeout timeout(inter_byte_timeout, read_timeout_constant,
+ read_timeout_multiplier, write_timeout_constant,
+ write_timeout_multiplier);
+ return setTimeout(timeout);
+ }
+| bool Serial::waitForChange | +( | +) | ++ |
Blocks until CTS, DSR, RI, CD changes or something interrupts it.
+Can throw an exception if an error occurs while waiting. You can check the status of CTS, DSR, RI, and CD once this returns. Uses TIOCMIWAIT via ioctl if available (mostly only on Linux) with a resolution of less than +-1ms and as good as +-0.2ms. Otherwise a polling method is used which can give +-2ms.
+| SerialException |
{
+ return pimpl_->waitForChange();
+}
+| size_t Serial::write | +( | +const uint8_t * | +data, | +
| + | + | size_t | +size | +
| + | ) | ++ |
Write a string to the serial port.
+| data | A const reference containing the data to be written to the serial port. |
| size | A size_t that indicates how many bytes should be written from the given data buffer. |
{
+ ScopedWriteLock(this->pimpl_);
+ return this->write_(data, size);
+}
+| size_t Serial::write | +( | +const std::vector< uint8_t > & | +data | ) | ++ |
Write a string to the serial port.
+| data | A const reference containing the data to be written to the serial port. |
{
+ ScopedWriteLock(this->pimpl_);
+ return this->write_ (&data[0], data.size());
+}
+| size_t serial::Serial::write | +( | +const std::string & | +data | ) | ++ |
Write a string to the serial port.
+| data | A const reference containing the data to be written to the serial port. |
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/classserial_1_1_serial_execption.html b/docs/v1.0.1/classserial_1_1_serial_execption.html
new file mode 100644
index 0000000..12fad21
--- /dev/null
+++ b/docs/v1.0.1/classserial_1_1_serial_execption.html
@@ -0,0 +1,189 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
#include <serial.h>
+Public Member Functions | |
| SerialExecption (const char *description) | |
| SerialExecption (const SerialExecption &other) | |
| virtual const char * | what () const throw () |
| serial::SerialExecption::SerialExecption | +( | +const char * | +description | ) | + [inline] |
+
: e_what_ (description) {}
+| serial::SerialExecption::SerialExecption | +( | +const SerialExecption & | +other | ) | + [inline] |
+
{
+ e_what_ = other.e_what_;
+ }
+| virtual const char* serial::SerialExecption::what | +( | +) | + const throw () [inline, virtual] |
+
{
+ std::stringstream ss;
+ ss << "SerialException " << e_what_ << " failed.";
+ return ss.str ().c_str ();
+ }
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/classserial_1_1serial_1_1_serial_1_1_serial_impl.html b/docs/v1.0.1/classserial_1_1serial_1_1_serial_1_1_serial_impl.html
new file mode 100644
index 0000000..92eaff6
--- /dev/null
+++ b/docs/v1.0.1/classserial_1_1serial_1_1_serial_1_1_serial_impl.html
@@ -0,0 +1,2148 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
#include <unix.h>
+Public Member Functions | |
| SerialImpl (const string &port, unsigned long baudrate, bytesize_t bytesize, parity_t parity, stopbits_t stopbits, flowcontrol_t flowcontrol) | |
| virtual | ~SerialImpl () |
| void | open () |
| void | close () |
| bool | isOpen () const |
| size_t | available () |
| size_t | read (uint8_t *buf, size_t size=1) |
| size_t | write (const uint8_t *data, size_t length) |
| void | flush () |
| void | flushInput () |
| void | flushOutput () |
| void | sendBreak (int duration) |
| void | setBreak (bool level) |
| void | setRTS (bool level) |
| void | setDTR (bool level) |
| bool | waitForChange () |
| bool | getCTS () |
| bool | getDSR () |
| bool | getRI () |
| bool | getCD () |
| void | setPort (const string &port) |
| string | getPort () const |
| void | setTimeout (Timeout &timeout) |
| Timeout | getTimeout () const |
| void | setBaudrate (unsigned long baudrate) |
| unsigned long | getBaudrate () const |
| void | setBytesize (bytesize_t bytesize) |
| bytesize_t | getBytesize () const |
| void | setParity (parity_t parity) |
| parity_t | getParity () const |
| void | setStopbits (stopbits_t stopbits) |
| stopbits_t | getStopbits () const |
| void | setFlowcontrol (flowcontrol_t flowcontrol) |
| flowcontrol_t | getFlowcontrol () const |
| void | readLock () |
| void | readUnlock () |
| void | writeLock () |
| void | writeUnlock () |
| SerialImpl (const string &port, unsigned long baudrate, bytesize_t bytesize, parity_t parity, stopbits_t stopbits, flowcontrol_t flowcontrol) | |
| virtual | ~SerialImpl () |
| void | open () |
| void | close () |
| bool | isOpen () const |
| size_t | available () |
| size_t | read (uint8_t *buf, size_t size=1) |
| size_t | write (const uint8_t *data, size_t length) |
| void | flush () |
| void | flushInput () |
| void | flushOutput () |
| void | sendBreak (int duration) |
| void | setBreak (bool level) |
| void | setRTS (bool level) |
| void | setDTR (bool level) |
| bool | waitForChange () |
| bool | getCTS () |
| bool | getDSR () |
| bool | getRI () |
| bool | getCD () |
| void | setPort (const string &port) |
| string | getPort () const |
| void | setTimeout (Timeout &timeout) |
| Timeout | getTimeout () const |
| void | setBaudrate (unsigned long baudrate) |
| unsigned long | getBaudrate () const |
| void | setBytesize (bytesize_t bytesize) |
| bytesize_t | getBytesize () const |
| void | setParity (parity_t parity) |
| parity_t | getParity () const |
| void | setStopbits (stopbits_t stopbits) |
| stopbits_t | getStopbits () const |
| void | setFlowcontrol (flowcontrol_t flowcontrol) |
| flowcontrol_t | getFlowcontrol () const |
| void | readLock () |
| void | readUnlock () |
| void | writeLock () |
| void | writeUnlock () |
+Protected Member Functions | |
| void | reconfigurePort () |
| void | reconfigurePort () |
| serial::serial::Serial::SerialImpl::SerialImpl | +( | +const string & | +port, | +
| + | + | unsigned long | +baudrate, | +
| + | + | bytesize_t | +bytesize, | +
| + | + | parity_t | +parity, | +
| + | + | stopbits_t | +stopbits, | +
| + | + | flowcontrol_t | +flowcontrol | +
| + | ) | ++ |
| virtual serial::serial::Serial::SerialImpl::~SerialImpl | +( | +) | + [virtual] |
+
| Serial::SerialImpl::SerialImpl | +( | +const string & | +port, | +
| + | + | unsigned long | +baudrate, | +
| + | + | bytesize_t | +bytesize, | +
| + | + | parity_t | +parity, | +
| + | + | stopbits_t | +stopbits, | +
| + | + | flowcontrol_t | +flowcontrol | +
| + | ) | ++ |
: port_ (port), fd_ (-1), is_open_ (false), xonxoff_ (false), rtscts_ (false), + baudrate_ (baudrate), parity_ (parity), + bytesize_ (bytesize), stopbits_ (stopbits), flowcontrol_ (flowcontrol) +{ + pthread_mutex_init(&this->read_mutex, NULL); + pthread_mutex_init(&this->write_mutex, NULL); + if (port_.empty () == false) + open (); +} +
| Serial::SerialImpl::~SerialImpl | +( | +) | + [virtual] |
+
{
+ close();
+ pthread_mutex_destroy(&this->read_mutex);
+ pthread_mutex_destroy(&this->write_mutex);
+}
+| size_t Serial::SerialImpl::available | +( | +) | ++ |
{
+ if (!is_open_) {
+ return 0;
+ }
+ int count = 0;
+ int result = ioctl (fd_, TIOCINQ, &count);
+ if (result == 0) {
+ return static_cast<size_t> (count);
+ } else {
+ THROW (IOException, errno);
+ }
+}
+| size_t serial::serial::Serial::SerialImpl::available | +( | +) | ++ |
| void Serial::SerialImpl::close | +( | +) | ++ |
{
+ if (is_open_ == true) {
+ if (fd_ != -1) {
+ ::close (fd_); // Ignoring the outcome
+ fd_ = -1;
+ }
+ is_open_ = false;
+ }
+}
+| void serial::serial::Serial::SerialImpl::close | +( | +) | ++ |
| void Serial::SerialImpl::flush | +( | +) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::flush");
+ }
+ tcdrain (fd_);
+}
+| void serial::serial::Serial::SerialImpl::flush | +( | +) | ++ |
| void Serial::SerialImpl::flushInput | +( | +) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::flushInput");
+ }
+ tcflush (fd_, TCIFLUSH);
+}
+| void serial::serial::Serial::SerialImpl::flushInput | +( | +) | ++ |
| void Serial::SerialImpl::flushOutput | +( | +) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::flushOutput");
+ }
+ tcflush (fd_, TCOFLUSH);
+}
+| void serial::serial::Serial::SerialImpl::flushOutput | +( | +) | ++ |
| unsigned long serial::serial::Serial::SerialImpl::getBaudrate | +( | +) | +const | +
| unsigned long serial::serial::Serial::SerialImpl::getBaudrate | +( | +) | +const | +
| bytesize_t serial::serial::Serial::SerialImpl::getBytesize | +( | +) | +const | +
| bytesize_t serial::serial::Serial::SerialImpl::getBytesize | +( | +) | +const | +
| bool Serial::SerialImpl::getCD | +( | +) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::getCD");
+ }
+ int s = ioctl (fd_, TIOCMGET, 0);
+ return (s & TIOCM_CD) != 0;
+}
+| bool serial::serial::Serial::SerialImpl::getCD | +( | +) | ++ |
| bool Serial::SerialImpl::getCTS | +( | +) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::getCTS");
+ }
+ int s = ioctl (fd_, TIOCMGET, 0);
+ return (s & TIOCM_CTS) != 0;
+}
+| bool serial::serial::Serial::SerialImpl::getCTS | +( | +) | ++ |
| bool Serial::SerialImpl::getDSR | +( | +) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::getDSR");
+ }
+ int s = ioctl (fd_, TIOCMGET, 0);
+ return (s & TIOCM_DSR) != 0;
+}
+| bool serial::serial::Serial::SerialImpl::getDSR | +( | +) | ++ |
| flowcontrol_t serial::serial::Serial::SerialImpl::getFlowcontrol | +( | +) | +const | +
| flowcontrol_t serial::serial::Serial::SerialImpl::getFlowcontrol | +( | +) | +const | +
| parity_t serial::serial::Serial::SerialImpl::getParity | +( | +) | +const | +
| parity_t serial::serial::Serial::SerialImpl::getParity | +( | +) | +const | +
| string serial::serial::Serial::SerialImpl::getPort | +( | +) | +const | +
| string serial::serial::Serial::SerialImpl::getPort | +( | +) | +const | +
| bool Serial::SerialImpl::getRI | +( | +) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::getRI");
+ }
+ int s = ioctl (fd_, TIOCMGET, 0);
+ return (s & TIOCM_RI) != 0;
+}
+| bool serial::serial::Serial::SerialImpl::getRI | +( | +) | ++ |
| stopbits_t serial::serial::Serial::SerialImpl::getStopbits | +( | +) | +const | +
| stopbits_t serial::serial::Serial::SerialImpl::getStopbits | +( | +) | +const | +
| Timeout serial::serial::Serial::SerialImpl::getTimeout | +( | +) | +const | +
| Timeout serial::serial::Serial::SerialImpl::getTimeout | +( | +) | +const | +
| bool serial::serial::Serial::SerialImpl::isOpen | +( | +) | +const | +
| bool serial::serial::Serial::SerialImpl::isOpen | +( | +) | +const | +
| void Serial::SerialImpl::open | +( | +) | ++ |
{
+ if (port_.empty ()) {
+ throw invalid_argument ("Empty port is invalid.");
+ }
+ if (is_open_ == true) {
+ throw SerialExecption ("Serial port already open.");
+ }
+
+ fd_ = ::open (port_.c_str(), O_RDWR | O_NOCTTY | O_NONBLOCK);
+
+ if (fd_ == -1) {
+ switch (errno) {
+ case EINTR:
+ // Recurse because this is a recoverable error.
+ open ();
+ return;
+ case ENFILE:
+ case EMFILE:
+ THROW (IOException, "Too many file handles open.");
+ default:
+ THROW (IOException, errno);
+ }
+ }
+
+ reconfigurePort();
+ is_open_ = true;
+}
+| void serial::serial::Serial::SerialImpl::open | +( | +) | ++ |
| size_t serial::serial::Serial::SerialImpl::read | +( | +uint8_t * | +buf, | +
| + | + | size_t | +size = 1 |
+
| + | ) | ++ |
| size_t serial::serial::Serial::SerialImpl::read | +( | +uint8_t * | +buf, | +
| + | + | size_t | +size = 1 |
+
| + | ) | ++ |
| void Serial::SerialImpl::readLock | +( | +) | ++ |
{
+ int result = pthread_mutex_lock(&this->read_mutex);
+ if (result) {
+ THROW (IOException, result);
+ }
+}
+| void serial::serial::Serial::SerialImpl::readLock | +( | +) | ++ |
| void Serial::SerialImpl::readUnlock | +( | +) | ++ |
{
+ int result = pthread_mutex_unlock(&this->read_mutex);
+ if (result) {
+ THROW (IOException, result);
+ }
+}
+| void serial::serial::Serial::SerialImpl::readUnlock | +( | +) | ++ |
| void Serial::SerialImpl::reconfigurePort | +( | +) | + [protected] |
+
{
+ if (fd_ == -1) {
+ // Can only operate on a valid file descriptor
+ THROW (IOException, "Invalid file descriptor, is the serial port open?");
+ }
+
+ struct termios options; // The options for the file descriptor
+
+ if (tcgetattr(fd_, &options) == -1) {
+ THROW (IOException, "::tcgetattr");
+ }
+
+ // set up raw mode / no echo / binary
+ options.c_cflag |= (tcflag_t) (CLOCAL | CREAD);
+ options.c_lflag &= (tcflag_t) ~(ICANON | ECHO | ECHOE | ECHOK | ECHONL |
+ ISIG | IEXTEN); //|ECHOPRT
+
+ options.c_oflag &= (tcflag_t) ~(OPOST);
+ options.c_iflag &= (tcflag_t) ~(INLCR | IGNCR | ICRNL | IGNBRK);
+#ifdef IUCLC
+ options.c_iflag &= (tcflag_t) ~IUCLC;
+#endif
+#ifdef PARMRK
+ options.c_iflag &= (tcflag_t) ~PARMRK;
+#endif
+
+ // setup baud rate
+ bool custom_baud = false;
+ speed_t baud;
+ switch (baudrate_) {
+#ifdef B0
+ case 0: baud = B0; break;
+#endif
+#ifdef B50
+ case 50: baud = B50; break;
+#endif
+#ifdef B75
+ case 75: baud = B75; break;
+#endif
+#ifdef B110
+ case 110: baud = B110; break;
+#endif
+#ifdef B134
+ case 134: baud = B134; break;
+#endif
+#ifdef B150
+ case 150: baud = B150; break;
+#endif
+#ifdef B200
+ case 200: baud = B200; break;
+#endif
+#ifdef B300
+ case 300: baud = B300; break;
+#endif
+#ifdef B600
+ case 600: baud = B600; break;
+#endif
+#ifdef B1200
+ case 1200: baud = B1200; break;
+#endif
+#ifdef B1800
+ case 1800: baud = B1800; break;
+#endif
+#ifdef B2400
+ case 2400: baud = B2400; break;
+#endif
+#ifdef B4800
+ case 4800: baud = B4800; break;
+#endif
+#ifdef B7200
+ case 7200: baud = B7200; break;
+#endif
+#ifdef B9600
+ case 9600: baud = B9600; break;
+#endif
+#ifdef B14400
+ case 14400: baud = B14400; break;
+#endif
+#ifdef B19200
+ case 19200: baud = B19200; break;
+#endif
+#ifdef B28800
+ case 28800: baud = B28800; break;
+#endif
+#ifdef B57600
+ case 57600: baud = B57600; break;
+#endif
+#ifdef B76800
+ case 76800: baud = B76800; break;
+#endif
+#ifdef B38400
+ case 38400: baud = B38400; break;
+#endif
+#ifdef B115200
+ case 115200: baud = B115200; break;
+#endif
+#ifdef B128000
+ case 128000: baud = B128000; break;
+#endif
+#ifdef B153600
+ case 153600: baud = B153600; break;
+#endif
+#ifdef B230400
+ case 230400: baud = B230400; break;
+#endif
+#ifdef B256000
+ case 256000: baud = B256000; break;
+#endif
+#ifdef B460800
+ case 460800: baud = B460800; break;
+#endif
+#ifdef B921600
+ case 921600: baud = B921600; break;
+#endif
+#ifdef B1000000
+ case 1000000: baud = B1000000; break;
+#endif
+#ifdef B1152000
+ case 1152000: baud = B1152000; break;
+#endif
+#ifdef B1500000
+ case 1500000: baud = B1500000; break;
+#endif
+#ifdef B2000000
+ case 2000000: baud = B2000000; break;
+#endif
+#ifdef B2500000
+ case 2500000: baud = B2500000; break;
+#endif
+#ifdef B3000000
+ case 3000000: baud = B3000000; break;
+#endif
+#ifdef B3500000
+ case 3500000: baud = B3500000; break;
+#endif
+#ifdef B4000000
+ case 4000000: baud = B4000000; break;
+#endif
+ default:
+ custom_baud = true;
+ // Mac OS X 10.x Support
+#if defined(__APPLE__) && defined(__MACH__)
+#define IOSSIOSPEED _IOW('T', 2, speed_t)
+ int new_baud = static_cast<int> (baudrate_);
+ if (ioctl (fd_, IOSSIOSPEED, &new_baud, 1) < 0) {
+ THROW (IOException, errno);
+ }
+ // Linux Support
+#elif defined(__linux__) && defined (TIOCSSERIAL)
+ struct serial_struct ser;
+ ioctl (fd_, TIOCGSERIAL, &ser);
+ // set custom divisor
+ ser.custom_divisor = ser.baud_base / (int) baudrate_;
+ // update flags
+ ser.flags &= ~ASYNC_SPD_MASK;
+ ser.flags |= ASYNC_SPD_CUST;
+
+ if (ioctl (fd_, TIOCSSERIAL, &ser) < 0) {
+ THROW (IOException, errno);
+ }
+#else
+ throw invalid_argument ("OS does not currently support custom bauds");
+#endif
+ }
+ if (custom_baud == false) {
+#ifdef _BSD_SOURCE
+ ::cfsetspeed(&options, baud);
+#else
+ ::cfsetispeed(&options, baud);
+ ::cfsetospeed(&options, baud);
+#endif
+ }
+
+ // setup char len
+ options.c_cflag &= (tcflag_t) ~CSIZE;
+ if (bytesize_ == eightbits)
+ options.c_cflag |= CS8;
+ else if (bytesize_ == sevenbits)
+ options.c_cflag |= CS7;
+ else if (bytesize_ == sixbits)
+ options.c_cflag |= CS6;
+ else if (bytesize_ == fivebits)
+ options.c_cflag |= CS5;
+ else
+ throw invalid_argument ("invalid char len");
+ // setup stopbits
+ if (stopbits_ == stopbits_one)
+ options.c_cflag &= (tcflag_t) ~(CSTOPB);
+ else if (stopbits_ == stopbits_one_point_five)
+ // ONE POINT FIVE same as TWO.. there is no POSIX support for 1.5
+ options.c_cflag |= (CSTOPB);
+ else if (stopbits_ == stopbits_two)
+ options.c_cflag |= (CSTOPB);
+ else
+ throw invalid_argument ("invalid stop bit");
+ // setup parity
+ options.c_iflag &= (tcflag_t) ~(INPCK | ISTRIP);
+ if (parity_ == parity_none) {
+ options.c_cflag &= (tcflag_t) ~(PARENB | PARODD);
+ } else if (parity_ == parity_even) {
+ options.c_cflag &= (tcflag_t) ~(PARODD);
+ options.c_cflag |= (PARENB);
+ } else if (parity_ == parity_odd) {
+ options.c_cflag |= (PARENB | PARODD);
+ } else {
+ throw invalid_argument ("invalid parity");
+ }
+ // setup flow control
+ if (flowcontrol_ == flowcontrol_none) {
+ xonxoff_ = false;
+ rtscts_ = false;
+ }
+ if (flowcontrol_ == flowcontrol_software) {
+ xonxoff_ = true;
+ rtscts_ = false;
+ }
+ if (flowcontrol_ == flowcontrol_hardware) {
+ xonxoff_ = false;
+ rtscts_ = true;
+ }
+ // xonxoff
+#ifdef IXANY
+ if (xonxoff_)
+ options.c_iflag |= (IXON | IXOFF); //|IXANY)
+ else
+ options.c_iflag &= (tcflag_t) ~(IXON | IXOFF | IXANY);
+#else
+ if (xonxoff_)
+ options.c_iflag |= (IXON | IXOFF);
+ else
+ options.c_iflag &= (tcflag_t) ~(IXON | IXOFF);
+#endif
+ // rtscts
+#ifdef CRTSCTS
+ if (rtscts_)
+ options.c_cflag |= (CRTSCTS);
+ else
+ options.c_cflag &= (unsigned long) ~(CRTSCTS);
+#elif defined CNEW_RTSCTS
+ if (rtscts_)
+ options.c_cflag |= (CNEW_RTSCTS);
+ else
+ options.c_cflag &= (unsigned long) ~(CNEW_RTSCTS);
+#else
+#error "OS Support seems wrong."
+#endif
+
+ // http://www.unixwiz.net/techtips/termios-vmin-vtime.html
+ // this basically sets the read call up to be a polling read,
+ // but we are using select to ensure there is data available
+ // to read before each call, so we should never needlessly poll
+ options.c_cc[VMIN] = 0;
+ options.c_cc[VTIME] = 0;
+
+ // activate settings
+ ::tcsetattr (fd_, TCSANOW, &options);
+}
+| void serial::serial::Serial::SerialImpl::reconfigurePort | +( | +) | + [protected] |
+
| void Serial::SerialImpl::sendBreak | +( | +int | +duration | ) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::sendBreak");
+ }
+ tcsendbreak (fd_, static_cast<int> (duration / 4));
+}
+| void serial::serial::Serial::SerialImpl::sendBreak | +( | +int | +duration | ) | ++ |
| void Serial::SerialImpl::setBaudrate | +( | +unsigned long | +baudrate | ) | ++ |
{
+ baudrate_ = baudrate;
+ if (is_open_)
+ reconfigurePort ();
+}
+| void serial::serial::Serial::SerialImpl::setBaudrate | +( | +unsigned long | +baudrate | ) | ++ |
| void Serial::SerialImpl::setBreak | +( | +bool | +level | ) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::setBreak");
+ }
+ if (level) {
+ ioctl (fd_, TIOCSBRK);
+ } else {
+ ioctl (fd_, TIOCCBRK);
+ }
+}
+| void serial::serial::Serial::SerialImpl::setBreak | +( | +bool | +level | ) | ++ |
| void serial::serial::Serial::SerialImpl::setBytesize | +( | +bytesize_t | +bytesize | ) | ++ |
| void serial::serial::Serial::SerialImpl::setBytesize | +( | +bytesize_t | +bytesize | ) | ++ |
| void Serial::SerialImpl::setDTR | +( | +bool | +level | ) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::setDTR");
+ }
+ if (level) {
+ ioctl (fd_, TIOCMBIS, TIOCM_DTR);
+ } else {
+ ioctl (fd_, TIOCMBIC, TIOCM_DTR);
+ }
+}
+| void serial::serial::Serial::SerialImpl::setDTR | +( | +bool | +level | ) | ++ |
| void serial::serial::Serial::SerialImpl::setFlowcontrol | +( | +flowcontrol_t | +flowcontrol | ) | ++ |
| void serial::serial::Serial::SerialImpl::setFlowcontrol | +( | +flowcontrol_t | +flowcontrol | ) | ++ |
| void serial::serial::Serial::SerialImpl::setParity | +( | +parity_t | +parity | ) | ++ |
| void serial::serial::Serial::SerialImpl::setParity | +( | +parity_t | +parity | ) | ++ |
| void Serial::SerialImpl::setPort | +( | +const string & | +port | ) | ++ |
{
+ port_ = port;
+}
+| void serial::serial::Serial::SerialImpl::setPort | +( | +const string & | +port | ) | ++ |
| void Serial::SerialImpl::setRTS | +( | +bool | +level | ) | ++ |
{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::setRTS");
+ }
+ if (level) {
+ ioctl (fd_, TIOCMBIS, TIOCM_RTS);
+ } else {
+ ioctl (fd_, TIOCMBIC, TIOCM_RTS);
+ }
+}
+| void serial::serial::Serial::SerialImpl::setRTS | +( | +bool | +level | ) | ++ |
| void serial::serial::Serial::SerialImpl::setStopbits | +( | +stopbits_t | +stopbits | ) | ++ |
| void serial::serial::Serial::SerialImpl::setStopbits | +( | +stopbits_t | +stopbits | ) | ++ |
| void serial::serial::Serial::SerialImpl::setTimeout | +( | +Timeout & | +timeout | ) | ++ |
| void serial::serial::Serial::SerialImpl::setTimeout | +( | +Timeout & | +timeout | ) | ++ |
| bool Serial::SerialImpl::waitForChange | +( | +) | ++ |
{
+#ifndef TIOCMIWAIT
+ while (is_open_ == true) {
+ int s = ioctl (fd_, TIOCMGET, 0);
+ if ((s & TIOCM_CTS) != 0) return true;
+ if ((s & TIOCM_DSR) != 0) return true;
+ if ((s & TIOCM_RI) != 0) return true;
+ if ((s & TIOCM_CD) != 0) return true;
+ usleep(1000);
+ }
+ return false;
+#else
+ if (ioctl(fd_, TIOCMIWAIT, (TIOCM_CD|TIOCM_DSR|TIOCM_RI|TIOCM_CTS)) != 0) {
+ stringstream ss;
+ ss << "waitForDSR failed on a call to ioctl(TIOCMIWAIT): "
+ << errno << " " << strerror(errno);
+ throw(SerialExecption(ss.str().c_str()));
+ }
+ return true;
+#endif
+}
+| bool serial::serial::Serial::SerialImpl::waitForChange | +( | +) | ++ |
| size_t Serial::SerialImpl::write | +( | +const uint8_t * | +data, | +
| + | + | size_t | +length | +
| + | ) | ++ |
Error
+ +Port ready to write
+{
+ if (is_open_ == false) {
+ throw PortNotOpenedException ("Serial::write");
+ }
+ fd_set writefds;
+ size_t bytes_written = 0;
+ struct timeval timeout;
+ timeout.tv_sec = timeout_.write_timeout_constant / 1000;
+ timeout.tv_usec = static_cast<int> (timeout_.write_timeout_multiplier % 1000);
+ timeout.tv_usec *= 1000; // To convert to micro seconds
+ while (bytes_written < length) {
+ FD_ZERO (&writefds);
+ FD_SET (fd_, &writefds);
+ // On Linux the timeout struct is updated by select to contain the time
+ // left on the timeout to make looping easier, but on other platforms this
+ // does not occur.
+#if !defined(__linux__)
+ // Begin timing select
+ struct timespec start, end;
+ get_time_now(start);
+#endif
+ // Do the select
+ int r = select (fd_ + 1, NULL, &writefds, NULL, &timeout);
+#if !defined(__linux__)
+ // Calculate difference and update the structure
+ get_time_now(end);
+ // Calculate the time select took
+ struct timeval diff;
+ diff.tv_sec = end.tv_sec - start.tv_sec;
+ diff.tv_usec = static_cast<int> ((end.tv_nsec - start.tv_nsec) / 1000);
+ // Update the timeout
+ if (timeout.tv_sec <= diff.tv_sec) {
+ timeout.tv_sec = 0;
+ } else {
+ timeout.tv_sec -= diff.tv_sec;
+ }
+ if (timeout.tv_usec <= diff.tv_usec) {
+ timeout.tv_usec = 0;
+ } else {
+ timeout.tv_usec -= diff.tv_usec;
+ }
+#endif
+
+ // Figure out what happened by looking at select's response 'r'
+ if (r < 0) {
+ // Select was interrupted, try again
+ if (errno == EINTR) {
+ continue;
+ }
+ // Otherwise there was some error
+ THROW (IOException, errno);
+ }
+ if (r == 0) {
+ break;
+ }
+ if (r > 0) {
+ // Make sure our file descriptor is in the ready to write list
+ if (FD_ISSET (fd_, &writefds)) {
+ // This will write some
+ ssize_t bytes_written_now =
+ ::write (fd_, data + bytes_written, length - bytes_written);
+ // write should always return some data as select reported it was
+ // ready to write when we get to this point.
+ if (bytes_written_now < 1) {
+ // Disconnected devices, at least on Linux, show the
+ // behavior that they are always ready to write immediately
+ // but writing returns nothing.
+ throw SerialExecption ("device reports readiness to write but "
+ "returned no data (device disconnected?)");
+ }
+ // Update bytes_written
+ bytes_written += static_cast<size_t> (bytes_written_now);
+ // If bytes_written == size then we have written everything we need to
+ if (bytes_written == length) {
+ break;
+ }
+ // If bytes_written < size then we have more to write
+ if (bytes_written < length) {
+ continue;
+ }
+ // If bytes_written > size then we have over written, which shouldn't happen
+ if (bytes_written > length) {
+ throw SerialExecption ("write over wrote, too many bytes where "
+ "written, this shouldn't happen, might be "
+ "a logical error!");
+ }
+ }
+ // This shouldn't happen, if r > 0 our fd has to be in the list!
+ THROW (IOException, "select reports ready to write, but our fd isn't"
+ " in the list, this shouldn't happen!");
+ }
+ }
+ return bytes_written;
+}
+| size_t serial::serial::Serial::SerialImpl::write | +( | +const uint8_t * | +data, | +
| + | + | size_t | +length | +
| + | ) | ++ |
| void Serial::SerialImpl::writeLock | +( | +) | ++ |
{
+ int result = pthread_mutex_lock(&this->write_mutex);
+ if (result) {
+ THROW (IOException, result);
+ }
+}
+| void serial::serial::Serial::SerialImpl::writeLock | +( | +) | ++ |
| void Serial::SerialImpl::writeUnlock | +( | +) | ++ |
{
+ int result = pthread_mutex_unlock(&this->write_mutex);
+ if (result) {
+ THROW (IOException, result);
+ }
+}
+| void serial::serial::Serial::SerialImpl::writeUnlock | +( | +) | ++ |
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/closed.png b/docs/v1.0.1/closed.png
new file mode 100644
index 0000000..b7d4bd9
Binary files /dev/null and b/docs/v1.0.1/closed.png differ
diff --git a/docs/v1.0.1/doxygen.css b/docs/v1.0.1/doxygen.css
new file mode 100644
index 0000000..c151fde
--- /dev/null
+++ b/docs/v1.0.1/doxygen.css
@@ -0,0 +1,1012 @@
+/* The standard CSS for doxygen */
+
+body, table, div, p, dl {
+ font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif;
+ font-size: 13px;
+ line-height: 1.3;
+}
+
+/* @group Heading Levels */
+
+h1 {
+ font-size: 150%;
+}
+
+.title {
+ font-size: 150%;
+ font-weight: bold;
+ margin: 10px 2px;
+}
+
+h2 {
+ font-size: 120%;
+}
+
+h3 {
+ font-size: 100%;
+}
+
+dt {
+ font-weight: bold;
+}
+
+div.multicol {
+ -moz-column-gap: 1em;
+ -webkit-column-gap: 1em;
+ -moz-column-count: 3;
+ -webkit-column-count: 3;
+}
+
+p.startli, p.startdd, p.starttd {
+ margin-top: 2px;
+}
+
+p.endli {
+ margin-bottom: 0px;
+}
+
+p.enddd {
+ margin-bottom: 4px;
+}
+
+p.endtd {
+ margin-bottom: 2px;
+}
+
+/* @end */
+
+caption {
+ font-weight: bold;
+}
+
+span.legend {
+ font-size: 70%;
+ text-align: center;
+}
+
+h3.version {
+ font-size: 90%;
+ text-align: center;
+}
+
+div.qindex, div.navtab{
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+}
+
+div.qindex, div.navpath {
+ width: 100%;
+ line-height: 140%;
+}
+
+div.navtab {
+ margin-right: 15px;
+}
+
+/* @group Link Styling */
+
+a {
+ color: #3D578C;
+ font-weight: normal;
+ text-decoration: none;
+}
+
+.contents a:visited {
+ color: #4665A2;
+}
+
+a:hover {
+ text-decoration: underline;
+}
+
+a.qindex {
+ font-weight: bold;
+}
+
+a.qindexHL {
+ font-weight: bold;
+ background-color: #9CAFD4;
+ color: #ffffff;
+ border: 1px double #869DCA;
+}
+
+.contents a.qindexHL:visited {
+ color: #ffffff;
+}
+
+a.el {
+ font-weight: bold;
+}
+
+a.elRef {
+}
+
+a.code, a.code:visited {
+ color: #4665A2;
+}
+
+a.codeRef, a.codeRef:visited {
+ color: #4665A2;
+}
+
+/* @end */
+
+dl.el {
+ margin-left: -1cm;
+}
+
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 105%;
+}
+
+pre.fragment {
+ border: 1px solid #C4CFE5;
+ background-color: #FBFCFD;
+ padding: 4px 6px;
+ margin: 4px 8px 4px 2px;
+ overflow: auto;
+ word-wrap: break-word;
+ font-size: 9pt;
+ line-height: 125%;
+}
+
+div.ah {
+ background-color: black;
+ font-weight: bold;
+ color: #ffffff;
+ margin-bottom: 3px;
+ margin-top: 3px;
+ padding: 0.2em;
+ border: solid thin #333;
+ border-radius: 0.5em;
+ -webkit-border-radius: .5em;
+ -moz-border-radius: .5em;
+ box-shadow: 2px 2px 3px #999;
+ -webkit-box-shadow: 2px 2px 3px #999;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444));
+ background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000);
+}
+
+div.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ font-weight: bold;
+}
+
+div.groupText {
+ margin-left: 16px;
+ font-style: italic;
+}
+
+body {
+ background-color: white;
+ color: black;
+ margin: 0;
+}
+
+div.contents {
+ margin-top: 10px;
+ margin-left: 8px;
+ margin-right: 8px;
+}
+
+td.indexkey {
+ background-color: #EBEFF6;
+ font-weight: bold;
+ border: 1px solid #C4CFE5;
+ margin: 2px 0px 2px 0;
+ padding: 2px 10px;
+ white-space: nowrap;
+ vertical-align: top;
+}
+
+td.indexvalue {
+ background-color: #EBEFF6;
+ border: 1px solid #C4CFE5;
+ padding: 2px 10px;
+ margin: 2px 0px;
+}
+
+tr.memlist {
+ background-color: #EEF1F7;
+}
+
+p.formulaDsp {
+ text-align: center;
+}
+
+img.formulaDsp {
+
+}
+
+img.formulaInl {
+ vertical-align: middle;
+}
+
+div.center {
+ text-align: center;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ padding: 0px;
+}
+
+div.center img {
+ border: 0px;
+}
+
+address.footer {
+ text-align: right;
+ padding-right: 12px;
+}
+
+img.footer {
+ border: 0px;
+ vertical-align: middle;
+}
+
+/* @group Code Colorization */
+
+span.keyword {
+ color: #008000
+}
+
+span.keywordtype {
+ color: #604020
+}
+
+span.keywordflow {
+ color: #e08000
+}
+
+span.comment {
+ color: #800000
+}
+
+span.preprocessor {
+ color: #806020
+}
+
+span.stringliteral {
+ color: #002080
+}
+
+span.charliteral {
+ color: #008080
+}
+
+span.vhdldigit {
+ color: #ff00ff
+}
+
+span.vhdlchar {
+ color: #000000
+}
+
+span.vhdlkeyword {
+ color: #700070
+}
+
+span.vhdllogic {
+ color: #ff0000
+}
+
+blockquote {
+ background-color: #F7F8FB;
+ border-left: 2px solid #9CAFD4;
+ margin: 0 24px 0 4px;
+ padding: 0 12px 0 16px;
+}
+
+/* @end */
+
+/*
+.search {
+ color: #003399;
+ font-weight: bold;
+}
+
+form.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+
+input.search {
+ font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #e8eef2;
+}
+*/
+
+td.tiny {
+ font-size: 75%;
+}
+
+.dirtab {
+ padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #A3B4D7;
+}
+
+th.dirtab {
+ background: #EBEFF6;
+ font-weight: bold;
+}
+
+hr {
+ height: 0px;
+ border: none;
+ border-top: 1px solid #4A6AAA;
+}
+
+hr.footer {
+ height: 1px;
+}
+
+/* @group Member Descriptions */
+
+table.memberdecls {
+ border-spacing: 0px;
+ padding: 0px;
+}
+
+.mdescLeft, .mdescRight,
+.memItemLeft, .memItemRight,
+.memTemplItemLeft, .memTemplItemRight, .memTemplParams {
+ background-color: #F9FAFC;
+ border: none;
+ margin: 4px;
+ padding: 1px 0 0 8px;
+}
+
+.mdescLeft, .mdescRight {
+ padding: 0px 8px 4px 8px;
+ color: #555;
+}
+
+.memItemLeft, .memItemRight, .memTemplParams {
+ border-top: 1px solid #C4CFE5;
+}
+
+.memItemLeft, .memTemplItemLeft {
+ white-space: nowrap;
+}
+
+.memItemRight {
+ width: 100%;
+}
+
+.memTemplParams {
+ color: #4665A2;
+ white-space: nowrap;
+}
+
+/* @end */
+
+/* @group Member Details */
+
+/* Styles for detailed member documentation */
+
+.memtemplate {
+ font-size: 80%;
+ color: #4665A2;
+ font-weight: normal;
+ margin-left: 9px;
+}
+
+.memnav {
+ background-color: #EBEFF6;
+ border: 1px solid #A3B4D7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+
+.mempage {
+ width: 100%;
+}
+
+.memitem {
+ padding: 0;
+ margin-bottom: 10px;
+ margin-right: 5px;
+}
+
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+ margin-left: 6px;
+}
+
+.memproto, dl.reflist dt {
+ border-top: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 6px 0px 6px 0px;
+ color: #253555;
+ font-weight: bold;
+ text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
+ /* opera specific markup */
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ border-top-right-radius: 8px;
+ border-top-left-radius: 8px;
+ /* firefox specific markup */
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ -moz-border-radius-topright: 8px;
+ -moz-border-radius-topleft: 8px;
+ /* webkit specific markup */
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -webkit-border-top-right-radius: 8px;
+ -webkit-border-top-left-radius: 8px;
+ background-image:url('nav_f.png');
+ background-repeat:repeat-x;
+ background-color: #E2E8F2;
+
+}
+
+.memdoc, dl.reflist dd {
+ border-bottom: 1px solid #A8B8D9;
+ border-left: 1px solid #A8B8D9;
+ border-right: 1px solid #A8B8D9;
+ padding: 2px 5px;
+ background-color: #FBFCFD;
+ border-top-width: 0;
+ /* opera specific markup */
+ border-bottom-left-radius: 8px;
+ border-bottom-right-radius: 8px;
+ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ /* firefox specific markup */
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7);
+ /* webkit specific markup */
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7));
+}
+
+dl.reflist dt {
+ padding: 5px;
+}
+
+dl.reflist dd {
+ margin: 0px 0px 10px 0px;
+ padding: 5px;
+}
+
+.paramkey {
+ text-align: right;
+}
+
+.paramtype {
+ white-space: nowrap;
+}
+
+.paramname {
+ color: #602020;
+ white-space: nowrap;
+}
+.paramname em {
+ font-style: normal;
+}
+
+.params, .retval, .exception, .tparams {
+ border-spacing: 6px 2px;
+}
+
+.params .paramname, .retval .paramname {
+ font-weight: bold;
+ vertical-align: top;
+}
+
+.params .paramtype {
+ font-style: italic;
+ vertical-align: top;
+}
+
+.params .paramdir {
+ font-family: "courier new",courier,monospace;
+ vertical-align: top;
+}
+
+
+
+
+/* @end */
+
+/* @group Directory (tree) */
+
+/* for the tree view */
+
+.ftvtree {
+ font-family: sans-serif;
+ margin: 0px;
+}
+
+/* these are for tree view when used as main index */
+
+.directory {
+ font-size: 9pt;
+ font-weight: bold;
+ margin: 5px;
+}
+
+.directory h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+/*
+The following two styles can be used to replace the root node title
+with an image of your choice. Simply uncomment the next two styles,
+specify the name of your image and be sure to set 'height' to the
+proper pixel height of your image.
+*/
+
+/*
+.directory h3.swap {
+ height: 61px;
+ background-repeat: no-repeat;
+ background-image: url("yourimage.gif");
+}
+.directory h3.swap span {
+ display: none;
+}
+*/
+
+.directory > h3 {
+ margin-top: 0;
+}
+
+.directory p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory div {
+ display: none;
+ margin: 0px;
+}
+
+.directory img {
+ vertical-align: -30%;
+}
+
+/* these are for tree view when not used as main index */
+
+.directory-alt {
+ font-size: 100%;
+ font-weight: bold;
+}
+
+.directory-alt h3 {
+ margin: 0px;
+ margin-top: 1em;
+ font-size: 11pt;
+}
+
+.directory-alt > h3 {
+ margin-top: 0;
+}
+
+.directory-alt p {
+ margin: 0px;
+ white-space: nowrap;
+}
+
+.directory-alt div {
+ display: none;
+ margin: 0px;
+}
+
+.directory-alt img {
+ vertical-align: -30%;
+}
+
+/* @end */
+
+div.dynheader {
+ margin-top: 8px;
+}
+
+address {
+ font-style: normal;
+ color: #2A3D61;
+}
+
+table.doxtable {
+ border-collapse:collapse;
+ margin-top: 4px;
+ margin-bottom: 4px;
+}
+
+table.doxtable td, table.doxtable th {
+ border: 1px solid #2D4068;
+ padding: 3px 7px 2px;
+}
+
+table.doxtable th {
+ background-color: #374F7F;
+ color: #FFFFFF;
+ font-size: 110%;
+ padding-bottom: 4px;
+ padding-top: 5px;
+}
+
+table.fieldtable {
+ width: 100%;
+ margin-bottom: 10px;
+ border: 1px solid #A8B8D9;
+ border-spacing: 0px;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 4px;
+ -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px;
+ -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
+ box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15);
+}
+
+.fieldtable td, .fieldtable th {
+ padding: 3px 7px 2px;
+}
+
+.fieldtable td.fieldtype, .fieldtable td.fieldname {
+ white-space: nowrap;
+ border-right: 1px solid #A8B8D9;
+ border-bottom: 1px solid #A8B8D9;
+ vertical-align: top;
+}
+
+.fieldtable td.fielddoc {
+ border-bottom: 1px solid #A8B8D9;
+ width: 100%;
+}
+
+.fieldtable tr:last-child td {
+ border-bottom: none;
+}
+
+.fieldtable th {
+ background-image:url('nav_f.png');
+ background-repeat:repeat-x;
+ background-color: #E2E8F2;
+ font-size: 90%;
+ color: #253555;
+ padding-bottom: 4px;
+ padding-top: 5px;
+ text-align:left;
+ -moz-border-radius-topleft: 4px;
+ -moz-border-radius-topright: 4px;
+ -webkit-border-top-left-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+ border-bottom: 1px solid #A8B8D9;
+}
+
+
+.tabsearch {
+ top: 0px;
+ left: 10px;
+ height: 36px;
+ background-image: url('tab_b.png');
+ z-index: 101;
+ overflow: hidden;
+ font-size: 13px;
+}
+
+.navpath ul
+{
+ font-size: 11px;
+ background-image:url('tab_b.png');
+ background-repeat:repeat-x;
+ height:30px;
+ line-height:30px;
+ color:#8AA0CC;
+ border:solid 1px #C2CDE4;
+ overflow:hidden;
+ margin:0px;
+ padding:0px;
+}
+
+.navpath li
+{
+ list-style-type:none;
+ float:left;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:url('bc_s.png');
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+}
+
+.navpath li.navelem a
+{
+ height:32px;
+ display:block;
+ text-decoration: none;
+ outline: none;
+}
+
+.navpath li.navelem a:hover
+{
+ color:#6884BD;
+}
+
+.navpath li.footer
+{
+ list-style-type:none;
+ float:right;
+ padding-left:10px;
+ padding-right:15px;
+ background-image:none;
+ background-repeat:no-repeat;
+ background-position:right;
+ color:#364D7C;
+ font-size: 8pt;
+}
+
+
+div.summary
+{
+ float: right;
+ font-size: 8pt;
+ padding-right: 5px;
+ width: 50%;
+ text-align: right;
+}
+
+div.summary a
+{
+ white-space: nowrap;
+}
+
+div.ingroups
+{
+ margin-left: 5px;
+ font-size: 8pt;
+ padding-left: 5px;
+ width: 50%;
+ text-align: left;
+}
+
+div.ingroups a
+{
+ white-space: nowrap;
+}
+
+div.header
+{
+ background-image:url('nav_h.png');
+ background-repeat:repeat-x;
+ background-color: #F9FAFC;
+ margin: 0px;
+ border-bottom: 1px solid #C4CFE5;
+}
+
+div.headertitle
+{
+ padding: 5px 5px 5px 7px;
+}
+
+dl
+{
+ padding: 0 0 0 10px;
+}
+
+/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
+dl.section
+{
+ border-left:4px solid;
+ padding: 0 0 0 6px;
+}
+
+dl.note
+{
+ border-color: #D0C000;
+}
+
+dl.warning, dl.attention
+{
+ border-color: #FF0000;
+}
+
+dl.pre, dl.post, dl.invariant
+{
+ border-color: #00D000;
+}
+
+dl.deprecated
+{
+ border-color: #505050;
+}
+
+dl.todo
+{
+ border-color: #00C0E0;
+}
+
+dl.test
+{
+ border-color: #3030E0;
+}
+
+dl.bug
+{
+ border-color: #C08050;
+}
+
+dl.section dd {
+ margin-bottom: 6px;
+}
+
+
+#projectlogo
+{
+ text-align: center;
+ vertical-align: bottom;
+ border-collapse: separate;
+}
+
+#projectlogo img
+{
+ border: 0px none;
+}
+
+#projectname
+{
+ font: 300% Tahoma, Arial,sans-serif;
+ margin: 0px;
+ padding: 2px 0px;
+}
+
+#projectbrief
+{
+ font: 120% Tahoma, Arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+
+#projectnumber
+{
+ font: 50% Tahoma, Arial,sans-serif;
+ margin: 0px;
+ padding: 0px;
+}
+
+#titlearea
+{
+ padding: 0px;
+ margin: 0px;
+ width: 100%;
+ border-bottom: 1px solid #5373B4;
+}
+
+.image
+{
+ text-align: center;
+}
+
+.dotgraph
+{
+ text-align: center;
+}
+
+.mscgraph
+{
+ text-align: center;
+}
+
+.caption
+{
+ font-weight: bold;
+}
+
+div.zoom
+{
+ border: 1px solid #90A5CE;
+}
+
+dl.citelist {
+ margin-bottom:50px;
+}
+
+dl.citelist dt {
+ color:#334975;
+ float:left;
+ font-weight:bold;
+ margin-right:10px;
+ padding:5px;
+}
+
+dl.citelist dd {
+ margin:2px 0;
+ padding:5px 0;
+}
+
+div.toc {
+ padding: 14px 25px;
+ background-color: #F4F6FA;
+ border: 1px solid #D8DFEE;
+ border-radius: 7px 7px 7px 7px;
+ float: right;
+ height: auto;
+ margin: 0 20px 10px 10px;
+ width: 200px;
+}
+
+div.toc li {
+ background: url("bdwn.png") no-repeat scroll 0 5px transparent;
+ font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;
+ margin-top: 5px;
+ padding-left: 10px;
+ padding-top: 2px;
+}
+
+div.toc h3 {
+ font: bold 12px/1.2 Arial,FreeSans,sans-serif;
+ color: #4665A2;
+ border-bottom: 0 none;
+ margin: 0;
+}
+
+div.toc ul {
+ list-style: none outside none;
+ border: medium none;
+ padding: 0px;
+}
+
+div.toc li.level1 {
+ margin-left: 0px;
+}
+
+div.toc li.level2 {
+ margin-left: 15px;
+}
+
+div.toc li.level3 {
+ margin-left: 30px;
+}
+
+div.toc li.level4 {
+ margin-left: 45px;
+}
+
+
+@media print
+{
+ #top { display: none; }
+ #side-nav { display: none; }
+ #nav-path { display: none; }
+ body { overflow:visible; }
+ h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
+ .summary { display: none; }
+ .memitem { page-break-inside: avoid; }
+ #doc-content
+ {
+ margin-left:0 !important;
+ height:auto !important;
+ width:auto !important;
+ overflow:inherit;
+ display:inline;
+ }
+ pre.fragment
+ {
+ overflow: visible;
+ text-wrap: unrestricted;
+ white-space: -moz-pre-wrap; /* Moz */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ white-space: pre-wrap; /* CSS3 */
+ word-wrap: break-word; /* IE 5.5+ */
+ }
+}
+
diff --git a/docs/v1.0.1/doxygen.png b/docs/v1.0.1/doxygen.png
new file mode 100644
index 0000000..635ed52
Binary files /dev/null and b/docs/v1.0.1/doxygen.png differ
diff --git a/docs/v1.0.1/files.html b/docs/v1.0.1/files.html
new file mode 100644
index 0000000..ad4f0f3
--- /dev/null
+++ b/docs/v1.0.1/files.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
| examples/serial_example.cc | |
| include/serial/serial.h [code] | |
| include/serial/v8stdint.h [code] | |
| include/serial/impl/unix.h [code] | |
| include/serial/impl/win.h [code] | |
| src/serial.cc | |
| src/impl/unix.cc | |
| src/impl/win.cc |
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/functions.html b/docs/v1.0.1/functions.html
new file mode 100644
index 0000000..893f405
--- /dev/null
+++ b/docs/v1.0.1/functions.html
@@ -0,0 +1,404 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/functions_func.html b/docs/v1.0.1/functions_func.html
new file mode 100644
index 0000000..1e28a44
--- /dev/null
+++ b/docs/v1.0.1/functions_func.html
@@ -0,0 +1,390 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/functions_vars.html b/docs/v1.0.1/functions_vars.html
new file mode 100644
index 0000000..621f9f6
--- /dev/null
+++ b/docs/v1.0.1/functions_vars.html
@@ -0,0 +1,128 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/globals.html b/docs/v1.0.1/globals.html
new file mode 100644
index 0000000..6361e34
--- /dev/null
+++ b/docs/v1.0.1/globals.html
@@ -0,0 +1,130 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/globals_defs.html b/docs/v1.0.1/globals_defs.html
new file mode 100644
index 0000000..0357474
--- /dev/null
+++ b/docs/v1.0.1/globals_defs.html
@@ -0,0 +1,118 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/globals_func.html b/docs/v1.0.1/globals_func.html
new file mode 100644
index 0000000..8e7d309
--- /dev/null
+++ b/docs/v1.0.1/globals_func.html
@@ -0,0 +1,124 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/graph_legend.html b/docs/v1.0.1/graph_legend.html
new file mode 100644
index 0000000..6dd5dd6
--- /dev/null
+++ b/docs/v1.0.1/graph_legend.html
@@ -0,0 +1,165 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
This page explains how to interpret the graphs that are generated by doxygen.
+Consider the following example:
+/*! Invisible class because of truncation */ +class Invisible { }; + +/*! Truncated class, inheritance relation is hidden */ +class Truncated : public Invisible { }; + +/* Class not documented with doxygen comments */ +class Undocumented { }; + +/*! Class that is inherited using public inheritance */ +class PublicBase : public Truncated { }; + +/*! A template class */ +template<class T> class Templ { }; + +/*! Class that is inherited using protected inheritance */ +class ProtectedBase { }; + +/*! Class that is inherited using private inheritance */ +class PrivateBase { }; + +/*! Class that is used by the Inherited class */ +class Used { }; + +/*! Super class that inherits a number of other classes */ +class Inherited : public PublicBase, + protected ProtectedBase, + private PrivateBase, + public Undocumented, + public Templ<int> +{ + private: + Used *m_usedClass; +}; +
This will result in the following graph:
+
+The boxes in the above graph have the following meaning:
+The arrows have the following meaning:
+
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/graph_legend.md5 b/docs/v1.0.1/graph_legend.md5
new file mode 100644
index 0000000..c0a4490
--- /dev/null
+++ b/docs/v1.0.1/graph_legend.md5
@@ -0,0 +1 @@
+70d597617e34367275a35eeb8fb7ea07
\ No newline at end of file
diff --git a/docs/v1.0.1/graph_legend.png b/docs/v1.0.1/graph_legend.png
new file mode 100644
index 0000000..c68e946
Binary files /dev/null and b/docs/v1.0.1/graph_legend.png differ
diff --git a/docs/v1.0.1/index.html b/docs/v1.0.1/index.html
new file mode 100644
index 0000000..38dda26
--- /dev/null
+++ b/docs/v1.0.1/index.html
@@ -0,0 +1,153 @@
+
+
+
+
+
+|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
Serial is a cross-platform, simple to use library for using serial ports on computers. This library provides a C++, object oriented interface for interacting with RS-232 like devices on Linux and Windows.
+Want to use it with ROS(Robot Operating System)? No problem, it compiles as a unary stack.
+Ready to jump in?
+Once you have gathered the dependencies, you need to checkout the software from github.com:
++ git clone git://github.com/wjwwood/serial.git +
Once you have checked out the source code from github.com you can enter the directory and build the software.
++ cd serial + make + make test # (optional) builds the example and tests, and runs the tests. + make doc # (optional) builds _this_ documentation. +
To install simply:
++ sudo make install +
To uninstall simply:
++ sudo make uninstall +
+ 1.8.0
+
+
+
+
diff --git a/docs/v1.0.1/jquery.js b/docs/v1.0.1/jquery.js
new file mode 100644
index 0000000..90b3a2b
--- /dev/null
+++ b/docs/v1.0.1/jquery.js
@@ -0,0 +1,64 @@
+/*
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
+ *
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
+ *
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
+ */
+(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F|
+ serial
+ 1.0.1
+
+ Cross-platform serial port library written in C++
+ |
+
+
+
+
+ 1.8.0
+
+
+
+