|
QGroundControl
Ground Control Station for MAVLink Drones
|
The link interface defines the interface for all links used to communicate with the ground station application. More...
#include <LinkInterface.h>
Inheritance diagram for LinkInterface:
Collaboration diagram for LinkInterface:Signals | |
| void | bytesReceived (LinkInterface *link, const QByteArray &data) |
| void | bytesSent (LinkInterface *link, const QByteArray &data) |
| void | connected () |
| void | disconnected () |
| void | communicationError (const QString &title, const QString &error) |
Public Member Functions | |
| virtual | ~LinkInterface () |
| virtual Q_INVOKABLE void | disconnect ()=0 |
| virtual bool | isConnected () const =0 |
| virtual bool | isLogReplay () const |
| virtual bool | isSecureConnection () const |
| Returns true if the connection is secure (e.g. USB, wired ethernet) | |
| SharedLinkConfigurationPtr | linkConfiguration () |
| const SharedLinkConfigurationPtr | linkConfiguration () const |
| uint8_t | mavlinkChannel () const |
| bool | mavlinkChannelIsSet () const |
| bool | decodedFirstMavlinkPacket () const |
| void | setDecodedFirstMavlinkPacket (bool decodedFirstMavlinkPacket) |
| void | writeBytesThreadSafe (const char *bytes, int length) |
| void | addVehicleReference () |
| void | removeVehicleReference () |
| void | reportMavlinkV1Traffic () |
| SigningController * | signing () |
| Per-link signing state and confirmation state machine. Non-null after channel allocation. | |
| const SigningController * | signing () const |
Protected Member Functions | |
| LinkInterface (SharedLinkConfigurationPtr &config, QObject *parent=nullptr) | |
| Links are only created by LinkManager so constructor is not public. | |
| virtual bool | _allocateMavlinkChannel () |
| virtual void | _freeMavlinkChannel () |
| void | _connectionRemoved () |
Protected Attributes | |
| SharedLinkConfigurationPtr | _config |
Friends | |
| class | LinkManager |
The link interface defines the interface for all links used to communicate with the ground station application.
Definition at line 14 of file LinkInterface.h.
|
virtual |
Definition at line 20 of file LinkInterface.cc.
References _config.
|
explicitprotected |
Links are only created by LinkManager so constructor is not public.
Definition at line 13 of file LinkInterface.cc.
|
protectedvirtual |
Called by the LinkManager during LinkInterface construction instructing the link to setup channels. Default implementation allocates a single channel. But some link types (such as MockLink) need more than one.
Definition at line 43 of file LinkInterface.cc.
References LinkManager::allocateMavlinkChannel(), LinkManager::instance(), isSecureConnection(), and mavlinkChannelIsSet().
|
protected |
Definition at line 109 of file LinkInterface.cc.
References disconnect().
Referenced by removeVehicleReference(), and MockLink::simulateConnectionRemoved().
|
protectedvirtual |
Definition at line 72 of file LinkInterface.cc.
References LinkManager::freeMavlinkChannel(), LinkManager::instance(), LinkManager::invalidMavlinkChannel(), mavlink_get_channel_status(), and mavlinkChannelIsSet().
|
inline |
Definition at line 37 of file LinkInterface.h.
|
signal |
Referenced by LinkManager::createConnectedLink(), and MockLink::respondWithMavlinkMessage().
|
signal |
Referenced by LinkManager::createConnectedLink().
|
signal |
Referenced by LinkManager::createConnectedLink().
|
signal |
|
inline |
Definition at line 34 of file LinkInterface.h.
Referenced by setDecodedFirstMavlinkPacket().
|
pure virtual |
Implemented in MockLink, BluetoothLink, LogReplayLink, TCPLink, and UDPLink.
Referenced by _connectionRemoved(), and LinkManager::removeConfiguration().
|
signal |
|
pure virtual |
Implemented in MockLink, BluetoothLink, LogReplayLink, SerialLink, TCPLink, and UDPLink.
Referenced by Vehicle::sendMessageOnLinkThreadSafe().
|
inlinevirtual |
Reimplemented in LogReplayLink.
Definition at line 27 of file LinkInterface.h.
|
inlinevirtual |
Returns true if the connection is secure (e.g. USB, wired ethernet)
Reimplemented in SerialLink, TCPLink, and UDPLink.
Definition at line 28 of file LinkInterface.h.
Referenced by _allocateMavlinkChannel().
|
inline |
Definition at line 30 of file LinkInterface.h.
References _config.
Referenced by LinkManager::isLinkUSBDirect(), reportMavlinkV1Traffic(), MockLink::run10HzTasks(), MockLink::run1HzTasks(), and MockLink::run500HzTasks().
|
inline |
Definition at line 31 of file LinkInterface.h.
References _config.
| uint8_t LinkInterface::mavlinkChannel | ( | ) | const |
Definition at line 29 of file LinkInterface.cc.
References mavlinkChannelIsSet().
Referenced by MAVLinkProtocol::receiveBytes(), MAVLinkProtocol::resetMetadataForLink(), MAVLinkProtocol::resetSequenceTracking(), MockLinkCamera::sendCameraHeartbeats(), and MockLink::sendUnexpectedCommandAck().
| bool LinkInterface::mavlinkChannelIsSet | ( | ) | const |
Definition at line 38 of file LinkInterface.cc.
References LinkManager::invalidMavlinkChannel().
Referenced by _allocateMavlinkChannel(), _freeMavlinkChannel(), mavlinkChannel(), MockLink::run10HzTasks(), MockLink::run1HzTasks(), and MockLink::run500HzTasks().
| void LinkInterface::removeVehicleReference | ( | ) |
Definition at line 99 of file LinkInterface.cc.
References _connectionRemoved().
| void LinkInterface::reportMavlinkV1Traffic | ( | ) |
Definition at line 119 of file LinkInterface.cc.
References linkConfiguration(), qgcApp, and QGC::showAppMessage().
Referenced by MAVLinkProtocol::receiveBytes().
|
inline |
Definition at line 35 of file LinkInterface.h.
References decodedFirstMavlinkPacket().
Referenced by MAVLinkProtocol::resetMetadataForLink().
|
inline |
Per-link signing state and confirmation state machine. Non-null after channel allocation.
Definition at line 42 of file LinkInterface.h.
Referenced by MAVLinkProtocol::receiveBytes().
|
inline |
Definition at line 43 of file LinkInterface.h.
| void LinkInterface::writeBytesThreadSafe | ( | const char * | bytes, |
| int | length | ||
| ) |
Definition at line 93 of file LinkInterface.cc.
Referenced by Vehicle::sendMessageOnLinkThreadSafe().
|
friend |
Definition at line 19 of file LinkInterface.h.
|
protected |
Definition at line 64 of file LinkInterface.h.
Referenced by linkConfiguration(), linkConfiguration(), and ~LinkInterface().