From a55c7e678f5c8db4a2498f320179c6085e5c2985 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 3 Aug 2013 00:59:18 +0200 Subject: [PATCH] Added proper signal for unknown messages --- src/uas/UAS.cc | 10 +--------- src/uas/UASInterface.h | 3 +++ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index e932005e3c..3aaf144103 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -1532,15 +1532,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) { unknownPackets.append(message.msgid); - // XXX Do NOT show this to users, as they will attribute - // completely random problems to this message and won't - // even bother to look up what the message actually is. - -// QString errString = tr("UNABLE TO DECODE MESSAGE NUMBER %1").arg(message.msgid); -// //GAudioOutput::instance()->say(errString+tr(", please check console for details.")); -// emit textMessageReceived(uasId, message.compid, 255, errString); -// std::cout << "Unable to decode message from system " << std::dec << static_cast(message.sysid) << " with message id:" << static_cast(message.msgid) << std::endl; -// //qDebug() << std::cerr << "Unable to decode message from system " << std::dec << static_cast(message.acid) << " with message id:" << static_cast(message.msgid) << std::endl; + emit packetNotHandled(uasId, message.compid, message.msgid); } } break; diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index 127a51fb13..37382e3eb4 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -643,6 +643,9 @@ signals: // HOME POSITION / ORIGIN CHANGES void homePositionChanged(int uas, double lat, double lon, double alt); + /** @brief The system received an unknown message, which it could not interpret */ + void unknownPacketReceived(int uas, int component, int messageid); + protected: // TIMEOUT CONSTANTS -- GitLab