Class Shell

Nested Relationships

Nested Types

Class Documentation

class Shell

This class interprets and processes the commands entered by the user.

Public Types

typedef void (*CommandCallback)(int argc, char **argv)

Command callback type.

Public Functions

void set_serial_stream(const SerialStream *serial_stream)

Sets the serial stream to use.

Parameters:

serial_stream – Serial stream.

void set_default_callback(CommandCallback callback)

Sets the default callback for unknown commands.

Parameters:

callback – Callback function.

void register_command(const char *name, CommandCallback callback)

Adds a command registry entry to the shell.

Parameters:
  • name – Command name.

  • callback – Callback function.

void process_input()

Processes the available input at the command prompt (if any). Meant to be called continously.