summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2010-01-10 12:31:34 (GMT)
committerChristian Pointner <equinox@helsinki.at>2010-01-10 12:31:34 (GMT)
commit6218a84102038f95683cffbbde9fcf9fff8d2827 (patch)
tree61ff60f126451ef14a8122abe0ba04102252b1a4 /utils.c
parent0e13f8198ac1edc6f9b3a62492425cbdfd8669e4 (diff)
improved termios settings
fixed length check at write fixed output at log
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/utils.c b/utils.c
index 6178d3b..e046b9c 100644
--- a/utils.c
+++ b/utils.c
@@ -150,6 +150,21 @@ int setup_tty(int fd, speed_t speed)
return ret;
}
+// tmio.c_iflag |= ;
+ tmio.c_iflag &= ~(INLCR | ICRNL | IGNCR | IXON | IXOFF);
+
+// tmio.c_oflag |= ;
+ tmio.c_oflag &= ~(ONLCR | OCRNL | ONOCR | ONLRET);
+
+ tmio.c_cflag |= CS8 | CLOCAL | CREAD;
+ tmio.c_cflag &= ~(CSTOPB | PARENB);
+
+// tmio.c_lflag |= ;
+ tmio.c_lflag &= ~(ICANON | ECHO);
+
+ tmio.c_cc[VTIME] = 0;
+ tmio.c_cc[VMIN] = 1;
+
ret = cfsetospeed(&tmio, speed);
if(ret) {
log_printf(ERROR, "Error on cfsetospeed(): %s", strerror(errno));
@@ -162,8 +177,6 @@ int setup_tty(int fd, speed_t speed)
return ret;
}
- tmio.c_lflag &= ~ECHO;
-
ret = tcsetattr(fd, TCSANOW, &tmio);
if(ret) {
log_printf(ERROR, "Error on tcsetattr(): %s", strerror(errno));