/** * $Id$ * $HeadURL$ * $Author$ */ #pragma once #include #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