From a3204ae6be65734fe90711f734716d5b4419114c Mon Sep 17 00:00:00 2001 From: penfold42 Date: Wed, 23 Mar 2016 21:28:31 +1100 Subject: [PATCH] LedDeviceFile now defaults to /dev/null if the output is omitted. Former-commit-id: eff12ec16d08ffa00287ed68238ab6b397f1c53d --- libsrc/leddevice/LedDeviceFactory.cpp | 2 +- libsrc/leddevice/LedDeviceFile.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/leddevice/LedDeviceFactory.cpp b/libsrc/leddevice/LedDeviceFactory.cpp index 37f22511..7e52748c 100755 --- a/libsrc/leddevice/LedDeviceFactory.cpp +++ b/libsrc/leddevice/LedDeviceFactory.cpp @@ -277,7 +277,7 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig) } else if (type == "file") { - const std::string output = deviceConfig["output"].asString(); + const std::string output = deviceConfig.get("output", "/dev/null").asString(); device = new LedDeviceFile(output); } else if (type == "fadecandy") diff --git a/libsrc/leddevice/LedDeviceFile.cpp b/libsrc/leddevice/LedDeviceFile.cpp index 87085f39..e6da1fc0 100644 --- a/libsrc/leddevice/LedDeviceFile.cpp +++ b/libsrc/leddevice/LedDeviceFile.cpp @@ -3,7 +3,7 @@ #include "LedDeviceFile.h" LedDeviceFile::LedDeviceFile(const std::string& output) : - _ofs(output.empty()?"/home/pi/LedDevice.out":output.c_str()) + _ofs(output.empty()?"/dev/null":output.c_str()) { // empty }