np43 / qextserialport

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

on Windows, 'write' returns 0 bytes written even when it writes all the data properly. #125

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build & Run the attached Qt command line program
2.
3.

What is the expected output? What do you see instead?
The 'write' command should return number of characters transmitted.
Instead it returns 0.

What version of the product are you using? On what operating system?
Qt is version 4.8.0, Qt Creator is 2.4.1. QextSerialPort is 1.2beta1.

Please provide any additional information below.
The attached program uses an environment variable to find the qextserialport 
libraries from it's .pro file. Either set the env var, or tweak the .pro file 
appropriately.

I tried various values for timeout (including 0 aka wait forever) and had no 
luck.

In all cases, the data seems to be properly transmitted.

May be related to issue 103, which I was having trouble understanding.

Original issue reported on code.google.com by mhko...@moberg.com on 5 Apr 2012 at 6:39

Attachments:

GoogleCodeExporter commented 9 years ago
Hi mhkohne,

Return value of write only works under Polling mode, timeout works under 
Polling mode too.

signal bytesWritten() can be used under EventDriven mode. perhaps what you need 
is QIODevice::waitForBytesWritten(), but unfortunately we have not implement it.

Original comment by dbzhang...@gmail.com on 6 Apr 2012 at 4:23

GoogleCodeExporter commented 9 years ago
Ahh, the problem on my end is that I was under the mistaken impression that the 
default was Polling mode, when in fact it is EventDriven. I'm unclear how I got 
that incorrect impression, thank you for clearing it up.

Original comment by mhko...@moberg.com on 6 Apr 2012 at 11:42

GoogleCodeExporter commented 9 years ago

Original comment by dbzhang...@gmail.com on 10 Apr 2012 at 3:59