diff --git a/hardwaresetup.cpp b/hardwaresetup.cpp index 836679d..5aaf945 100644 --- a/hardwaresetup.cpp +++ b/hardwaresetup.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include @@ -315,6 +316,21 @@ void HardwareSetup::run() { struct TransStruct * received; uint8_t uintBuf[4 * 6]; void * voidBuf; + + // flush existing data + struct termios config; + tcgetattr(fd, &config); + config.c_lflag = 0; // standard value is bad choosen + + tcsetattr(fd, TCSANOW, &config); + cout << "alles io" << endl; + ssize_t length = read(fd, uintBuf, 24); + if (length < 24) { + + tcflush(fd, TCIFLUSH); + // length = read(fd, uintBuf, 24); + } + while (!this->stop) { // read data