PDA

View Full Version : Qextserialport write problems



kikin
28th February 2012, 17:58
Hi , i have one problem in qextserialport write.

i have a string and i send char by char, but when the char is null value (char(0)) , never send the value and nver send the rest of the frame

here is the code where i think is the problem... if the result of the division is 0, it means QChar(0), never send the null value in ascii, and i need it cause for me this value (0x00) is important.


cad= cad + QChar(Value_SP[i] % 256) + QChar(int(Value_SP[i]/256))

port->write(Cad.toAscii().data());


please help me

kikin

kuzulis
29th February 2012, 06:47
Try use QSerialDevice 2.0 (http://gitorious.org/qserialdevice/qserialdevice/archive-tarball/2.0)

Lesiok
29th February 2012, 11:36
Try use QSerialDevice 2.0 (http://gitorious.org/qserialdevice/qserialdevice/archive-tarball/2.0)

Your advice is meaningless. The problem is to use the wrong version of the QIODevice :: write method not bad version of library.