Files
qt5-legatus-legacy/Lts/Proxies/DifferentialGPS/tetra_if.h
T
2026-08-13 18:33:10 +02:00

54 lines
1.1 KiB
C++
Executable File

/**
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <QtNetwork/QHostAddress>
#include "tcpsocket.h"
class QTcpSocket;
class QTimer;
namespace DifferentialGPS
{
class TetraIF : public TcpSocket
{
Q_OBJECT
public:
using TcpSocket::TcpSocket;
void run() override;
public Q_SLOTS:
void onNewDataAvailable();
void onFeedbackTimeout();
bool checkTetraConnecting();
protected:
virtual void startThreadInternal(int threadIndex);
virtual bool onNewDataAvailableInternal() = 0;
private:
void doConnect();
void doInitialLogin();
void handleReceivedTelegram(uint8_t *a_data, quint16 a_dataSize);
void handleRegisterRsp(const uint8_t a_registrationStatus);
void onAddGroupMonitoring();
private Q_SLOTS:
void onConnected() override;
void onDisconnected() override;
void onReadyRead() override;
void onError(QAbstractSocket::SocketError) override;
protected:
int m_srcIssi = 0;
int m_broadcastIssi = 0;
bool m_bTetraOk = true;
quint8 m_counter = 1;
QTimer *m_feedbackTimeout = nullptr; // timer for feedback timeout
int m_feedbackTimeout_ms = 0; // feedback timeout in ms
};
} // DifferentialGPS