2023-11-07 16:53:06 +08:00

32 lines
549 B
C++

#ifndef UDPSENDER_H
#define UDPSENDER_H
#include <QObject>
#include <QUdpSocket>
#include <QtNetwork>
#include"DeviceConfig.h"
#include<QDebug>
#include<QEventLoop>
class udpSender : public QObject
{
Q_OBJECT
public:
explicit udpSender(QObject *parent = nullptr);
void GetLocalIP();
int SendUDP(QString);
private:
QUdpSocket * UdpSocket;
QString ServerIP="192.168.137.255";
quint16 port_receive=1200;
quint16 port_send=3600;
signals:
private slots:
void readPendingDatagrams();
};
#endif // UDPSENDER_H