Update pttyhandler.cpp

audioplugins
Phil Taylor 2021-03-04 21:10:00 +00:00
rodzic 229a2bc32f
commit 4accf1b559
1 zmienionych plików z 7 dodań i 13 usunięć

Wyświetl plik

@ -149,26 +149,20 @@ void pttyHandler::sendDataOut(const QByteArray& writeData)
mutex.lock();
#ifdef QT_DEBUG
qDebug(logSerial()) << "Data to term:";
printHex(writeData, false, true);
qint64 bytesWritten;
qint64 bytesWritten=0;
if (inPortData[2] != (char)0xE1) {
if (inPortData[2] != (char)0xE1 && inPortData[3] != (char)0xE1) {
bytesWritten = port->write(writeData);
if (bytesWritten != writeData.length()) {
qDebug(logSerial()) << "bytesWritten: " << bytesWritten << " length of byte array: " << writeData.length()\
<< " size of byte array: " << writeData.size()\
<< " Wrote all bytes? " << (bool)(bytesWritten == (qint64)writeData.size());
}
}
if (bytesWritten != writeData.length()) {
qDebug(logSerial()) << "bytesWritten: " << bytesWritten << " length of byte array: " << writeData.length()\
<< " size of byte array: " << writeData.size()\
<< " Wrote all bytes? " << (bool)(bytesWritten == (qint64)writeData.size());
}
#else
if (inPortData[2] != (char)0xE1) {
port->write(writeData);
}
#endif
mutex.unlock();
}