QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
MAVLinkProtocol Class Reference

#include <MAVLinkProtocol.h>

+ Inheritance diagram for MAVLinkProtocol:
+ Collaboration diagram for MAVLinkProtocol:

Public Slots

void receiveBytes (LinkInterface *link, const QByteArray &data)
 
void logSentBytes (const LinkInterface *link, const QByteArray &data)
 
static void deleteTempLogFiles ()
 Deletes any log files which are in the temp directory.
 

Signals

void vehicleHeartbeatInfo (LinkInterface *link, int vehicleId, int componentId, int vehicleFirmwareType, int vehicleType)
 Heartbeat received on link.
 
void messageReceived (LinkInterface *link, const mavlink_message_t &message)
 Message received and directly copied via signal.
 
void mavlinkMessageStatus (int sysid, uint64_t totalSent, uint64_t totalReceived, uint64_t totalLoss, float lossPercent)
 

Public Member Functions

 MAVLinkProtocol (QObject *parent=nullptr)
 
 ~MAVLinkProtocol ()
 Destructor for the MAVLinkProtocol class.
 
void init ()
 
int getSystemId () const
 Get the system id of this application.
 
void resetMetadataForLink (LinkInterface *link)
 Reset the counters for all metadata for this link.
 
void suspendLogForReplay (bool suspend)
 Suspend/Restart logging during replay.
 
void checkForLostLogFiles ()
 

Static Public Member Functions

static MAVLinkProtocolinstance ()
 
static QString getName ()
 Get the human-friendly name of this protocol.
 
static int getComponentId ()
 Get the component id of this application.
 

Detailed Description

MAVLink micro air vehicle protocol reference implementation. MAVLink is a generic communication protocol for micro air vehicles. for more information, please see the official website: https://mavlink.io

Definition at line 18 of file MAVLinkProtocol.h.

Constructor & Destructor Documentation

◆ MAVLinkProtocol()

MAVLinkProtocol::MAVLinkProtocol ( QObject *  parent = nullptr)
explicit

Constructs an MAVLinkProtocol object.

Parameters
parentThe parent QObject.

Definition at line 25 of file MAVLinkProtocol.cc.

◆ ~MAVLinkProtocol()

MAVLinkProtocol::~MAVLinkProtocol ( )

Destructor for the MAVLinkProtocol class.

Definition at line 32 of file MAVLinkProtocol.cc.

Member Function Documentation

◆ checkForLostLogFiles()

void MAVLinkProtocol::checkForLostLogFiles ( )

Checks the temp directory for log files which may have been left there. This could happen if QGC crashes without the temp log file being saved. Give the user an option to save these orphaned files.

Definition at line 347 of file MAVLinkProtocol.cc.

◆ deleteTempLogFiles

void MAVLinkProtocol::deleteTempLogFiles ( )
staticslot

Deletes any log files which are in the temp directory.

Definition at line 366 of file MAVLinkProtocol.cc.

◆ getComponentId()

◆ getName()

static QString MAVLinkProtocol::getName ( )
inlinestatic

Get the human-friendly name of this protocol.

Definition at line 37 of file MAVLinkProtocol.h.

Referenced by logSentBytes().

◆ getSystemId()

int MAVLinkProtocol::getSystemId ( ) const

◆ init()

void MAVLinkProtocol::init ( )

Definition at line 44 of file MAVLinkProtocol.cc.

References MultiVehicleManager::vehicleRemoved().

◆ instance()

◆ logSentBytes

void MAVLinkProtocol::logSentBytes ( const LinkInterface link,
const QByteArray &  data 
)
slot

Log bytes sent from a communication interface and logs a MAVLink packet. It can handle multiple links in parallel, as each link has it's own buffer/parsing state machine.

Parameters
linkThe interface to read from

Definition at line 65 of file MAVLinkProtocol.cc.

References getName(), and qgcApp.

◆ mavlinkMessageStatus

void MAVLinkProtocol::mavlinkMessageStatus ( int  sysid,
uint64_t  totalSent,
uint64_t  totalReceived,
uint64_t  totalLoss,
float  lossPercent 
)
signal

Referenced by Vehicle::Vehicle().

◆ messageReceived

void MAVLinkProtocol::messageReceived ( LinkInterface link,
const mavlink_message_t message 
)
signal

Message received and directly copied via signal.

Referenced by MAVLinkInspectorController::MAVLinkInspectorController(), and Vehicle::Vehicle().

◆ receiveBytes

void MAVLinkProtocol::receiveBytes ( LinkInterface link,
const QByteArray &  data 
)
slot

Receive bytes from a communication interface and constructs a MAVLink packet

Parameters
linkThe interface to read from

Definition at line 88 of file MAVLinkProtocol.cc.

References LinkInterface::mavlinkChannel(), and LinkInterface::reportMavlinkV1Traffic().

◆ resetMetadataForLink()

void MAVLinkProtocol::resetMetadataForLink ( LinkInterface link)

Reset the counters for all metadata for this link.

Definition at line 55 of file MAVLinkProtocol.cc.

References LinkInterface::mavlinkChannel(), and LinkInterface::setDecodedFirstMavlinkPacket().

◆ suspendLogForReplay()

void MAVLinkProtocol::suspendLogForReplay ( bool  suspend)
inline

Suspend/Restart logging during replay.

Definition at line 49 of file MAVLinkProtocol.h.

Referenced by LogReplayWorker::pause(), and LogReplayWorker::play().

◆ vehicleHeartbeatInfo

void MAVLinkProtocol::vehicleHeartbeatInfo ( LinkInterface link,
int  vehicleId,
int  componentId,
int  vehicleFirmwareType,
int  vehicleType 
)
signal

Heartbeat received on link.


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