grag38 / qextserialport

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

Appears odd and even parity swapped in POSIX version.... #82

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I wrote some code to control a device running 38400 8 Odd 1 under windows and 
it all worked fine. Then recompiled under Linux and it would not talk properly. 
After some time I found changing the serial port setup to 38400 8 Even 1 solved 
the problem. It appears as thought the Even/Odd parity is swapped under the 
POSIX version. I have repeatedly tested this and got the same results. The 
published protocol for the device is 38400 8 Odd 1. (Sony VTR protocol). To 
make it work, the ports are setup as below for each OS.

Under Win:
    serialPort->setBaudRate( BAUD38400 );
    serialPort->setDataBits( DATA_8 );
    serialPort->setStopBits( STOP_1 );
    serialPort->setParity( PAR_ODD );

Under Linux:
    serialPort->setBaudRate( BAUD38400 );
    serialPort->setDataBits( DATA_8 );
    serialPort->setStopBits( STOP_1 );
    serialPort->setParity( PAR_EVEN );

Setting serialPort->setParity( PAR_ODD ); under Linux results is corrupt data 
being received.

I am using the current version (downloaded on 22/11/2010) of QextSerialport 
with Qt 4.5.3. The OSes are windows XP and Slackware 13.1

Thank you for time and efforts. Regards, BG4.

Original issue reported on code.google.com by skn...@gmail.com on 21 Nov 2010 at 9:32