diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc index c67453f4a6fef167b003ba0dcf4823a3739ef033..ad4860aa06e58306456e41ea5996c02dc2ea3e4a 100644 --- a/src/comm/LinkManager.cc +++ b/src/comm/LinkManager.cc @@ -33,6 +33,8 @@ This file is part of the PIXHAWK project #include #include "LinkManager.h" +#include + LinkManager* LinkManager::instance() { static LinkManager* _instance = 0; if(_instance == 0) { @@ -79,7 +81,8 @@ void LinkManager::addProtocol(LinkInterface* link, ProtocolInterface* protocol) // the protocol will receive new bytes from the link connect(link, SIGNAL(bytesReady(LinkInterface*)), protocol, SLOT(receiveBytes(LinkInterface*))); // Store the connection information in the protocol links map - protocolLinks.insert(protocol, link); + protocolLinks.insertMulti(protocol, link); + //qDebug() << __FILE__ << __LINE__ << "ADDED LINK TO PROTOCOL" << link->getName() << protocol->getName() << "NEW SIZE OF LINK LIST:" << protocolLinks.size(); } QList LinkManager::getLinksForProtocol(ProtocolInterface* protocol) diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index 06c1d218069786b1c02ba96717e8eeef72d3c6f2..4bbf0a19c0c21ff66341fc83c390ce3b70acab99 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -323,6 +323,7 @@ void MAVLinkProtocol::sendMessage(mavlink_message_t message) for (i = links.begin(); i != links.end(); ++i) { sendMessage(*i, message); + qDebug() << __FILE__ << __LINE__ << "SENT HEARTBEAT MESSAGE OVER" << ((LinkInterface*)*i)->getName() << "LIST SIZE:" << links.size(); } } diff --git a/src/comm/MAVLinkXMLParser.cc b/src/comm/MAVLinkXMLParser.cc index 645841e01cd9c8d82c5928fb3563541b27a3daaf..a49af8042b0539e94b24e9eb6fefbb47429bd718 100644 --- a/src/comm/MAVLinkXMLParser.cc +++ b/src/comm/MAVLinkXMLParser.cc @@ -206,7 +206,7 @@ bool MAVLinkXMLParser::generate() QString encode = "static inline uint16_t mavlink_msg_%1_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const %2* %1)\n{\n\treturn mavlink_msg_%1_pack(%3);\n}\n"; QString decode = "static inline void mavlink_msg_%1_decode(const mavlink_message_t* msg, %2* %1)\n{\n%3}\n"; - QString pack = "static inline uint16_t mavlink_msg_%1_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg%2)\n{\n\tmsg->msgid = MAVLINK_MSG_ID_%3;\n\tuint16_t i = 0;\n\n%4\n\treturn mavlink_finalize_message(msg, system_id, component_id, i);\n}\n\n"; + QString pack = "static inline uint16_t mavlink_msg_%1_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg%2)\n{\n\tuint16_t i = 0;\n\tmsg->msgid = MAVLINK_MSG_ID_%3;\n\n%4\n\treturn mavlink_finalize_message(msg, system_id, component_id, i);\n}\n\n"; QString compactSend = "#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS\n\nstatic inline void mavlink_msg_%3_send(%1 chan%5)\n{\n\t%2 msg;\n\tmavlink_msg_%3_pack(mavlink_system.sysid, mavlink_system.compid, &msg%4);\n\tmavlink_send_uart(chan, &msg);\n}\n\n#endif"; //QString compactStructSend = "#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS\n\nstatic inline void mavlink_msg_%3_struct_send(%1 chan%5)\n{\n\t%2 msg;\n\tmavlink_msg_%3_encode(mavlink_system.sysid, mavlink_system.compid, &msg%4);\n\tmavlink_send_uart(chan, &msg);\n}\n\n#endif"; QString unpacking = ""; diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index cc0f235c884da99f4b5a592f0a6870de11c25d41..b08c495404e2c7dc83ad9b608c3884b59eef0baf 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -118,9 +118,14 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) if (!links->contains(link)) { addLink(link); +// qDebug() << __FILE__ << __LINE__ << "ADDED LINK!" << link->getName(); } +// else +// { +// qDebug() << __FILE__ << __LINE__ << "DID NOT ADD LINK" << link->getName() << "ALREADY IN LIST"; +// } - //qDebug() << "UAS RECEIVED" << message.sysid << message.compid << message.msgid; +// qDebug() << "UAS RECEIVED from" << message.sysid << "component" << message.compid << "msg id" << message.msgid << "seq no" << message.seq; if (message.sysid == uasId) { diff --git a/src/ui/CommConfigurationWindow.cc b/src/ui/CommConfigurationWindow.cc index 3b97555aeb9a1ef5927d8066c76b2b1d08e7fdc9..3b325ced1b835049de6d6bd7dda8b7562abb0f73 100644 --- a/src/ui/CommConfigurationWindow.cc +++ b/src/ui/CommConfigurationWindow.cc @@ -99,7 +99,7 @@ CommConfigurationWindow::CommConfigurationWindow(LinkInterface* link, ProtocolIn } else if (dynamic_cast(link) != 0) { - ui.linkGroupBox->setTitle(tr("serial link")); + ui.linkGroupBox->setTitle(tr("udp link")); } else {