aqhome: simplified tty setup.
This commit is contained in:
@@ -139,8 +139,9 @@ int _fdFlush(int fd)
|
||||
#else
|
||||
int rv;
|
||||
|
||||
DBG_ERROR(AQH_LOGDOMAIN, "Flush");
|
||||
usleep(1000);
|
||||
rv=ioctl(fd, TCFLSH, 0); // flush receive
|
||||
rv=ioctl(fd, TCFLSH, 2); // flush receive
|
||||
if (rv!=0) {
|
||||
if (errno!=EINTR && errno!=EWOULDBLOCK && errno!=EAGAIN) {
|
||||
DBG_ERROR(AQH_LOGDOMAIN, "Error on ioctl: %s (%d)", strerror(errno), errno);
|
||||
@@ -232,12 +233,14 @@ int AQH_TtyObject_OpenAndInitDevice(const char *device, struct termios *initialT
|
||||
if (initialTermiosState)
|
||||
*initialTermiosState=options;
|
||||
|
||||
#if 0
|
||||
options.c_cflag=CLOCAL | CREAD | CS8;
|
||||
options.c_iflag=IGNPAR | IGNBRK;
|
||||
options.c_oflag=0;
|
||||
options.c_lflag&= ~(ICANON | ECHO | ECHOE | ISIG);
|
||||
options.c_cc[VTIME]=0; /* read timeout in deciseconds */
|
||||
options.c_cc[VMIN]=0; /* no minimum number of receive bytes */
|
||||
#endif
|
||||
cfmakeraw(&options);
|
||||
|
||||
rv=cfsetispeed(&options, AQH_TTYOBJECT_BAUDRATE);
|
||||
|
||||
Reference in New Issue
Block a user