I am currently writing a parser for Asterix Cat 240 (Open standard for transmitting radar video data) and it works perfectly, but I do not know, why do I need type conversion?
rawAsterix.videoHR = static_cast<quint8>(buffer->at(i));
rawAsterix.videoHR = (rawAsterix.videoHR << 8) + static_cast<quint8>(buffer->at(i+1));
rawAsterix.videoHR = (rawAsterix.videoHR << 8) + static_cast<quint8>(buffer->at(i+2));
rawAsterix.videoHR = (rawAsterix.videoHR << 8) + static_cast<quint8>(buffer->at(i+3));
i+=4
buffer is a QByteArray
, whish holds the data received by QUdpSocket
.
At first I had no type conversion whish resulted (sometimes not every time) in strange behaviour. Why is that so?