QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
RTCMUdpInput.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QLoggingCategory>
4#include <QtCore/QObject>
5#include <QtNetwork/QHostAddress>
6
7#include "RTCMParser.h"
8
9Q_DECLARE_LOGGING_CATEGORY(RTCMUdpInputLog)
10
11class QUdpSocket;
12
31class RTCMUdpInput : public QObject
32{
33 Q_OBJECT
34 Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged)
35 Q_PROPERTY(quint16 port READ port NOTIFY portChanged)
36
37public:
38 explicit RTCMUdpInput(quint16 port, QObject* parent = nullptr);
39 ~RTCMUdpInput() override;
40
44 bool start();
45
47 void stop();
48
49 bool isRunning() const { return _running; }
50
51 quint16 port() const { return _port; }
52
54 void setPort(quint16 port);
55
58 void setValidation(const bool validate) { _validateRtcm = validate; }
59
60signals:
64 void rtcmDataReceived(const QByteArray& data);
65
68
69private slots:
70 void _readDatagrams();
71
72private:
73 QUdpSocket* _socket = nullptr;
74 quint16 _port;
75 bool _running = false;
76 bool _validateRtcm = false;
77 RTCMParser _rtcmParser;
78 quint64 _validFrames = 0;
79 quint64 _invalidFrames = 0;
80};
Listens on a UDP port for raw RTCM3 correction data and emits it for forwarding to connected vehicles...
void stop()
Unbind the socket and stop accepting datagrams.
void runningChanged()
void rtcmDataReceived(const QByteArray &data)
~RTCMUdpInput() override
bool isRunning() const
void setPort(quint16 port)
Change the listen port. If already running, restarts automatically.
void portChanged()
quint16 port() const
void setValidation(const bool validate)