mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
* add general switchOff * refactoring of leddevices regarding ledcount and switchoff * remove obsolete includes
21 lines
523 B
C++
21 lines
523 B
C++
#include "LedDeviceUdpRaw.h"
|
|
|
|
LedDeviceUdpRaw::LedDeviceUdpRaw(const Json::Value &deviceConfig)
|
|
: ProviderUdp()
|
|
{
|
|
setConfig(deviceConfig, 500000, 5568);
|
|
}
|
|
|
|
LedDevice* LedDeviceUdpRaw::construct(const Json::Value &deviceConfig)
|
|
{
|
|
return new LedDeviceUdpRaw(deviceConfig);
|
|
}
|
|
|
|
int LedDeviceUdpRaw::write(const std::vector<ColorRgb> &ledValues)
|
|
{
|
|
const unsigned dataLen = _ledCount * sizeof(ColorRgb);
|
|
const uint8_t * dataPtr = reinterpret_cast<const uint8_t *>(ledValues.data());
|
|
|
|
return writeBytes(dataLen, dataPtr);
|
|
}
|