QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
LinkInterface Class Referenceabstract

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 ()
 
SigningControllersigning ()
 Per-link signing state and confirmation state machine. Non-null after channel allocation.
 
const SigningControllersigning () 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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~LinkInterface()

LinkInterface::~LinkInterface ( )
virtual

Definition at line 20 of file LinkInterface.cc.

References _config.

◆ LinkInterface()

LinkInterface::LinkInterface ( SharedLinkConfigurationPtr config,
QObject *  parent = nullptr 
)
explicitprotected

Links are only created by LinkManager so constructor is not public.

Definition at line 13 of file LinkInterface.cc.

Member Function Documentation

◆ _allocateMavlinkChannel()

bool LinkInterface::_allocateMavlinkChannel ( )
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().

◆ _connectionRemoved()

void LinkInterface::_connectionRemoved ( )
protected

Definition at line 109 of file LinkInterface.cc.

References disconnect().

Referenced by removeVehicleReference(), and MockLink::simulateConnectionRemoved().

◆ _freeMavlinkChannel()

void LinkInterface::_freeMavlinkChannel ( )
protectedvirtual

◆ addVehicleReference()

void LinkInterface::addVehicleReference ( )
inline

Definition at line 37 of file LinkInterface.h.

◆ bytesReceived

void LinkInterface::bytesReceived ( LinkInterface link,
const QByteArray &  data 
)
signal

◆ bytesSent

void LinkInterface::bytesSent ( LinkInterface link,
const QByteArray &  data 
)
signal

◆ communicationError

void LinkInterface::communicationError ( const QString &  title,
const QString &  error 
)
signal

◆ connected

void LinkInterface::connected ( )
signal

◆ decodedFirstMavlinkPacket()

bool LinkInterface::decodedFirstMavlinkPacket ( ) const
inline

Definition at line 34 of file LinkInterface.h.

Referenced by setDecodedFirstMavlinkPacket().

◆ disconnect()

virtual Q_INVOKABLE void LinkInterface::disconnect ( )
pure virtual

◆ disconnected

◆ isConnected()

virtual bool LinkInterface::isConnected ( ) const
pure virtual

◆ isLogReplay()

virtual bool LinkInterface::isLogReplay ( ) const
inlinevirtual

Reimplemented in LogReplayLink.

Definition at line 27 of file LinkInterface.h.

◆ isSecureConnection()

virtual bool LinkInterface::isSecureConnection ( ) const
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().

◆ linkConfiguration() [1/2]

◆ linkConfiguration() [2/2]

const SharedLinkConfigurationPtr LinkInterface::linkConfiguration ( ) const
inline

Definition at line 31 of file LinkInterface.h.

References _config.

◆ mavlinkChannel()

◆ mavlinkChannelIsSet()

◆ removeVehicleReference()

void LinkInterface::removeVehicleReference ( )

Definition at line 99 of file LinkInterface.cc.

References _connectionRemoved().

◆ reportMavlinkV1Traffic()

void LinkInterface::reportMavlinkV1Traffic ( )

Definition at line 119 of file LinkInterface.cc.

References linkConfiguration(), qgcApp, and QGC::showAppMessage().

Referenced by MAVLinkProtocol::receiveBytes().

◆ setDecodedFirstMavlinkPacket()

void LinkInterface::setDecodedFirstMavlinkPacket ( bool  decodedFirstMavlinkPacket)
inline

Definition at line 35 of file LinkInterface.h.

References decodedFirstMavlinkPacket().

Referenced by MAVLinkProtocol::resetMetadataForLink().

◆ signing() [1/2]

SigningController * LinkInterface::signing ( )
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().

◆ signing() [2/2]

const SigningController * LinkInterface::signing ( ) const
inline

Definition at line 43 of file LinkInterface.h.

◆ writeBytesThreadSafe()

void LinkInterface::writeBytesThreadSafe ( const char *  bytes,
int  length 
)

Definition at line 93 of file LinkInterface.cc.

Referenced by Vehicle::sendMessageOnLinkThreadSafe().

Friends And Related Symbol Documentation

◆ LinkManager

friend class LinkManager
friend

Definition at line 19 of file LinkInterface.h.

Member Data Documentation

◆ _config

SharedLinkConfigurationPtr LinkInterface::_config
protected

Definition at line 64 of file LinkInterface.h.

Referenced by linkConfiguration(), linkConfiguration(), and ~LinkInterface().


The documentation for this class was generated from the following files: