Tomáš Pecka | 139e361 | 2021-01-25 19:49:00 +0100 | [diff] [blame] | 1 | #include "Factory.h" |
| 2 | #include "health/outputs/LedSysfsDriver.h" |
| 3 | #include "health/outputs/SlotWrapper.h" |
| 4 | #include "health/outputs/callables.h" |
| 5 | |
| 6 | namespace velia::health { |
| 7 | boost::signals2::SlotWrapper<void, health::State> createOutput(const std::string& applianceName) |
| 8 | { |
| 9 | if (applianceName == "czechlight-clearfog") { |
| 10 | return boost::signals2::SlotWrapper<void, State>(std::make_shared<LedOutputCallback>( |
| 11 | std::make_shared<LedSysfsDriver>("/sys/class/leds/status:red/"), |
| 12 | std::make_shared<LedSysfsDriver>("/sys/class/leds/status:green/"), |
| 13 | std::make_shared<LedSysfsDriver>("/sys/class/leds/status:blue/"))); |
| 14 | } else { |
| 15 | throw std::runtime_error("Unknown appliance '" + applianceName + "'"); |
| 16 | } |
| 17 | } |
| 18 | } |