Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Hi, I try to send a QString by UART but only recieve one charcater. This is my code:
QString word = "Hello";
send = write(fd, word.toStdString().c_str(), strlen(word.toStdString().c_str()));
Only recieve H.
Any idea?
Maybe you are just getting the length of a pointer? Try with word.length() instead.
You don't want the StdString.
Use: @ write(fd, word.toLatin1().constData(), word.length()); @
Thanks it works now.