Added APA102 device to factory

Former-commit-id: ecea592ddf97bdcc2c54d12af194c15d6c09966a
This commit is contained in:
wayland 2014-12-03 09:34:48 +01:00
parent 6859841c3f
commit 205fe8ab66

View File

@ -14,6 +14,7 @@
#include "LedDeviceLpd8806.h" #include "LedDeviceLpd8806.h"
#include "LedDeviceP9813.h" #include "LedDeviceP9813.h"
#include "LedDeviceWs2801.h" #include "LedDeviceWs2801.h"
#include "LedDeviceAPA102.h"
#endif #endif
#ifdef ENABLE_TINKERFORGE #ifdef ENABLE_TINKERFORGE
@ -85,6 +86,15 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
deviceP9813->open(); deviceP9813->open();
device = deviceP9813; device = deviceP9813;
else if (type == "apa102")
{
const std::string output = deviceConfig["output"].asString();
const unsigned rate = deviceConfig["rate"].asInt();
LedDeviceAPA102* deviceAPA102 = new LedDeviceAPA102(output, rate);
deviceAPA102->open();
device = deviceAPA102;
} }
else if (type == "ws2801" || type == "lightberry") else if (type == "ws2801" || type == "lightberry")
{ {