MotionLib
1.0.0
SamBuCa motion library
|
Class for implementing Multi-Grbl functionality on top of GrblDeviceBase. More...
#include <MGrblDeviceWrapper.hpp>
Public Member Functions | |
MGrblDeviceWrapper (size_t instance, const std::shared_ptr< grbl::GrblDeviceBase > &device) | |
void | read () override |
fill LineBuffer with incoming bytes | |
void | write (const std::string &data) override |
raw write some bytes More... | |
grbl::ErrorCode | send (const std::string &cmd, std::function< bool(const std::string &)> msg=[](const std::string &) { return false;}, const std::chrono::milliseconds &timeout=defaultSendTimeout) override |
Send message appending instance id and stripping it off the response provided to handler. More... | |
grbl::ErrorCode | sendRealtime (const std::string &cmd, std::function< bool(const std::string &)> msg, const std::chrono::milliseconds &timeout=defaultSendTimeout) override |
Send realtime message appending instance id and stripping it off the response provided to handler. More... | |
bool | wait (const std::chrono::milliseconds &timeout) override |
wait for input More... | |
void | wake () override |
wake thread waiting for input | |
![]() | |
void | fetch (const std::chrono::milliseconds &timeout) |
wait for data and process it More... | |
virtual bool | takeLine (std::string &line) |
consume line from buffer More... | |
Protected Attributes | |
size_t | m_instance |
std::shared_ptr< grbl::GrblDeviceBase > | m_device |
![]() | |
ccut::LineBuffer | m_buffer |
Additional Inherited Members | |
![]() | |
ccut::Signal< std::string > | dataSignal |
![]() | |
static const std::chrono::milliseconds | defaultSendTimeout |
Class for implementing Multi-Grbl functionality on top of GrblDeviceBase.
Allows to create MGrblDeviceWrapper object specifying which Grbl instance it belongs to, and then use send() which will append appropriate instance id to message, and strip it before passing response to provided handler.
Definition at line 48 of file MGrblDeviceWrapper.hpp.
|
overridevirtual |
Send message appending instance id and stripping it off the response provided to handler.
cmd | Message/command to send |
msg | Custom handler for the response |
timeout | Timeout for response |
Reimplemented from grbl::GrblDeviceBase.
Definition at line 50 of file MGrblDeviceWrapper.cpp.
|
overridevirtual |
Send realtime message appending instance id and stripping it off the response provided to handler.
cmd | Message/command to send |
msg | Custom handler for the response |
timeout | Timeout for response |
Reimplemented from grbl::GrblDeviceBase.
Definition at line 69 of file MGrblDeviceWrapper.cpp.
|
overridevirtual |
wait for input
timeout | wait timeout |
Exception(IO) | on IO error |
Implements grbl::GrblDeviceBase.
Definition at line 88 of file MGrblDeviceWrapper.cpp.
|
overridevirtual |
raw write some bytes
[in] | data | bytes to write |
Implements grbl::GrblDeviceBase.
Definition at line 44 of file MGrblDeviceWrapper.cpp.