diff --git a/src/serial.cpp b/src/serial.cpp index 3894b9e..3717c70 100644 --- a/src/serial.cpp +++ b/src/serial.cpp @@ -21,7 +21,10 @@ namespace create { bool Serial::connect(const std::string& portName, const int& baud, boost::function cb) { using namespace boost::asio; port.open(portName); - port.set_option(serial_port::baud_rate(baud)); + port.set_option(serial_port::baud_rate(baud)); + port.set_option(serial_port::character_size(8)); + port.set_option(serial_port::parity(serial_port::parity::none)); + port.set_option(serial_port::stop_bits(serial_port::stop_bits::one)); port.set_option(serial_port::flow_control(serial_port::flow_control::none)); usleep(1000000); diff --git a/src/serial_stream.cpp b/src/serial_stream.cpp index aac3184..ccc70f5 100644 --- a/src/serial_stream.cpp +++ b/src/serial_stream.cpp @@ -5,7 +5,7 @@ namespace create { - SerialStream::SerialStream(boost::shared_ptr d, const uint8_t& header) : Serial(d), headerByte(header){ + SerialStream::SerialStream(boost::shared_ptr d, const uint8_t& header) : Serial(d), headerByte(header), readState(READ_HEADER){ } bool SerialStream::startSensorStream() {