#pragma once #include "fgc/IMotorController.h" #include #include namespace fgc { // Parse a firmware `ST` status line: // // ST Y:,,,,,,, [P:...] // // where is B/R/H/A/E and is an optional run of status letters // (S=standstill, s=stall, o/O=overtemp, L/R=endstops, e=eeprom). Returns nullopt // for any line that is not a well-formed `ST` line (acks and other async output // like OK/ERR/DG/DUMP are handled by the caller). A missing/garbled axis segment // yields nullopt rather than partial data. std::optional parseTelemetryLine(const std::string& line); // Parse a single "Y:..." / "P:..." axis segment. Exposed for unit testing. std::optional parseAxisSegment(const std::string& seg); } // namespace fgc