]> sigrok.org Git - libsigrok.git/blobdiff - hardware/common/serial.c
serial: Removed flag OPOST (turn off all output processing).
[libsigrok.git] / hardware / common / serial.c
index 0c64203fc8bf7f833645a8ff49cbf79422dab834..ebc6979763100a2399a5d9678ed666c16caa81db 100644 (file)
@@ -590,7 +590,7 @@ SR_PRIV int serial_set_params(struct sr_serial_dev_inst *serial, int baudrate,
 
        /* Turn off all serial port cooking. */
        term.c_iflag &= ~(ISTRIP | INLCR | ICRNL);
-       term.c_oflag &= ~(ONLCR | OCRNL | ONOCR);
+       term.c_oflag &= ~(OPOST | ONLCR | OCRNL | ONOCR);
 #if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
        term.c_oflag &= ~OFILL;
 #endif
@@ -598,6 +598,9 @@ SR_PRIV int serial_set_params(struct sr_serial_dev_inst *serial, int baudrate,
        /* Disable canonical mode, and don't echo input characters. */
        term.c_lflag &= ~(ICANON | ECHO);
 
+       /* Ignore modem status lines; enable receiver */
+       term.c_cflag |= (CLOCAL | CREAD);
+
        /* Write the configured settings. */
        if (tcsetattr(serial->fd, TCSADRAIN, &term) < 0) {
                sr_err("tcsetattr() error: %s.", strerror(errno));