add ability for default values in providerudp (#251)

* add ability for default values in providerudp

* udp: move switchOff into baseclass

* udp: more code cleanups
This commit is contained in:
redPanther
2016-09-22 09:19:31 +02:00
committed by GitHub
parent f88cd3a230
commit b8f1ad50b9
12 changed files with 66 additions and 66 deletions

View File

@@ -12,17 +12,9 @@
#include "LedDeviceUdpRaw.h"
LedDeviceUdpRaw::LedDeviceUdpRaw(const Json::Value &deviceConfig)
: ProviderUdp(deviceConfig)
: ProviderUdp()
{
setConfig(deviceConfig);
}
bool LedDeviceUdpRaw::setConfig(const Json::Value &deviceConfig)
{
ProviderUdp::setConfig(deviceConfig);
_LatchTime_ns = deviceConfig.get("latchtime",500000).asInt();
return true;
ProviderUdp::setConfig(deviceConfig, 500000, 5568);
}
LedDevice* LedDeviceUdpRaw::construct(const Json::Value &deviceConfig)
@@ -39,8 +31,3 @@ int LedDeviceUdpRaw::write(const std::vector<ColorRgb> &ledValues)
return writeBytes(dataLen, dataPtr);
}
int LedDeviceUdpRaw::switchOff()
{
return write(std::vector<ColorRgb>(_ledCount, ColorRgb{0,0,0}));
}