3#include <QtCore/QElapsedTimer>
4#include <QtQmlIntegration/QtQmlIntegration>
12class QLoggingCategory;
92 void _shutdownWorkerThread(QThread *thread,
const QLoggingCategory &category,
bool allowTerminate =
true);
98 virtual void _writeBytes(
const QByteArray &bytes) = 0;
102 virtual bool _connect() = 0;
104 void _orphanWorkerThread(QThread *thread);
106 uint8_t _mavlinkChannel = std::numeric_limits<uint8_t>::max();
107 bool _decodedFirstMavlinkPacket =
false;
108 int _vehicleReferenceCount = 0;
109 bool _mavlinkV1TrafficReported =
false;
110 bool _mavlinkV2TrafficSeen =
false;
111 bool _radioStatusSeen =
false;
112 QElapsedTimer _mavlinkV1FirstSeenTimer;
116 std::unique_ptr<SigningController> _signingController;
std::shared_ptr< LinkConfiguration > SharedLinkConfigurationPtr
std::shared_ptr< LinkInterface > SharedLinkInterfacePtr
std::weak_ptr< LinkInterface > WeakLinkInterfacePtr
struct __mavlink_message mavlink_message_t
The link interface defines the interface for all links used to communicate with the ground station ap...
void bytesReceived(LinkInterface *link, const QByteArray &data)
void setDecodedFirstMavlinkPacket(bool decodedFirstMavlinkPacket)
uint8_t mavlinkChannel() const
void _shutdownWorkerThread(QThread *thread, const QLoggingCategory &category, bool allowTerminate=true)
void addVehicleReference()
virtual void _freeMavlinkChannel()
virtual bool isLogReplay() const
bool decodedFirstMavlinkPacket() const
virtual Q_INVOKABLE void disconnect()=0
void sendMessageThreadSafe(mavlink_message_t &message)
void reportMavlinkV1Traffic()
virtual bool isRadioLink() const
const SharedLinkConfigurationPtr linkConfiguration() const
void reportMavlinkV2Traffic()
Called when a v2 message is received: permanently suppresses the v1-only warning for this link.
void _connectionRemoved()
bool mavlinkChannelIsSet() const
virtual bool isConnected() const =0
virtual bool _allocateMavlinkChannel()
SigningController * signing()
Per-link signing state and confirmation state machine. Non-null after channel allocation.
bool mavlinkV1TrafficReported() const
void removeVehicleReference()
virtual bool isSecureConnection() const
void communicationError(const QString &title, const QString &error)
const SigningController * signing() const
static void setMavlinkV1TrafficGraceMsecs(int msecs)
void bytesSent(LinkInterface *link, const QByteArray &data)
void writeBytesThreadSafe(const char *bytes, int length)
static constexpr int kMavlinkV1TrafficGraceMsecsDefault
SharedLinkConfigurationPtr linkConfiguration()
SharedLinkConfigurationPtr _config
void reportRadioStatusReceived()
Manage communication links The Link Manager organizes the physical Links. It can manage arbitrary lin...
Owns MAVLink signing state and the deferred-confirmation state machine for one LinkInterface.