Open pty non-blocking

merge-requests/5/head
Phil Taylor 2021-05-31 18:11:24 +01:00
rodzic cddb8fd055
commit 00e7c0aed8
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -53,7 +53,7 @@ void pttyHandler::openPort()
} }
#else #else
// Generic method in Linux/MacOS to find a pty // Generic method in Linux/MacOS to find a pty
ptfd = ::posix_openpt(O_RDWR | O_NOCTTY); ptfd = ::posix_openpt(O_RDWR | O_NONBLOCK);
if (ptfd >=0) if (ptfd >=0)
{ {
@ -115,6 +115,7 @@ pttyHandler::~pttyHandler()
void pttyHandler::receiveDataFromRigToPtty(const QByteArray& data) void pttyHandler::receiveDataFromRigToPtty(const QByteArray& data)
{ {
int fePos=data.lastIndexOf((char)0xfe); int fePos=data.lastIndexOf((char)0xfe);
if (fePos>0) if (fePos>0)
fePos=fePos-1; fePos=fePos-1;
@ -133,7 +134,7 @@ void pttyHandler::receiveDataFromRigToPtty(const QByteArray& data)
// 0xE0 = pseudo-term host // 0xE0 = pseudo-term host
// 0x00 = broadcast to all // 0x00 = broadcast to all
//qInfo(logSerial()) << "Sending data from radio to pseudo-terminal"; //qInfo(logSerial()) << "Sending data from radio to pseudo-terminal";
sendDataOut(data.mid(fePos)); sendDataOut(data);
} }
} }