Mr-Ntic / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

implement canReadLine() #124

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What new feature(s) would you like to see included?

It would be really great if you could put implementation of canReadLine() on 
your TODO list.
Many devices I work with (anemometers, weather stations etc.) send data sets 
continuously line by line. I noticed canReadLine() always returns false, but 
simple check as in following code seems working fine:

QByteArray peek;
peek = port->peek(512);
if(!peek.contains("\n"))
   return;
qDebug() << port->readLine();

However, QIODevice::canReadLine() documentation says it's important to call 
base implementation, what I can't do, and it would be more efficient to do such 
a check on internal buffer instead of creating QByteArray and peeking data all 
the time.

Original issue reported on code.google.com by a...@serpentden.com on 30 Mar 2012 at 8:13

GoogleCodeExporter commented 8 years ago
Thank, Hope that we can fix it this weekend.

Original comment by dbzhang...@gmail.com on 30 Mar 2012 at 5:01

GoogleCodeExporter commented 8 years ago

Original comment by dbzhang...@gmail.com on 31 Mar 2012 at 10:21