Commit f80968c5 authored by Bryant Mairs's avatar Bryant Mairs

Removed some unused debugging code from QGCXPlaneLink.

parent 03e904d5
......@@ -404,35 +404,16 @@ Eigen::Matrix3f euler_to_wRo(double yaw, double pitch, double roll) {
void QGCXPlaneLink::writeBytes(const char* data, qint64 size)
{
if (!data) return;
//#define QGCXPlaneLink_DEBUG
#if 1
QString bytes;
QString ascii;
for (int i=0; i<size; i++)
// If socket exists and is connected, transmit the data
if (socket && connectState)
{
unsigned char v = data[i];
bytes.append(QString().sprintf("%02x ", v));
if (data[i] > 31 && data[i] < 127)
{
ascii.append(data[i]);
}
else
{
ascii.append(219);
}
socket->writeDatagram(data, size, remoteHost, remotePort);
}
//qDebug() << "Sent" << size << "bytes to" << remoteHost.toString() << ":" << remotePort << "data:";
//qDebug() << bytes;
//qDebug() << "ASCII:" << ascii;
#endif
if (connectState && socket) socket->writeDatagram(data, size, remoteHost, remotePort);
}
/**
* @brief Read a number of bytes from the interface.
*
* @param data Pointer to the data byte array to write the bytes to
* @param maxLength The maximum number of bytes to write
* @brief Read all pending packets from the interface.
**/
void QGCXPlaneLink::readBytes()
{
......@@ -449,11 +430,6 @@ void QGCXPlaneLink::readBytes()
if (s > maxLength) std::cerr << __FILE__ << __LINE__ << " UDP datagram overflow, allowed to read less bytes than datagram size" << std::endl;
socket->readDatagram(data, maxLength, &sender, &senderPort);
QByteArray b(data, s);
/*// Print string
QString state(b)*/;
// Calculate the number of data segments a 36 bytes
// XPlane always has 5 bytes header: 'DATA@'
unsigned nsegs = (s-5)/36;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment