semf
|
This class manages a semf's embedded shell (esh) operating on a single UART. The esh can be used for executing custom command and running them in a main-function-like environment. For using the esh create an instance of this class. Call the start
function for staring the shell and call the loop
function inside an endless loop to enable command execution. For adding command to the shell simply create at least one esh::Command
object.
More...
#include <shell.h>
Classes | |
struct | Config |
Configuarion parameters of the shell. More... | |
Public Member Functions | |
Shell (UartHardware &uart, const Config &config) | |
Constructor. More... | |
Shell (const Shell &other)=delete | |
virtual | ~Shell ()=default |
void | addCommand (Command &cmd) |
Adds a command to the shell. More... | |
void | start () |
Starts the reading process of the shell. The user should call this function once. More... | |
void | loop () |
Performs the command execution. More... | |
SEMF_SIGNAL (error, Error) | |
This class manages a semf's embedded shell (esh) operating on a single UART. The esh can be used for executing custom command and running them in a main-function-like environment. For using the esh create an instance of this class. Call the start
function for staring the shell and call the loop
function inside an endless loop to enable command execution. For adding command to the shell simply create at least one esh::Command
object.
semf::esh::Shell::Shell | ( | UartHardware & | uart, |
const Config & | config | ||
) |
|
delete |
|
virtualdefault |
void semf::esh::Shell::addCommand | ( | Command & | cmd | ) |
Adds a command to the shell.
cmd | Command to add to the shell. |
esh::Command
the user shouldn't have to call this function. Definition at line 34 of file shell.cpp.
void semf::esh::Shell::loop | ( | ) |
semf::esh::Shell::SEMF_SIGNAL | ( | error | , |
Error | |||
) |
Gets emitted on errors.