25 #ifndef ACE_ROUTINE_COMMAND_MANAGER_H 26 #define ACE_ROUTINE_COMMAND_MANAGER_H 28 #include <AceRoutine.h> 29 #include "CommandDispatcher.h" 30 #include "StreamLineReader.h" 81 template<u
int8_t BUF_SIZE, u
int8_t ARGV_SIZE>
97 Stream& serial,
const char* prompt =
nullptr):
99 mNumCommands(numCommands),
102 mStreamLineReader(mChannel, mSerial, mLineBuffer, BUF_SIZE),
103 mDispatcher(mChannel, mSerial, mCommands, mNumCommands,
104 mArgv, ARGV_SIZE, mPrompt) {}
117 uint8_t
const mNumCommands;
119 const char*
const mPrompt;
123 char mLineBuffer[BUF_SIZE];
124 const char* mArgv[ARGV_SIZE];
Signature for a command handler.
virtual int runCoroutine() override
The body of the coroutine.
virtual int runCoroutine() override
The body of the coroutine.
A convenience wrapper around a CommandDispatcher that hides complexity of creating, initializing and injecting the resources needed by the CommandDispatcher.
const CommandDispatcher * getDispatcher() const
Return the CommandDispatcher.
CommandManager(const CommandHandler *const *commands, uint8_t numCommands, Stream &serial, const char *prompt=nullptr)
Constructor.
An AceRoutine coroutine that reads lines (terminated by '\n' or '\r' from the Stream device...
An unbuffered synchronized channel.
A coroutine that reads lines from the Serial port, tokenizes the line on whitespace boundaries...
virtual int runCoroutine() override
The body of the coroutine.
Base class of all coroutines.