sCLI is a small Arduino library that allows you to implement a simple command line interpreter based on user-defined functions.
#include <sCLI.h>
Constructs an instance of the sCLI class.
sCLI();
Adds a command with its corresponding function to the CLI.
void addCommand(const char *command, CommandFunction function);
Adds a Stream object to the CLI for input/output.
void addStream(Stream &stream);
Sets the CLI prompt.
void setPrompt(const char *prompt);
Prints a message to all registered streams.
void print(const char *message);
Prints a message followed by a new line to all registered streams.
void println(const char *message);
Prints a number to all registered streams.
void printNumber(int number);
Prints a floating-point number with a specified number of decimal places to all registered streams.
void printNumber(float number, uint8_t decimalPlaces);
Executes the current command in the command buffer.
void executeCommand();
Main execution loop for the CLI.
void loop();