The ProviderUdp implements an abstract base-class for LedDevices using UDP packets.
More...
#include <ProviderUdp.h>
|
| ProviderUdp () |
| Constructs specific LedDevice.
|
|
virtual | ~ProviderUdp () |
| Destructor of the LedDevice; closes the output device if it is open.
|
|
virtual bool | init (const QJsonObject &deviceConfig) |
| Sets configuration. More...
|
|
int | open () |
| Opens and configures the output device. More...
|
|
| LedDevice (const QJsonObject &config=QJsonObject(), QObject *parent=nullptr) |
|
virtual int | switchOff () |
| Switch the leds off (led hardware disable)
|
|
virtual int | switchOn () |
| Switch the leds on (led hardware enable), used if reinitialization is required for the device implementation.
|
|
virtual int | setLedValues (const std::vector< ColorRgb > &ledValues) |
|
const QString & | getColorOrder () |
| Get color order of device. More...
|
|
void | setActiveDevice (QString dev) |
|
const QString & | getActiveDevice () |
|
void | setLedCount (int ledCount) |
|
int | getLedCount () |
|
void | setEnable (bool enable) |
|
bool | enabled () |
|
int | getLatchTime () |
|
bool | componentState () |
|
virtual int | write (const std::vector< ColorRgb > &ledValues)=0 |
| Writes the RGB-Color values to the leds. More...
|
|
|
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 latched. More...
|
|
|
QUdpSocket * | _udpSocket |
|
QHostAddress | _address |
|
quint16 | _port |
|
QString | _defaultHost |
|
QJsonObject | _devConfig |
|
Logger * | _log |
| The common Logger instance for all LedDevices.
|
|
std::vector< uint8_t > | _ledBuffer |
| The buffer containing the packed RGB values.
|
|
bool | _deviceReady |
|
QString | _activeDevice |
|
int | _ledCount |
|
int | _ledRGBCount |
|
int | _ledRGBWCount |
|
QTimer | _refresh_timer |
| Timer object which makes sure that led data is written at a minimum rate e.g. More...
|
|
unsigned int | _refresh_timer_interval |
|
qint64 | _last_write_time |
|
unsigned int | _latchTime_ms |
|
The ProviderUdp implements an abstract base-class for LedDevices using UDP packets.
§ init()
bool ProviderUdp::init |
( |
const QJsonObject & |
deviceConfig | ) |
|
|
virtual |
§ open()
int ProviderUdp::open |
( |
| ) |
|
|
virtual |
Opens and configures the output device.
- Returns
- Zero on succes else negative
Reimplemented from LedDevice.
§ writeBytes()
int ProviderUdp::writeBytes |
( |
const unsigned |
size, |
|
|
const uint8_t * |
data |
|
) |
| |
|
protected |
Writes the given bytes/bits to the UDP-device and sleeps the latch time to ensure that the values are latched.
- Parameters
-
[in] | size | The length of the data |
[in] | data | The data |
- Returns
- Zero on succes else negative
The documentation for this class was generated from the following files:
- libsrc/leddevice/dev_net/ProviderUdp.h
- libsrc/leddevice/dev_net/ProviderUdp.cpp