#pragma once #include "fgc/IMotorController.h" #include #include namespace fgc { // Real motor controller over a serial port (Boost.Asio). Async-reads '$'- // prefixed telemetry lines and parses them into MotorTelemetry; writes command // strings. Wraps the logic of the old Serial.h SerialPort. Implementation // detail (Boost.Asio) is hidden behind a pImpl. class SerialMotorController : public IMotorController { public: SerialMotorController(std::string device, unsigned int baud); ~SerialMotorController() override; void start() override; void stop() override; void sendCommand(const std::string& cmd) override; MotorTelemetry telemetry() override; std::string lastDump() override; bool connected() const override; private: struct Impl; std::unique_ptr impl_; }; } // namespace fgc