32 lines
584 B
C
32 lines
584 B
C
|
#ifndef IDSERVER_H
|
||
|
#define IDSERVER_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QUdpSocket>
|
||
|
#include <QNetworkDatagram>
|
||
|
#include <QTime>
|
||
|
#include <QNetworkInterface>
|
||
|
|
||
|
#include "stpdefine.h"
|
||
|
#include "stpclient.h"
|
||
|
|
||
|
class idServer : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
explicit idServer(uint16_t sn, QObject *parent = nullptr);
|
||
|
|
||
|
void sendIdRequest();
|
||
|
|
||
|
signals:
|
||
|
void newIdMessage(int modelId, int sn, QHostAddress address);
|
||
|
|
||
|
private:
|
||
|
void _processData(QNetworkDatagram dg);
|
||
|
QUdpSocket * _socket;
|
||
|
QList<QHostAddress> * _addresses;
|
||
|
uint16_t _sn;
|
||
|
};
|
||
|
|
||
|
#endif // IDSERVER_H
|