qtsoundmodem/tcpCode.h

108 lines
2.5 KiB
C
Raw Normal View History

2023-09-04 19:06:44 +01:00
#include <QtCore/QCoreApplication>
#include <QtNetwork>
//#include <QDebug>
#define CONNECT(sndr, sig, rcvr, slt) connect(sndr, SIGNAL(sig), rcvr, SLOT(slt))
2024-10-29 22:45:21 +00:00
//class myTcpSocket : public QTcpSocket
//{
//public:
// char Msg[512]; // Received message
// int Len;
// int BPQPort[4]; // BPQ port for each modem
//};
2023-09-04 19:06:44 +01:00
class mynet : public QObject
{
Q_OBJECT
signals:
void HLSetPTT(int c);
2024-07-23 21:26:30 +01:00
void FLRigSetPTT(int c);
2024-10-29 22:45:21 +00:00
void mgmtSetPTT(int port, int state);
2023-09-04 19:06:44 +01:00
void startTimer(int Time);
void stopTimer();
public:
void start();
void OpenUDP();
public slots:
void onAGWReadyRead();
void onKISSSocketStateChanged(QAbstractSocket::SocketState socketState);
2024-10-29 22:45:21 +00:00
void onMgmtSocketStateChanged(QAbstractSocket::SocketState socketState);
void onMgmtReadyRead();
2023-09-04 19:06:44 +01:00
void onKISSReadyRead();
void onAGWSocketStateChanged(QAbstractSocket::SocketState socketState);
void onKISSConnection();
2024-10-29 22:45:21 +00:00
void onMgmtConnection();
2023-09-04 19:06:44 +01:00
void MyTimerSlot();
void onAGWConnection();
2024-10-29 22:45:21 +00:00
void on6PackConnection();
void on6PackReadyRead();
void on6PackSocketStateChanged(QAbstractSocket::SocketState socketState);
2023-09-04 19:06:44 +01:00
void dropPTT();
void displayError(QAbstractSocket::SocketError socketError);
void sendtoKISS(void * sock, unsigned char * Msg, int Len);
2024-07-23 21:26:30 +01:00
void FLRigdisplayError(QAbstractSocket::SocketError socketError);
void FLRigreadyRead();
void onFLRigSocketStateChanged(QAbstractSocket::SocketState socketState);
void ConnecttoFLRig();
2023-09-04 19:06:44 +01:00
void HAMLIBdisplayError(QAbstractSocket::SocketError socketError);
void HAMLIBreadyRead();
void onHAMLIBSocketStateChanged(QAbstractSocket::SocketState socketState);
void ConnecttoHAMLIB();
void dostartTimer(int Time);
void dostopTimer();
void doHLSetPTT(int c);
2024-10-29 22:45:21 +00:00
void domgmtSetPTT(int chan, int state);
2024-07-23 21:26:30 +01:00
void doFLRigSetPTT(int c);
2023-09-04 19:06:44 +01:00
void readPendingDatagrams();
void socketError();
private:
QTcpServer* tcpServer;
QTcpSocket* tcpClient;
QTcpSocket* tcpServerConnection;
int bytesToWrite;
int bytesWritten;
int bytesReceived;
int TotalBytes;
int PayloadSize;
2024-10-29 22:45:21 +00:00
void MgmtProcessLine(QTcpSocket* socket);
2023-09-04 19:06:44 +01:00
};
class workerThread : public QThread
{
Q_OBJECT
signals:
void updateDCD(int, int);
void sendtoTrace(char *, int);
void sendtoKISS(void *, unsigned char *, int);
void openSockets();
2023-10-07 12:21:48 +01:00
void startCWIDTimer();
2024-07-23 21:26:30 +01:00
void setWaterfallImage();
void setLevelImage();
void setConstellationImage(int, int);
void startWatchdog();
void stopWatchdog();
2023-10-07 12:21:48 +01:00
2023-09-04 19:06:44 +01:00
private:
void run();
public:
};