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

@@ -16,16 +16,14 @@
#include "LedDeviceTpm2net.h"
LedDeviceTpm2net::LedDeviceTpm2net(const Json::Value &deviceConfig)
: ProviderUdp(deviceConfig)
: ProviderUdp()
{
setConfig(deviceConfig);
}
bool LedDeviceTpm2net::setConfig(const Json::Value &deviceConfig)
{
ProviderUdp::setConfig(deviceConfig);
_LatchTime_ns = deviceConfig.get("latchtime",104000).asInt();
ProviderUdp::setConfig(deviceConfig,50200,104000);
_tpm2_max = deviceConfig.get("max-packet",170).asInt();
return true;
}
@@ -80,8 +78,3 @@ int LedDeviceTpm2net::write(const std::vector<ColorRgb> &ledValues)
return retVal;
}
int LedDeviceTpm2net::switchOff()
{
return write(std::vector<ColorRgb>(_ledCount, ColorRgb{0,0,0}));
}