MotionLib  1.0.0
SamBuCa motion library
Classes | Public Types | Static Public Member Functions | List of all members
grbl::GrblParser Class Reference

Classes

struct  BuildInfo
 structure holding Grbl build-info ($I) More...
 
struct  PinInfo
 structure holding Grbl pin description ($PINS) More...
 
struct  SettingDesc
 structure holding Grbl setting description ($ES) More...
 
struct  SettingGroup
 structure holding Grbl settingroup info ($EG) More...
 
struct  State
 Struct holding state of Grbl as returned by "?". More...
 

Public Types

typedef grbl::LineType LineType
 
typedef std::pair< std::string, std::string > Message
 
typedef std::pair< int, std::string > Setting
 

Static Public Member Functions

static LineType getLineType (const std::string &line)
 detect line type More...
 
static bool parseMessage (const std::string &line, Message &message)
 parse message More...
 
static bool parseSetting (const std::string &line, Setting &setting)
 parse a setting message More...
 
static bool parseErrorReply (const std::string &line, grbl::ErrorCode &errorCode)
 parse an error message More...
 
static bool parseState (const std::string &line, State &state)
 parse a state message More...
 
static bool parseBuildInfo (const std::string &line, BuildInfo &info)
 incremental parsing of build-info More...
 
static bool parseSettingGroup (const std::string &line, SettingGroup &group)
 incremental parsing of settingGroup More...
 
static bool parseSettingDesc (const std::string &line, SettingDesc &desc)
 incremental parsing of setting description More...
 
static bool parsePinInfo (const std::string &line, PinInfo &info)
 incremental parsing of pins description More...
 
template<typename C >
static bool parsePinInfo (const std::string &line, C &c)
 

Detailed Description

Definition at line 48 of file GrblParser.hpp.

Member Function Documentation

◆ getLineType()

LineType grbl::GrblParser::getLineType ( const std::string &  line)
static

detect line type

Parameters
lineline to check
Returns
line type

Definition at line 51 of file GrblParser.cpp.

Here is the caller graph for this function:

◆ parseBuildInfo()

bool grbl::GrblParser::parseBuildInfo ( const std::string &  line,
GrblParser::BuildInfo buildInfo 
)
static

incremental parsing of build-info

Parameters
lineline to parse
[out]infoBuildInfo to populate
Returns
true if some data was parsed

Definition at line 209 of file GrblParser.cpp.

Here is the call graph for this function:

◆ parseErrorReply()

bool grbl::GrblParser::parseErrorReply ( const std::string &  line,
grbl::ErrorCode &  errorCode 
)
static

parse an error message

Parameters
lineline to parse
errorCodeparsed code
Returns
true if parsed

Definition at line 103 of file GrblParser.cpp.

Here is the caller graph for this function:

◆ parseMessage()

bool grbl::GrblParser::parseMessage ( const std::string &  line,
Message &  message 
)
static

parse message

separate topic from payload

Parameters
lineline to parse
messageparsed message
Returns
true if parsed

Definition at line 75 of file GrblParser.cpp.

Here is the caller graph for this function:

◆ parsePinInfo()

bool grbl::GrblParser::parsePinInfo ( const std::string &  line,
PinInfo info 
)
static

incremental parsing of pins description

Parameters
[in]lineline to parse
[out]infoPinInfo to populate

pinInfo messages use the following syntax: \[PIN:[<port>]<pin>,<function>[,description]\] the port and description being optional

Returns
true if some data was parsed

Definition at line 335 of file GrblParser.cpp.

Here is the call graph for this function:

◆ parseSetting()

bool grbl::GrblParser::parseSetting ( const std::string &  line,
Setting &  setting 
)
static

parse a setting message

Parameters
lineline to parse
settingparsed setting
Returns
true if parsed

Definition at line 89 of file GrblParser.cpp.

◆ parseSettingDesc()

bool grbl::GrblParser::parseSettingDesc ( const std::string &  line,
SettingDesc desc 
)
static

incremental parsing of setting description

Parameters
lineline to parse
[out]descSettingDesc to populate
Returns
true if some data was parsed

Definition at line 295 of file GrblParser.cpp.

Here is the call graph for this function:

◆ parseSettingGroup()

bool grbl::GrblParser::parseSettingGroup ( const std::string &  line,
SettingGroup group 
)
static

incremental parsing of settingGroup

Parameters
lineline to parse
[out]groupSettingGroup to populate
Returns
true if some data was parsed

Definition at line 261 of file GrblParser.cpp.

Here is the call graph for this function:

◆ parseState()

bool grbl::GrblParser::parseState ( const std::string &  line,
State state 
)
static

parse a state message

Parameters
[in]lineline to parse
[out]stateparsed state
Returns
true if parsed

Definition at line 117 of file GrblParser.cpp.


The documentation for this class was generated from the following files: