LED-BOARD/simulation/VirtualLedBoard/udpserver.h

30 lines
592 B
C
Raw Normal View History

2023-08-13 22:38:07 +02:00
#ifndef UDPSERVER_H
#define UDPSERVER_H
#include <QAbstractItemModel>
#include <QUdpSocket>
2023-08-17 21:51:03 +02:00
#include "mainwindow.h"
class MainWindow;
2023-08-13 22:38:07 +02:00
2023-08-14 13:53:34 +02:00
class UdpLedServer : public QObject
2023-08-13 22:38:07 +02:00
{
Q_OBJECT
public:
2023-08-17 21:51:03 +02:00
/*UdpLedServer (QObject *parent = nullptr); */
UdpLedServer (QObject *parent = nullptr, MainWindow *window = nullptr);
2023-08-13 22:38:07 +02:00
private:
void initSocket();
void readPendingDatagrams();
QUdpSocket *mUdpSocket;
void processTheDatagram(QNetworkDatagram datagram);
signals:
void changeLEDstate(uint8_t x, uint8_t y);
void updatePanelContent(void);
2023-08-13 22:38:07 +02:00
};
#endif // UDPSERVER_H