6#include <QtCore/QByteArray>
7#include <QtCore/QLoggingCategory>
8#include <QtCore/QString>
9#include <QtNetwork/QAbstractSocket>
24 Q_PROPERTY(QString host READ host WRITE setHost NOTIFY hostChanged)
25 Q_PROPERTY(quint16 port READ port WRITE setPort NOTIFY portChanged)
32 LinkType type()
const override {
return LinkConfiguration::TypeTcp; }
34 void loadSettings(QSettings &settings,
const QString &root)
override;
35 void saveSettings(QSettings &settings,
const QString &root)
const override;
36 QString settingsURL()
const override {
return QStringLiteral(
"TcpSettings.qml"); }
37 QString settingsTitle()
const override {
return tr(
"TCP Link Settings"); }
39 QString host()
const {
return _host; }
40 void setHost(
const QString &host);
41 quint16 port()
const {
return _port; }
42 void setPort(quint16 port);
79 void _onSocketConnected();
80 void _onSocketDisconnected();
81 void _onSocketReadyRead();
82 void _onSocketBytesWritten(qint64 bytes);
83 void _onSocketErrorOccurred(QAbstractSocket::SocketError socketError);
87 QTcpSocket *_socket =
nullptr;
88 std::atomic<bool> _errorEmitted{
false};
106 void _writeBytes(
const QByteArray &bytes)
override;
108 void _onDisconnected();
110 void _onDataReceived(
const QByteArray &data);
111 void _onDataSent(
const QByteArray &data);
114 bool _connect()
override;
118 QThread *_workerThread =
nullptr;
119 std::atomic<bool> _disconnectedEmitted{
false};
Q_DECLARE_LOGGING_CATEGORY(AndroidSerialLog)
std::shared_ptr< LinkConfiguration > SharedLinkConfigurationPtr
Interface holding link specific settings.
The link interface defines the interface for all links used to communicate with the ground station ap...
bool isConnected() const override
void disconnect() override
bool isSecureConnection() const override
Returns true if the connection is secure (e.g. USB, wired ethernet)
void disconnectFromHost()
void errorOccurred(const QString &errorString)
void dataReceived(const QByteArray &data)
void dataSent(const QByteArray &data)
void writeData(const QByteArray &data)