]> sigrok.org Git - libsigrok.git/commitdiff
serial: Added flags CLOCAL (ignore modem status lines) and CREAD (start receiver).
authorMatthias Heidbrink <redacted>
Thu, 17 Oct 2013 08:57:13 +0000 (10:57 +0200)
committerUwe Hermann <redacted>
Fri, 25 Oct 2013 17:11:15 +0000 (19:11 +0200)
hardware/common/serial.c

index 0c64203fc8bf7f833645a8ff49cbf79422dab834..d8a912b28b08f27847badb48c164c4f04a78fbb2 100644 (file)
@@ -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));