#pragma once #include #include #include #include #include struct lws; namespace dmf_node { using CommandHandler = std::function; using StatusCallback = std::function; class ControlServer { public: ControlServer(uint16_t port, StatusCallback on_event); ~ControlServer(); ControlServer(const ControlServer&) = delete; ControlServer& operator=(const ControlServer&) = delete; void register_command(const std::string& cmd, CommandHandler handler); void send_event(const nlohmann::json& event); void poll(int timeout_ms); private: struct Impl; std::unique_ptr impl_; }; } // namespace dmf_node