Add methods to receive and write raw FSD messages

This commit adds methods to register for live FSD message reception. The
amount of traffic can be quite high, therefore no normal signal is used -
which would be available via DBus. Instead one has to connect manually
by passing a functor. This guarantees that we communicate only in-process.
If someone tries to connect on the proxy side, the connection will fail.
This needs to be handled properly in client code.
This commit also adds a method to write the FSD message to a selected file.

Maniphest Tasks: T222
This commit is contained in:
Roland Winklmeier
2018-01-22 14:18:50 +01:00
parent 7b9ad0ea07
commit 704068d299
13 changed files with 236 additions and 2 deletions

View File

@@ -40,6 +40,8 @@
#include "blackmisc/statusmessage.h"
#include "blackmisc/weather/metar.h"
#include <functional>
//! \addtogroup dbus
//! @{
@@ -302,6 +304,13 @@ namespace BlackCore
//! Request parts for callsign (from another client)
virtual void testRequestAircraftConfig(const BlackMisc::Aviation::CCallsign &callsign) = 0;
public:
//! Raw FSD message receiver functor
using RawFsdMessageReceivedSlot = std::function<void(const BlackMisc::Network::CRawFsdMessage &)>;
//! Connect to receive raw fsd messages
virtual QMetaObject::Connection connectRawFsdMessageSignal(QObject *receiver, RawFsdMessageReceivedSlot rawFsdMessageReceivedSlot) = 0;
protected:
//! Constructor
IContextNetwork(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime) : CContext(mode, runtime) {}