Leddevice refactoring the next part (#253)

* add general switchOff

* refactoring of leddevices regarding ledcount and switchoff

* remove obsolete includes
This commit is contained in:
redPanther
2016-09-23 08:49:22 +02:00
committed by GitHub
parent 5aeec2e1e5
commit d6a34edfb2
71 changed files with 274 additions and 1073 deletions

View File

@@ -1,18 +1,3 @@
// STL includes
#include <cstring>
#include <cstdio>
#include <iostream>
// Linux includes
#include <fcntl.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <QHostInfo>
#include <QUuid>
// hyperion local includes
#include "LedDeviceTpm2net.h"
LedDeviceTpm2net::LedDeviceTpm2net(const Json::Value &deviceConfig)
@@ -23,8 +8,8 @@ LedDeviceTpm2net::LedDeviceTpm2net(const Json::Value &deviceConfig)
bool LedDeviceTpm2net::setConfig(const Json::Value &deviceConfig)
{
ProviderUdp::setConfig(deviceConfig,50200,104000);
_tpm2_max = deviceConfig.get("max-packet",170).asInt();
ProviderUdp::setConfig(deviceConfig, TPM2_DEFAULT_PORT, 104000);
_tpm2_max = deviceConfig.get("max-packet", 170).asInt();
return true;
}
@@ -43,7 +28,6 @@ int LedDeviceTpm2net::write(const std::vector<ColorRgb> &ledValues)
int retVal = 0;
_ledCount = ledValues.size();
_tpm2ByteCount = 3 * _ledCount;
_tpm2TotalPackets = 1 + _tpm2ByteCount / _tpm2_max;