From 30ae4847ab58fefe81c5a851d1ecf026e8a022f7 Mon Sep 17 00:00:00 2001 From: William Woodall Date: Thu, 24 Mar 2011 10:59:56 -0500 Subject: [PATCH] PARTY_* related fixes. Compiles and works on OS X and Windows, needs to be tested on Linux. --- include/serial.h | 2 +- src/serial.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/serial.h b/include/serial.h index 5516caf..22ec977 100644 --- a/include/serial.h +++ b/include/serial.h @@ -70,7 +70,7 @@ #define DEFAULT_BYTESIZE EIGHTBITS #endif #ifndef DEFAULT_PARITY -#define DEFAULT_PARITY NONE +#define DEFAULT_PARITY PARTIY_NONE #endif #ifndef DEFAULT_STOPBITS #define DEFAULT_STOPBITS STOPBITS_ONE diff --git a/src/serial.cpp b/src/serial.cpp index 41ace6f..cc21e85 100644 --- a/src/serial.cpp +++ b/src/serial.cpp @@ -329,13 +329,13 @@ const bytesize_t Serial::getBytesize() const { void Serial::setParity(parity_t parity) { switch(parity) { - case NONE: + case PARITY_NONE: this->parity = boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::none); break; - case ODD: + case PARITY_ODD: this->parity = boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::odd); break; - case EVEN: + case PARITY_EVEN: this->parity = boost::asio::serial_port_base::parity(boost::asio::serial_port_base::parity::even); break; default: @@ -347,11 +347,11 @@ void Serial::setParity(parity_t parity) { const parity_t Serial::getParity() const { switch(this->parity.value()) { case boost::asio::serial_port_base::parity::none: - return parity_t(NONE); + return parity_t(PARITY_NONE); case boost::asio::serial_port_base::parity::odd: - return parity_t(ODD); + return parity_t(PARITY_ODD); case boost::asio::serial_port_base::parity::even: - return parity_t(EVEN); + return parity_t(PARITY_EVEN); default: throw(InvalidParityException(this->parity.value())); }