2016-05-30 23:58:31 +02:00
|
|
|
#include "LedDeviceUdpRaw.h"
|
|
|
|
|
2016-08-23 20:07:12 +02:00
|
|
|
LedDeviceUdpRaw::LedDeviceUdpRaw(const Json::Value &deviceConfig)
|
2016-09-22 09:19:31 +02:00
|
|
|
: ProviderUdp()
|
2016-05-30 23:58:31 +02:00
|
|
|
{
|
2016-10-08 08:14:36 +02:00
|
|
|
_LatchTime_ns = 500000;
|
|
|
|
_port = 5568;
|
|
|
|
init(deviceConfig);
|
2016-08-23 20:07:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
LedDevice* LedDeviceUdpRaw::construct(const Json::Value &deviceConfig)
|
|
|
|
{
|
|
|
|
return new LedDeviceUdpRaw(deviceConfig);
|
2016-05-30 23:58:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
int LedDeviceUdpRaw::write(const std::vector<ColorRgb> &ledValues)
|
|
|
|
{
|
|
|
|
const uint8_t * dataPtr = reinterpret_cast<const uint8_t *>(ledValues.data());
|
|
|
|
|
2016-10-08 08:14:36 +02:00
|
|
|
return writeBytes((unsigned)_ledRGBCount, dataPtr);
|
2016-05-30 23:58:31 +02:00
|
|
|
}
|