aqhome: modified setup of serial port.

This commit is contained in:
Martin Preuss
2025-02-01 16:22:36 +01:00
parent bb73225b86
commit cc8dd6e22f

View File

@@ -212,15 +212,16 @@ int _openDevice(GWEN_MSG_ENDPOINT *ep)
DBG_ERROR(AQH_LOGDOMAIN, "Error on tcgetattr(%s): %s (%d)", xep->deviceName, strerror(errno), errno);
return GWEN_ERROR_IO;
}
memset(&options, 0, sizeof(options)); /* preset */
options=xep->previousOptions;
// memset(&options, 0, sizeof(options)); /* preset */
options.c_cflag=CLOCAL | CREAD | CS8;
options.c_iflag=IGNPAR | IGNBRK;
options.c_oflag=0;
options.c_lflag=0;
cfmakeraw(&options);
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 */
cfmakeraw(&options);
rv=cfsetispeed(&options, AQH_MSG_ENDPOINT_TTY_BAUDRATE);
if (rv<0) {