Which of the QIODevice::write() variants do you think accepts an int as its first argument? Your compiler will almost certainly be warning you about an " invalid conversion from ‘int’ to ‘const char*’ ", and mine flat out refused to compile this.
To send an int you need to send the four bytes in an agreed order: and you need to get them into a form that you can write().
Assuming you send write() valid parameters... the default operating mode of QExtSerialPort is event driven, so bytes are not sent until the program reaches the Qt event loop.




Reply With Quote
Bookmarks