24 #include "MGrblGpio.hpp"
26 #include <ccut/async.hpp>
28 #include "MGrblPlatform.hpp"
30 using namespace logger;
32 using namespace smc::internal;
33 using namespace smc::units;
35 MGrblGpio::MGrblGpio(
const std::string &uid,
36 const std::shared_ptr<MGrblPlatform> &mgrbl,
37 const std::shared_ptr<GrblPlatform> &grbl) :
42 std::future<void> MGrblGpio::setIoState(
const io_port_t &state)
const
46 std::shared_ptr<MGrblPlatform> mgrbl(m_mgrbl.lock());
48 throw Exception(ErrorCode::Canceled,
"platform stopped (deleted)");
50 mgrbl->updateInstance(
const_cast<MGrblGpio &
>(*
this));
55 return ccut::make_future_error(ex);
63 std::shared_ptr<MGrblPlatform> mgrbl(m_mgrbl.lock());
65 throw Exception(ErrorCode::Canceled,
"platform stopped (deleted)");
67 mgrbl->updateInstance(
const_cast<MGrblGpio &
>(*
this));
72 return ccut::make_future_error<io_port_t>(ex);
Exception thrown by MotionController in case of issues with command.
virtual std::future< units::io_port_t > getIoState() const override
Get current state of this GPIO.
virtual std::future< void > setIoState(const units::io_port_t &state) const override
Set state of this IO.
virtual std::future< units::io_port_t > getIoState() const override
Get current state of this GPIO.
main motion-lib namespace