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,16 +1,4 @@
// STL includes
#include <cstring>
#include <cstdio>
#include <iostream>
// Linux includes
#include <fcntl.h>
#include <sys/ioctl.h>
// hyperion local includes
#include "LedDeviceAdalight.h"
#include <leddevice/LedDevice.h>
LedDeviceAdalight::LedDeviceAdalight(const Json::Value &deviceConfig)
: ProviderRs232(deviceConfig)
@@ -60,16 +48,6 @@ int LedDeviceAdalight::write(const std::vector<ColorRgb> & ledValues)
return writeBytes(_ledBuffer.size(), _ledBuffer.data());
}
int LedDeviceAdalight::switchOff()
{
// restart the timer
_timer.start();
// write data
memset(6 + _ledBuffer.data(), 0, _ledBuffer.size()-6);
return writeBytes(_ledBuffer.size(), _ledBuffer.data());
}
void LedDeviceAdalight::rewriteLeds()
{
writeBytes(_ledBuffer.size(), _ledBuffer.data());