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