diff --git a/CHANGELOG b/CHANGELOG index cc7cc6b..436722b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +1.3.3 => 07/15/2020: [FIXED] 0x0D got translated to 0x0A under Linux + +1.3.2 => 01/06/2019: [FIXED] 0x11/0x13 stripped out under Linux + 1.3.1 => 07/26/2014: [FIXED] Ruby 2.2 support [NEW] UNIX MARK/SPACE parity (CMSPAR) support diff --git a/ext/native/posix_serialport_impl.c b/ext/native/posix_serialport_impl.c index 2f9325e..630749e 100644 --- a/ext/native/posix_serialport_impl.c +++ b/ext/native/posix_serialport_impl.c @@ -154,11 +154,14 @@ VALUE sp_create_impl(class, _port) rb_sys_fail(sTcgetattr); } + // clean oflag and iflag, you may get unexpected behaviour if any bit of iflag/oflag is set. params.c_oflag = 0; + params.c_iflag = 0; + params.c_lflag = 0; - params.c_iflag &= (IXON | IXOFF | IXANY); + params.c_cflag |= CLOCAL | CREAD; - params.c_cflag &= ~HUPCL; + params.c_cflag &= ~(HUPCL | CRTSCTS); // default not use RTS/CTS hw flow control if (tcsetattr(fd, TCSANOW, ¶ms) == -1) { diff --git a/lib/serialport/version.rb b/lib/serialport/version.rb index 718c16c..b6c8d34 100644 --- a/lib/serialport/version.rb +++ b/lib/serialport/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SerialPort - VERSION = "1.3.2" + VERSION = '1.3.3' end