Hi, I have a problem with obtaining data through a serial port of an anemometer. The reading data is sent in three parts, that is, "\ x02" "4", "208110000026", "5 \ r" the number of elements in each QByteArray is variable. The first QbyteArray always has as the first element \ x02 "and the third QbyteArray always has the last element \ r. According to the manual, it should have for each serial port read a string as follows" \ x02 "" 42081100000265 \ r " I want to rebuild the string looking for the beginning of text "\ x02" and the end of text "\ r" but when reading the first element of the QBytearray that is "\ x02" I get an empty element. How can I find the "\ x02 "and" \ r "to be able to rebuild in a Qbytearray (" \ x02 "" 42081100000265 \ r ") and process the data in order to obtain the reading of the device?
Thanks for help me


void Widget::readSerialPort()
{
qDebug() << "Serial port read start";
QByteArray data=anemometerSerialPort->readAll();
qDebug() << data;//first reading ("\x02""4") , second reading"208110000026", third reading ("5\r").
qDebug() << data.at(0);//first reading ( ) , second reading (2), third reading (5).
qDebug() << "End of serial port reading";
repairDataString(data);
}