lemanhtrung / qextserialport

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

Can't write under W7 #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Linking against the library
2.
3.

What is the expected output?
Being able to write to the serial device

What do you see instead?
With Polling:
in QextSerialPort::writeData():
WriteFile() returns 'true' (success) after several seconds, but 0 bytes
have been written.
The buffer is legal, and is 35 bytes long.

With EventDriven:
the execution goes in to the "ERROR_IO_PENDING" section, which is ok,
exists the function, and thats it.
No events are being caught (or sent) to the onWinEvent() method.

What version of the product are you using? 
The hg change set number is 105.

On what operating system?
Windows 7

Please provide any additional information below.
Hardware two various USB-Serail converters.
They both work with other software, so its not a hardware/driver issue.

A good way to test (also for other issues) would be if you supplied a test
program that also does writing.

Original issue reported on code.google.com by the...@gmail.com on 22 Mar 2010 at 2:03

GoogleCodeExporter commented 9 years ago
FIY:
I just tried it with the last version from the sourceforge site, and it works.

Original comment by the...@gmail.com on 23 Mar 2010 at 9:42

GoogleCodeExporter commented 9 years ago
Have you created the serial port in a separate thread, or something like that?  
Can you provide a reduction of 
your code?  Not sure what might be going on - I've successfully used the 
current incarnation on Win7..

Original comment by lst...@gmail.com on 23 Mar 2010 at 2:54

GoogleCodeExporter commented 9 years ago
No, the object is not in a separate thread.
I can provide the code, but its just the basics, i.e setting up the port 
settings,
opening the port, and writing data.

As I said, my code works as is, with the old version from srouceforge, so it 
can't be
something in my code.

I see that changes have been made to writeData() since that version, so I guess 
it
lies in those changes.
I don't have time at the moment to go deeper in to this, but I will later, and 
try to
fix what ever is the problem there, unless you beat me to it! ;-)

Cheers.

Original comment by the...@gmail.com on 23 Mar 2010 at 6:32

GoogleCodeExporter commented 9 years ago
i have the same problem on win xp sp3.(EventDriven) test with com0com.
QextSerialPort::writeData() goes into 
if (GetLastError() == ERROR_IO_PENDING) {
            // writing asynchronously...not an error
            QWriteLocker writelocker(bytesToWriteLock);
            _bytesToWrite += maxSize;
            pendingWrites.append(newOverlapWrite);
        }

then _bytesToWrite increase every QextSerialPort::write call, nothing send out 
in
fact,but receive data is fine,just no sending to other side.

Original comment by slic...@gmail.com on 25 May 2010 at 5:17

GoogleCodeExporter commented 9 years ago
Hi,

Is this issue still valid or not in Qesp-beta?

Original comment by dbzhang...@gmail.com on 20 Aug 2012 at 8:24

GoogleCodeExporter commented 9 years ago
Hello,

I don't know if it is relevant to post here nearly 3 years after the first 
post, so I apologise in advance if it is not.

I was experiencing the same problem. The write method was returning me 0 bytes 
written. In fact if I don't check that returned value, it seems that datas are 
correctly written on the serial port. The connected device is answering fine.

Something strange that happened to me was that I created two applications using 
the QExtserialPort library and the issue appeared only on one of them (both 
were used on the same Windows 7 environment).

Best reguards

Original comment by mael.ga...@gmail.com on 28 Jan 2013 at 11:22