This commit is contained in:
curtis
2024-11-25 17:15:44 +08:00
commit 32e5360a91
3749 changed files with 1432905 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#ifndef TCPCLIENTEQUIPMENT_H
#define TCPCLIENTEQUIPMENT_H
#include <QObject>
#include <QTcpSocket>
#include <QObject>
#include <QMap>
#include <QHostAddress>
#include <QDebug>
#include <CommomFunc/tool.h>
#include <QByteArray>
#include "XYComFunc_global.h"
class XYCOMFUNC_EXPORT TcpClientEquipment : public QObject
{
Q_OBJECT
public:
explicit TcpClientEquipment(QObject *parent = 0);
Q_INVOKABLE void setInfo(QString strIP,int iPort);
Q_INVOKABLE void connect2Server();
Q_INVOKABLE void connect2Server(QString strIP,int iPort);
Q_INVOKABLE bool getState();
Q_INVOKABLE bool sendMsg(QByteArray buffer);
Q_INVOKABLE bool sendMsg(QString buffer);
void reconnect2Server();
void disconnect2Server();
signals:
void dateReceived(QByteArray buffer);
public slots:
virtual void onDataReceived();
protected:
QTcpSocket *mClient;
QString ip;
int port;
bool flag;
};
#endif // TCPCLIENTEQUIPMENT_H