Parsing received serial
-
I want to parse some received serial data, the data is a reply from an external device.
uint8_t reply[32]; char* getReply = (char *) reply; serial->read(getReply, 17); QByteArray ba(getReply, 17); qDebug() << "Received: " << ba; serialBuffer += ba; qDebug() << "Serial Data: " << serialBuffer;The first reply is read as...
"Serial Data: \u001B\u0001 "The second reply is...
"Serial Data: \u001B\u00018888?"The 8888 is the data that i am interested in, what is the best way to parse this?
-
I want to parse some received serial data, the data is a reply from an external device.
uint8_t reply[32]; char* getReply = (char *) reply; serial->read(getReply, 17); QByteArray ba(getReply, 17); qDebug() << "Received: " << ba; serialBuffer += ba; qDebug() << "Serial Data: " << serialBuffer;The first reply is read as...
"Serial Data: \u001B\u0001 "The second reply is...
"Serial Data: \u001B\u00018888?"The 8888 is the data that i am interested in, what is the best way to parse this?
@Aeroplane123
Maybe you mean you want to look at what comes after the first 2 bytes? -
@Aeroplane123
Maybe you mean you want to look at what comes after the first 2 bytes?@JonB yes, exactly!
-
@JonB yes, exactly!
@Aeroplane123
Then do so!QByteArray::mid(2).