| ECC1C 145-944-00

Public Types | Public Member Functions | Public Attributes | List of all members
CommandParser

## Public Types
typedef Binder::CArg0< Binder::Buffer > | Command

## Public Member Functions
Error | process (const Arguments &a)
bool | parseCommand ()
void | setAnswerer (Binder *answerer)
Public Member Functions inherited from Binder
virtual Error | process (const Arguments &args)=0
template<typename T >
Error | operator() (T &t)
template<typename T >
Error | operator() (const T &t)

## Public Attributes
CircularBuffer< 1024 > | circularBuffer
Binder * | answerHandler

## Detailed Description

The message parser to command. This takes a bunch of bytes as a Buffer as input, copy them in internal FIFO and returns immediately. This design is required since the Serial code that'll connected to this needs to answer as fast as possible since it's called in interrupt handlers. Processing is done later on by the main loop.

## Member Typedef Documentation

## ◆ Command

typedef Binder::CArg0<Binder::Buffer> Command

The processCommand's and sendAnswer's expected arguments type

## Member Function Documentation

## ◆ parseCommand()

bool parseCommand | ( |  | ) |

Parse the first command in the buffer

References CommandParser::answerHandler, CommandParser::circularBuffer, CircularBuffer< FixedSize >::Extract(), Registry::getCommand(), and BaseParser::process().

## ◆ process()

Error process | ( | const Arguments & | a | ) |
| inline virtual

Binder interface likely called by the Serial class

Implements Binder.

References CircularBuffer< FixedSize >::Append(), and CommandParser::circularBuffer.

## ◆ setAnswerer()

void setAnswerer | ( | Binder * | answerer | ) |
| inline

Set the answerer's binder

References CommandParser::answerHandler.

## Member Data Documentation

## ◆ answerHandler

Binder* answerHandler

The answer handler

Referenced by CommandParser::parseCommand(), and CommandParser::setAnswerer().

## ◆ circularBuffer

CircularBuffer<1024> circularBuffer

This is the circular buffer where messages are stored before parsing

Referenced by CommandParser::parseCommand(), and CommandParser::process().