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 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 ()
 
bool initMavlinkSigning ()
 
void setSigningSignatureFailure (bool failure)
 
void reportMavlinkV1Traffic ()
 

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 13 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 64 of file LinkInterface.cc.

References initMavlinkSigning(), and mavlinkChannelIsSet().

◆ _connectionRemoved()

void LinkInterface::_connectionRemoved ( )
protected

Definition at line 116 of file LinkInterface.cc.

References disconnect().

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

◆ _freeMavlinkChannel()

void LinkInterface::_freeMavlinkChannel ( )
protectedvirtual

Definition at line 88 of file LinkInterface.cc.

References mavlinkChannelIsSet().

◆ addVehicleReference()

void LinkInterface::addVehicleReference ( )
inline

Definition at line 36 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 33 of file LinkInterface.h.

◆ disconnect()

virtual void LinkInterface::disconnect ( )
pure virtual

Implemented in MockLink, BluetoothLink, LogReplayLink, TCPLink, and UDPLink.

Referenced by _connectionRemoved().

◆ disconnected

void LinkInterface::disconnected ( )
signal

◆ initMavlinkSigning()

◆ isConnected()

virtual bool LinkInterface::isConnected ( ) const
pure virtual

◆ isLogReplay()

virtual bool LinkInterface::isLogReplay ( ) const
inlinevirtual

Reimplemented in LogReplayLink.

Definition at line 26 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 27 of file LinkInterface.h.

Referenced by initMavlinkSigning().

◆ linkConfiguration() [1/2]

SharedLinkConfigurationPtr LinkInterface::linkConfiguration ( )
inline

◆ linkConfiguration() [2/2]

const SharedLinkConfigurationPtr LinkInterface::linkConfiguration ( ) const
inline

Definition at line 30 of file LinkInterface.h.

◆ mavlinkChannel()

◆ mavlinkChannelIsSet()

bool LinkInterface::mavlinkChannelIsSet ( ) const

◆ removeVehicleReference()

void LinkInterface::removeVehicleReference ( )

Definition at line 106 of file LinkInterface.cc.

References _connectionRemoved().

◆ reportMavlinkV1Traffic()

void LinkInterface::reportMavlinkV1Traffic ( )

Definition at line 136 of file LinkInterface.cc.

References linkConfiguration(), and qgcApp.

Referenced by MAVLinkProtocol::receiveBytes().

◆ setDecodedFirstMavlinkPacket()

void LinkInterface::setDecodedFirstMavlinkPacket ( bool  decodedFirstMavlinkPacket)
inline

Definition at line 34 of file LinkInterface.h.

Referenced by MAVLinkProtocol::resetMetadataForLink().

◆ setSigningSignatureFailure()

void LinkInterface::setSigningSignatureFailure ( bool  failure)

Definition at line 126 of file LinkInterface.cc.

References communicationError().

◆ writeBytesThreadSafe()

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

Definition at line 100 of file LinkInterface.cc.

Referenced by Vehicle::sendMessageOnLinkThreadSafe().

Friends And Related Symbol Documentation

◆ LinkManager

friend class LinkManager
friend

Definition at line 18 of file LinkInterface.h.

Member Data Documentation

◆ _config

SharedLinkConfigurationPtr LinkInterface::_config
protected

Definition at line 61 of file LinkInterface.h.

Referenced by ~LinkInterface().


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