mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 11:46:34 +00:00
Fixes for A8 remote control. Added logging messages
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
#include "remoteControl.hpp"
|
||||
|
||||
RemoteControl::RemoteControl(QObject *parent)
|
||||
: QObject{parent}
|
||||
: QObject{parent}, mIsBusy(false)
|
||||
{
|
||||
mUdpSocket = new QUdpSocket(this);
|
||||
connect(mUdpSocket, &QUdpSocket::readyRead, this, &RemoteControl::readPendingDatagrams);
|
||||
@@ -23,6 +23,8 @@ RemoteControl::RemoteControl(QObject *parent)
|
||||
|
||||
void RemoteControl::readPendingDatagrams()
|
||||
{
|
||||
qDebug() << "readPendingDatagrams() Got UDP message!";
|
||||
|
||||
while (mUdpSocket->hasPendingDatagrams()) {
|
||||
QByteArray datagram;
|
||||
datagram.resize(mUdpSocket->pendingDatagramSize());
|
||||
@@ -37,9 +39,11 @@ void RemoteControl::readPendingDatagrams()
|
||||
|
||||
if (jsonDoc.isObject()) {
|
||||
if (mIsBusy == false) {
|
||||
qDebug() << "readPendingDatagrams() mIsBusy == false! Processing JSON";
|
||||
processJSON(jsonDoc);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
qWarning().noquote().nospace() << "Received data was not JSON object.";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user