hyperion.ng
ProviderUdp.h
1 #pragma once
2 
3 // Hyperion includes
4 #include <leddevice/LedDevice.h>
5 #include <utils/Logger.h>
6 
7 // qt
8 #include <QHostAddress>
9 
10 class QUdpSocket;
11 
15 class ProviderUdp : public LedDevice
16 {
17 public:
21  ProviderUdp();
22 
26  virtual ~ProviderUdp();
27 
33  virtual bool init(const QJsonObject &deviceConfig);
34 
40  int open();
41 
42 protected:
52  int writeBytes(const unsigned size, const uint8_t *data);
53 
55  QUdpSocket * _udpSocket;
56  QHostAddress _address;
57  quint16 _port;
58  QString _defaultHost;
59 };
int writeBytes(const unsigned size, const uint8_t *data)
Writes the given bytes/bits to the UDP-device and sleeps the latch time to ensure that the values are...
Definition: ProviderUdp.cpp:76
The ProviderUdp implements an abstract base-class for LedDevices using UDP packets.
Definition: ProviderUdp.h:15
Interface (pure virtual base class) for LedDevices.
Definition: LedDevice.h:32
virtual bool init(const QJsonObject &deviceConfig)
Sets configuration.
Definition: ProviderUdp.cpp:32
int open()
Opens and configures the output device.
Definition: ProviderUdp.cpp:66
ProviderUdp()
Constructs specific LedDevice.
Definition: ProviderUdp.cpp:18
virtual ~ProviderUdp()
Destructor of the LedDevice; closes the output device if it is open.
Definition: ProviderUdp.cpp:27