|
void | fetch (const std::chrono::milliseconds &timeout) |
| wait for data and process it More...
|
|
virtual void | write (const std::string &data)=0 |
| raw write some bytes More...
|
|
virtual grbl::ErrorCode | send (const std::string &cmd, std::function< bool(const std::string &)> msg={}, const std::chrono::milliseconds &timeout=defaultSendTimeout) |
| send a command wait for reply More...
|
|
virtual grbl::ErrorCode | sendRealtime (const std::string &cmd, std::function< bool(const std::string &)> msg={}, const std::chrono::milliseconds &timeout=defaultSendTimeout) |
| send a realtime-command wait for reply More...
|
|
virtual void | wake ()=0 |
| wake thread waiting for input
|
|
virtual void | read ()=0 |
| fill LineBuffer with incoming bytes
|
|
virtual bool | wait (const std::chrono::milliseconds &timeout)=0 |
| wait for input More...
|
|
virtual bool | takeLine (std::string &line) |
| consume line from buffer More...
|
|
|
ccut::Signal< std::string > | dataSignal |
|
|
static const std::chrono::milliseconds | defaultSendTimeout |
|
|
ccut::LineBuffer | m_buffer |
|
Definition at line 43 of file GrblDeviceBase.hpp.
◆ fetch()
void GrblDeviceBase::fetch |
( |
const std::chrono::milliseconds & |
timeout | ) |
|
wait for data and process it
- Parameters
-
timeout | wait timeout @emits dataSignal for each line received |
- Exceptions
-
Definition at line 42 of file GrblDeviceBase.cpp.
◆ send()
grbl::ErrorCode GrblDeviceBase::send |
( |
const std::string & |
cmd, |
|
|
std::function< bool(const std::string &)> |
msg = {} , |
|
|
const std::chrono::milliseconds & |
timeout = defaultSendTimeout |
|
) |
| |
|
virtual |
send a command wait for reply
- Parameters
-
[in] | cmd | command to send |
[in] | [msg] | message handler (for commands with replies) |
[in] | [timeout] | command timeout |
- Returns
- 0 on success, error-code on error (device specific)
callback function must return true if line has been processed
callback function may throw grbl::ErrorCode to stop processing grbl::ErrorCode::Ok may be used to properly exit
Reimplemented in grbl::MGrblDeviceWrapper.
Definition at line 56 of file GrblDeviceBase.cpp.
◆ sendRealtime()
grbl::ErrorCode GrblDeviceBase::sendRealtime |
( |
const std::string & |
cmd, |
|
|
std::function< bool(const std::string &)> |
msg = {} , |
|
|
const std::chrono::milliseconds & |
timeout = defaultSendTimeout |
|
) |
| |
|
virtual |
send a realtime-command wait for reply
- Parameters
-
[in] | cmd | command to send |
[in] | [msg] | message handler |
[in] | [timeout] | command timeout |
- Returns
- 0 on success, error-code on error (device specific)
callback function must return true if line has been processed
callback function may throw grbl::ErrorCode to stop processing grbl::ErrorCode::Ok may be used to properly exit
this method is slightly different from send
, it won't append carriage return and not parse any "ok" or "error" messages.
Reimplemented in grbl::MGrblDeviceWrapper.
Definition at line 122 of file GrblDeviceBase.cpp.
◆ takeLine()
bool GrblDeviceBase::takeLine |
( |
std::string & |
line | ) |
|
|
virtual |
◆ wait()
virtual bool grbl::GrblDeviceBase::wait |
( |
const std::chrono::milliseconds & |
timeout | ) |
|
|
pure virtual |
◆ write()
virtual void grbl::GrblDeviceBase::write |
( |
const std::string & |
data | ) |
|
|
pure virtual |
The documentation for this class was generated from the following files: