|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <TransportStrategy.h>
Inheritance diagram for TransportStrategy:
Collaboration diagram for TransportStrategy:Public Types | |
| enum class | Protocol { UDP , TCP , AutoFallback } |
Signals | |
| void | connected () |
| void | disconnected () |
| void | errorOccurred (const QString &message) |
Public Member Functions | |
| TransportStrategy (QObject *parent=nullptr) | |
| ~TransportStrategy () override | |
| Protocol | protocol () const |
| QString | host () const |
| quint16 | port () const |
| bool | tlsEnabled () const |
| bool | tlsVerifyPeer () const |
| void | setProtocol (Protocol protocol) |
| void | setTarget (const QString &host, quint16 port) |
| void | setTlsEnabled (bool enabled) |
| void | setTlsVerifyPeer (bool verify) |
| void | setTlsCaCertificates (const QList< QSslCertificate > &certs) |
| void | setTlsClientCertificate (const QSslCertificate &cert, const QSslKey &key) |
| quint64 | send (const QByteArray &data) |
| Send pre-formatted payload. Returns bytes sent (0 on failure/pending). | |
| bool | isConnected () const |
| Whether the active transport is connected and ready. | |
| bool | tcpConnected () const |
| void | reset () |
| Reset transports (e.g. after host/port change). | |
Encapsulates UDP/TCP/AutoFallback protocol selection, lazy transport creation, TLS configuration, and TCP reconnection with exponential backoff.
Definition at line 13 of file TransportStrategy.h.
|
strong |
| Enumerator | |
|---|---|
| UDP | |
| TCP | |
| AutoFallback | |
Definition at line 18 of file TransportStrategy.h.
|
explicit |
Definition at line 8 of file TransportStrategy.cc.
|
override |
Definition at line 12 of file TransportStrategy.cc.
References UdpTransport::close(), and TcpTransport::close().
|
signal |
Referenced by Q_LOGGING_CATEGORY().
|
signal |
Referenced by Q_LOGGING_CATEGORY().
|
signal |
Referenced by Q_LOGGING_CATEGORY().
|
inline |
Definition at line 30 of file TransportStrategy.h.
Referenced by setTarget().
| bool TransportStrategy::isConnected | ( | ) | const |
Whether the active transport is connected and ready.
Definition at line 184 of file TransportStrategy.cc.
References TcpTransport::isConnected().
|
inline |
Definition at line 31 of file TransportStrategy.h.
Referenced by setTarget().
|
inline |
Definition at line 29 of file TransportStrategy.h.
Referenced by setProtocol().
| void TransportStrategy::reset | ( | ) |
Reset transports (e.g. after host/port change).
Definition at line 47 of file TransportStrategy.cc.
References UdpTransport::close(), and TcpTransport::close().
Referenced by setTarget().
| quint64 TransportStrategy::send | ( | const QByteArray & | data | ) |
Send pre-formatted payload. Returns bytes sent (0 on failure/pending).
Definition at line 155 of file TransportStrategy.cc.
References TcpTransport::connectToHost(), TcpTransport::isConnected(), UdpTransport::send(), and TcpTransport::send().
| void TransportStrategy::setProtocol | ( | Protocol | protocol | ) |
Definition at line 22 of file TransportStrategy.cc.
References TcpTransport::close(), protocol(), and UdpTransport::resetFailureCount().
| void TransportStrategy::setTarget | ( | const QString & | host, |
| quint16 | port | ||
| ) |
Definition at line 37 of file TransportStrategy.cc.
| void TransportStrategy::setTlsCaCertificates | ( | const QList< QSslCertificate > & | certs | ) |
Definition at line 83 of file TransportStrategy.cc.
References TcpTransport::setTlsCaCertificates().
| void TransportStrategy::setTlsClientCertificate | ( | const QSslCertificate & | cert, |
| const QSslKey & | key | ||
| ) |
Definition at line 91 of file TransportStrategy.cc.
References TcpTransport::setTlsClientCertificate().
| void TransportStrategy::setTlsEnabled | ( | bool | enabled | ) |
Definition at line 65 of file TransportStrategy.cc.
References TcpTransport::close().
| void TransportStrategy::setTlsVerifyPeer | ( | bool | verify | ) |
Definition at line 74 of file TransportStrategy.cc.
References TcpTransport::close().
| bool TransportStrategy::tcpConnected | ( | ) | const |
Definition at line 192 of file TransportStrategy.cc.
References TcpTransport::isConnected().
|
inline |
Definition at line 32 of file TransportStrategy.h.
|
inline |
Definition at line 33 of file TransportStrategy.h.