Skip to content

Commit

Permalink
Add serverConnected signal.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien-B committed Apr 27, 2021
1 parent 7ba2e50 commit eac7a8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pprzlinkQt/include/pprzlinkQt/IvyQtLink.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace pprzlink {
long sendRequest(const Message& msg, messageCallback_t cb);

signals:
void serverConnected();

private:
const MessageDictionary &dictionary;
Expand Down
7 changes: 7 additions & 0 deletions pprzlinkQt/src/IvyQtLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ namespace pprzlink {
bus = new IvyQt(appName, appName + " ready", this);
auto ip_port = domain.split(":");
assert(ip_port.size() == 2);

connect(bus, &IvyQt::peerReady, this, [=](Peer* peer){
if(peer->name() == "Paparazzi server") {
emit serverConnected();
}
});

bus->start(ip_port[0], ip_port[1].toUInt());
}

Expand Down

0 comments on commit eac7a8b

Please sign in to comment.