24 #include "EdgeGrblDevice.hpp"
29 #include <ccut/Regex.hpp>
30 #include <logger/Logger.hpp>
32 #include "Exception.hpp"
34 using namespace logger;
35 using namespace std::chrono;
37 static const ccut::Regex s_grblInit(
"^GrblHAL.*$");
41 EdgeGrblDevice::EdgeGrblDevice(
int lun,
const std::string &driverPath)
43 setenv(
"GRBL_SIM_INSTANCES",
"0", 1);
44 init(lun, driverPath);
47 [](
const std::string &msg) {
48 notice(loggerCat) <<
"<--(init) " << msg;
49 if (s_grblInit.search(msg))
50 throw grbl::ErrorCode{0};
53 milliseconds{5000}) != grbl::ErrorCode{0})
55 error(loggerCat) <<
"Grbl welcome banner not found";
57 std::string{
"Failed to get Grbl banner"}};
Exception thrown by MotionController in case of issues with command.