QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
UdpForwarder.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
#include <QtNetwork/QUdpSocket>
7
8
Q_DECLARE_LOGGING_CATEGORY(UdpForwarderLog)
9
10
class
UdpForwarder
: public QObject
11
{
12
Q_OBJECT
13
14
public
:
15
explicit
UdpForwarder
(QObject* parent =
nullptr
);
16
17
bool
configure(
const
QString& address, quint16 port);
18
qint64 forward(
const
QByteArray& data);
19
void
stop();
20
21
bool
isEnabled
()
const
{
return
_port != 0; }
22
23
QString
address
()
const
{
return
_address.toString(); }
24
25
quint16
port
()
const
{
return
_port; }
26
27
private
:
28
QUdpSocket _socket{
this
};
29
QHostAddress _address;
30
quint16 _port = 0;
31
};
UdpForwarder
Definition
UdpForwarder.h:11
UdpForwarder::isEnabled
bool isEnabled() const
Definition
UdpForwarder.h:21
UdpForwarder::address
QString address() const
Definition
UdpForwarder.h:23
UdpForwarder::port
quint16 port() const
Definition
UdpForwarder.h:25
src
Utilities
Network
IO
UdpForwarder.h
Generated by
1.9.8