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

Listens on a UDP port for raw RTCM3 correction data and emits it for forwarding to connected vehicles via RTCMMavlink::RTCMDataUpdate(). More...

#include <RTCMUdpInput.h>

+ Inheritance diagram for RTCMUdpInput:
+ Collaboration diagram for RTCMUdpInput:

Signals

void rtcmDataReceived (const QByteArray &data)
 
void runningChanged ()
 
void portChanged ()
 

Public Member Functions

 RTCMUdpInput (quint16 port, QObject *parent=nullptr)
 
 ~RTCMUdpInput () override
 
bool start ()
 
void stop ()
 Unbind the socket and stop accepting datagrams.
 
bool isRunning () const
 
quint16 port () const
 
void setPort (quint16 port)
 Change the listen port. If already running, restarts automatically.
 
void setValidation (const bool validate)
 

Detailed Description

Listens on a UDP port for raw RTCM3 correction data and emits it for forwarding to connected vehicles via RTCMMavlink::RTCMDataUpdate().

Typical wiring:

auto *udpInput = new RTCMUdpInput(13320, this);
connect(udpInput, &RTCMUdpInput::rtcmDataReceived,
_rtcmMavlink, &RTCMMavlink::RTCMDataUpdate);
udpInput->start();
Listens on a UDP port for raw RTCM3 correction data and emits it for forwarding to connected vehicles...
void rtcmDataReceived(const QByteArray &data)

The class accepts datagrams from any sender on the bound port. With validation disabled each datagram is emitted as-is; with validation enabled (see setValidation) datagrams are reframed through RTCMParser and only CRC-valid RTCM3 frames are forwarded. Downstream (RTCMMavlink) fragments as needed.

Definition at line 30 of file RTCMUdpInput.h.

Constructor & Destructor Documentation

◆ RTCMUdpInput()

RTCMUdpInput::RTCMUdpInput ( quint16  port,
QObject *  parent = nullptr 
)
explicit

Definition at line 10 of file RTCMUdpInput.cc.

◆ ~RTCMUdpInput()

RTCMUdpInput::~RTCMUdpInput ( )
override

Definition at line 12 of file RTCMUdpInput.cc.

References stop().

Member Function Documentation

◆ isRunning()

bool RTCMUdpInput::isRunning ( ) const
inline

Definition at line 47 of file RTCMUdpInput.h.

◆ port()

quint16 RTCMUdpInput::port ( ) const
inline

Definition at line 49 of file RTCMUdpInput.h.

Referenced by setPort().

◆ portChanged

void RTCMUdpInput::portChanged ( )
signal

Referenced by setPort().

◆ rtcmDataReceived

void RTCMUdpInput::rtcmDataReceived ( const QByteArray &  data)
signal

Emitted once per received datagram with the raw RTCM payload. Connect directly to RTCMMavlink::RTCMDataUpdate (same thread).

◆ runningChanged

void RTCMUdpInput::runningChanged ( )
signal

Referenced by start(), and stop().

◆ setPort()

void RTCMUdpInput::setPort ( quint16  port)

Change the listen port. If already running, restarts automatically.

Definition at line 53 of file RTCMUdpInput.cc.

References port(), portChanged(), and start().

◆ setValidation()

void RTCMUdpInput::setValidation ( const bool  validate)
inline

Enable/disable validation of RTCM data. With this enabled, only valid RTCM packets are converted to MAVLink.

Definition at line 56 of file RTCMUdpInput.h.

◆ start()

bool RTCMUdpInput::start ( )

Bind the socket and begin accepting datagrams. Safe to call on an already-running instance — restarts with the current port.

Definition at line 17 of file RTCMUdpInput.cc.

References RTCMParser::reset(), runningChanged(), and stop().

Referenced by setPort().

◆ stop()

void RTCMUdpInput::stop ( )

Unbind the socket and stop accepting datagrams.

Definition at line 37 of file RTCMUdpInput.cc.

References runningChanged().

Referenced by start(), and ~RTCMUdpInput().


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