CodePudding user response:
Suggest you take MCU receives the first look at what is specific data,CodePudding user response:
Real hair is binary stream, don't use QString, if there is zero, will be broken, you can use the write (const char *, qint64 maxSize), as for is unsigned and signed is indifferent, is given first address to send blocks of data, and inform the length is ok, also can put the array in the QByteArray, using the write (const QByteArray & amp; ByteArray containing)CodePudding user response:
Feel, you seem to understand some things is not enough such as "/x11/x22 \ x33" and "112233", "\ x30 \ x31 \ x32" and "123", etcCodePudding user response:
Qt has special serial interface classCodePudding user response:
The building Lord, is you this problem solved? I met the same problem with you, I also do not understand, what I use be a QByteArray array ((const char *) shuzu, sizeof (shuzu))//shuzu is unsigned char array; Then write serial port (array), and then all the data back to the upper machine under a machine, but I receive twice to send data to the data, and the received data has a problem, all seem to is 0, the text edit field not displayed, do I have a similar problem? The solution?