mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Leddevice refactoring the next part (#253)
* add general switchOff * refactoring of leddevices regarding ledcount and switchoff * remove obsolete includes
This commit is contained in:
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user