qt/LedOK/communication/network.h

42 lines
1.0 KiB
C
Raw Normal View History

2022-01-04 18:11:48 +08:00
#ifndef NETWORK_H
#define NETWORK_H
#include <QObject>
#include <QUdpSocket>
#include <QNetworkInterface>
#include <QList>
#include <wDevicesManager/ledcard.h>
#include <communication/hpptclient.h>
#include <globaldefine.h>
#include <QTimer>
2022-08-25 18:37:24 +08:00
#include <windows.h>
2022-01-04 18:11:48 +08:00
2022-08-25 18:37:24 +08:00
class NetComm : public QObject {
2022-01-04 18:11:48 +08:00
Q_OBJECT
public:
NetComm(QObject *p = nullptr);
STREAM_PACKET LedOkMakeStreamPacket(int iComType,int iLen,unsigned char *ucBuf,QString str);
2022-08-25 18:37:24 +08:00
2022-01-04 18:11:48 +08:00
static DWORD WINAPI send(void *);
2022-08-25 18:37:24 +08:00
void JieXiQJsonObjectOfLedCardInfo(const QJsonObject &subObj,const QString &strIp);
void JieXiQJsonObjectOfLedCardInfoOld(const QString &strId,const QString &strIp);
QList<LedCard *> LedCardList;
QTimer mUdpTimer;
QUdpSocket mUdpSocket;
2022-01-04 18:11:48 +08:00
signals:
void addLedCard(LedCard *);
void ClearHeartbeatFlagByUdp(LedCard *);
2022-08-25 18:37:24 +08:00
public slots:
2022-01-04 18:11:48 +08:00
void RestoreLedCardIpByUdpCmd();
private:
2022-08-25 18:37:24 +08:00
QString m_strCardId;
2022-01-04 18:11:48 +08:00
qint32 m_iWidth;
LedCard *m_pLedCard;
2022-08-25 18:37:24 +08:00
int m_port = 31296;
2022-01-04 18:11:48 +08:00
};
2022-08-25 18:37:24 +08:00
extern NetComm *gUdp;
2022-01-04 18:11:48 +08:00
#endif // NETWORK_H