Alex22
18th November 2016, 07:30
Hi
I have two questions. I need first to put 20 bytes into a string[20]. In C++ i did that by this code:
string[0]='ab'; //ab is in Hex (0xab)
string[1]='50'; //50 is in Hex (0x50)
.
.
.
string[19]='54' //54 is in Hex
After filling string[20], i must send it by serial port.
My first question is: how could i write above code in Qt to send by a serialport?
and my second question is: can i use QByteArray and then use QSerialPort::write(QByteArray)?
I have two questions. I need first to put 20 bytes into a string[20]. In C++ i did that by this code:
string[0]='ab'; //ab is in Hex (0xab)
string[1]='50'; //50 is in Hex (0x50)
.
.
.
string[19]='54' //54 is in Hex
After filling string[20], i must send it by serial port.
My first question is: how could i write above code in Qt to send by a serialport?
and my second question is: can i use QByteArray and then use QSerialPort::write(QByteArray)?