Parsing UDP data failure (solved)
-
I successfully read 1st byte. My question is how to read subsequent next 4 bytes and subsequent 1 bytes till last bit.
Mycode:
QDataStream in(UDPdataRec); //UDPdataRec is 17 bytes
qint8 n;
in>>n;
qDebug()<<n; -
I can solved the problem by setting different variable size
qint8 a;
qint32 b;
qint64 c;and push QDatastream into each variable by sequence using in keyword.
in>>a>>b>>c