#pragma once #include #include struct LED { // the root to the whole LED interface, e.g. "/sys/class/leds/ACT" std::filesystem::path green; std::filesystem::path red; }; class StatusLED { public: enum class Mode { OK, // green OKBeat, // green with heartbeat Error, // red }; StatusLED(); void add(const LED& led); void setMode(Mode mode); void setBPM(int bpm); private: bool init(const LED& led); void update(const LED& led); std::vector m_leds; // on best effort base, those will all show the same status Mode m_mode; int m_bpm; };