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
30class RTCMUdpInput : public QObject
31{
32 Q_OBJECT
33 Q_PROPERTY(bool running READ isRunning NOTIFY runningChanged)
34 Q_PROPERTY(quint16 port READ port NOTIFY portChanged)
35
36public:
37 explicit RTCMUdpInput(quint16 port, QObject* parent = nullptr);
38 ~RTCMUdpInput() override;
39
42 bool start();
43
45 void stop();
46
47 bool isRunning() const { return _running; }
48
49 quint16 port() const { return _port; }
50
52 void setPort(quint16 port);
53
56 void setValidation(const bool validate) { _validateRtcm = validate; }
57
58signals:
61 void rtcmDataReceived(const QByteArray& data);
62
65
66private slots:
67 void _readDatagrams();
68
69private:
70 QUdpSocket* _socket = nullptr;
71 quint16 _port;
72 bool _running = false;
73 bool _validateRtcm = false;
74 RTCMParser _rtcmParser;
75 quint64 _validFrames = 0;
76 quint64 _invalidFrames = 0;
77};
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)