The read looks like this:
char receiveBuffer[1024];
int bytesRead = port->read(receiveBuffer, qMin(port->bytesAvailable(), 1024));
port->open(QIODevice::ReadWrite);
char receiveBuffer[1024];
int bytesRead = port->read(receiveBuffer, qMin(port->bytesAvailable(), 1024));
To copy to clipboard, switch view to plain text mode
I don't think there is anything more you can do there.
I got a hint from the mailing list that opening the port in unbuffered mode might do the trick:
port
->open
(QIODevice::ReadWrite|QIODevice
::Unbuffered);
port->open(QIODevice::ReadWrite|QIODevice::Unbuffered);
To copy to clipboard, switch view to plain text mode
And it's true. It reads lighning fast now. However, you don't get a nice packet stream anymore, where one read returns one or more complete packets, but some kind of byte mess of random sizes that you have to glue together to whole packets. This is not a problem though, it's just a couple of lines of code and it works reliably and faster than ever.
Bookmarks