Commit d8e1cd1e620f733d4b8fa2d598a0f56df5d82fdc
1 parent
18eb9073
Fixed bug with setting the echo.
Showing
2 changed files
with
10 additions
and
1 deletions
CHANGELOG.md
| @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | ||
| 7 | 7 | ||
| 8 | ## [Unreleased] | 8 | ## [Unreleased] |
| 9 | 9 | ||
| 10 | +## [v2.1.1] - 2021-04-05 | ||
| 11 | + | ||
| 12 | +- Fixed bug where `echo` was not being set correctly. | ||
| 13 | + | ||
| 10 | ## [v2.1.0] - 2020-11-08 | 14 | ## [v2.1.0] - 2020-11-08 |
| 11 | 15 | ||
| 12 | ### Added | 16 | ### Added |
src/SerialPort.cpp
| @@ -347,7 +347,12 @@ namespace CppLinuxSerial { | @@ -347,7 +347,12 @@ namespace CppLinuxSerial { | ||
| 347 | // Canonical input is when read waits for EOL or EOF characters before returning. In non-canonical mode, the rate at which | 347 | // Canonical input is when read waits for EOL or EOF characters before returning. In non-canonical mode, the rate at which |
| 348 | // read() returns is instead controlled by c_cc[VMIN] and c_cc[VTIME] | 348 | // read() returns is instead controlled by c_cc[VMIN] and c_cc[VTIME] |
| 349 | tty.c_lflag &= ~ICANON; // Turn off canonical input, which is suitable for pass-through | 349 | tty.c_lflag &= ~ICANON; // Turn off canonical input, which is suitable for pass-through |
| 350 | - echo_ ? (tty.c_lflag | ECHO ) : (tty.c_lflag & ~(ECHO)); // Configure echo depending on echo_ boolean | 350 | + // Configure echo depending on echo_ boolean |
| 351 | + if(echo_) { | ||
| 352 | + tty.c_lflag |= ECHO; | ||
| 353 | + } else { | ||
| 354 | + tty.c_lflag &= ~(ECHO); | ||
| 355 | + } | ||
| 351 | tty.c_lflag &= ~ECHOE; // Turn off echo erase (echo erase only relevant if canonical input is active) | 356 | tty.c_lflag &= ~ECHOE; // Turn off echo erase (echo erase only relevant if canonical input is active) |
| 352 | tty.c_lflag &= ~ECHONL; // | 357 | tty.c_lflag &= ~ECHONL; // |
| 353 | tty.c_lflag &= ~ISIG; // Disables recognition of INTR (interrupt), QUIT and SUSP (suspend) characters | 358 | tty.c_lflag &= ~ISIG; // Disables recognition of INTR (interrupt), QUIT and SUSP (suspend) characters |