np43 / qextserialport

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

API bug - dataReady() signal #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use QextSerialPort in Event mode

What is the expected output? What do you see instead?
The expected dataReady() signal behavior is to emit one
signal on data arrival. Signal is emited continuously if
there is any data left in the buffer. QIODevice API documentation
explicitly prohibits this behavior.

What version of the product are you using? On what operating system?
Source snapshot. 18 Jan 2010. Debian GNU/Linux (Squeeze)

Please provide any additional information below.
There should be separate signal for signalling data in the buffer. Current
behavior breaks expected QIODevice behavior.

Original issue reported on code.google.com by tntr...@gmail.com on 17 Jan 2010 at 11:24

GoogleCodeExporter commented 9 years ago
I'm not sure off the top of my head what the best thing to do about this is.  
Currently, the readyRead() signal is hooked up directly to QSocketNotifier.  
Kind of a 
pain to try and track whether something has actually been read since the last 
signal 
was emitted...

Let us know if you have any thoughts.

Original comment by lst...@gmail.com on 28 Jan 2010 at 11:18

GoogleCodeExporter commented 9 years ago
Maybe compare bytesAvailable() between the two snapshots?

Original comment by stephan....@gmail.com on 13 Feb 2010 at 11:00

GoogleCodeExporter commented 9 years ago
Istask wrote:
> Let us know if you have any thoughts.

Maybe use double buffer in event mode? Read all data from
serial port buffer to internal class buffer on QSocketNotifier
signal. Emit dataReady() ONCE after this.

This may be a bit complicated since you have to rewrite all read/write
functions to handle double-buffering.

Original comment by tntr...@gmail.com on 20 Feb 2010 at 2:15

GoogleCodeExporter commented 9 years ago
Yeah - I think having a buffered option would be the way to go.  Patches 
welcome :)

Original comment by lst...@gmail.com on 10 Mar 2010 at 7:46

GoogleCodeExporter commented 9 years ago
Thanks

Original comment by dbzhang...@gmail.com on 16 Mar 2012 at 8:13