diff --git a/src/comm/QGCXPlaneLink.cc b/src/comm/QGCXPlaneLink.cc index 42b7ad1d41fad120153567c2478c545e00bd9346..fa991fc308314d97ee03f0275a6eacca30b94046 100644 --- a/src/comm/QGCXPlaneLink.cc +++ b/src/comm/QGCXPlaneLink.cc @@ -553,8 +553,12 @@ void QGCXPlaneLink::readBytes() quint16 senderPort; unsigned int s = socket->pendingDatagramSize(); - if (s > maxLength) std::cerr << __FILE__ << __LINE__ << " UDP datagram overflow, allowed to read less bytes than datagram size" << std::endl; + if (s > maxLength) std::cerr << __FILE__ << __LINE__ << " UDP datagram overflow, allowed to read less bytes than datagram size: " << s << std::endl; socket->readDatagram(data, maxLength, &sender, &senderPort); + if (s > maxLength) { + std::string headStr = std::string(data, data+5); + std::cerr << __FILE__ << __LINE__ << " UDP datagram header: " << headStr << std::endl; + } // Calculate the number of data segments a 36 bytes // XPlane always has 5 bytes header: 'DATA@'