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
7
Q_DECLARE_LOGGING_CATEGORY(UdpForwarderLog)
8
9
class
QUdpSocket;
10
11
class
UdpForwarder
:
public
QObject
12
{
13
Q_OBJECT
14
15
public
:
16
explicit
UdpForwarder
(QObject* parent =
nullptr
);
17
~UdpForwarder
()
override
;
18
19
bool
configure
(
const
QString&
address
, quint16
port
);
20
void
forward
(
const
QByteArray& data);
21
void
stop
();
22
23
bool
isEnabled
()
const
{
return
_enabled; }
24
25
QString
address
()
const
{
return
_address.toString(); }
26
27
quint16
port
()
const
{
return
_port; }
28
29
private
:
30
QUdpSocket* _socket =
nullptr
;
31
QHostAddress _address;
32
quint16 _port = 0;
33
bool
_enabled =
false
;
34
};
UdpForwarder
Definition
UdpForwarder.h:12
UdpForwarder::~UdpForwarder
~UdpForwarder() override
Definition
UdpForwarder.cc:11
UdpForwarder::isEnabled
bool isEnabled() const
Definition
UdpForwarder.h:23
UdpForwarder::stop
void stop()
Definition
UdpForwarder.cc:49
UdpForwarder::address
QString address() const
Definition
UdpForwarder.h:25
UdpForwarder::configure
bool configure(const QString &address, quint16 port)
Definition
UdpForwarder.cc:16
UdpForwarder::port
quint16 port() const
Definition
UdpForwarder.h:27
UdpForwarder::forward
void forward(const QByteArray &data)
Definition
UdpForwarder.cc:35
src
Utilities
Network
UdpForwarder.h
Generated by
1.9.8