/sCLI

Small arduino library to implement a simple command line interpreter based on the user defined functions

Primary LanguageC++

logo-no-background

sCLI - Simple Command Line Interpreter Library for Arduino

Version License

sCLI is a small Arduino library that allows you to implement a simple command line interpreter based on user-defined functions.

Class Reference

sCLI

#include <sCLI.h>

Public Member Functions

sCLI()

Constructs an instance of the sCLI class.

sCLI();
void addCommand(const char *command, CommandFunction function)

Adds a command with its corresponding function to the CLI.

void addCommand(const char *command, CommandFunction function);
void addStream(Stream &stream)

Adds a Stream object to the CLI for input/output.

void addStream(Stream &stream);
void setPrompt(const char *prompt)

Sets the CLI prompt.

void setPrompt(const char *prompt);
void print(const char *message)

Prints a message to all registered streams.

void print(const char *message);
void println(const char *message)

Prints a message followed by a new line to all registered streams.

void println(const char *message);
void printNumber(int number)

Prints a number to all registered streams.

void printNumber(int number);
void printNumber(float number, uint8_t decimalPlaces)

Prints a floating-point number with a specified number of decimal places to all registered streams.

void printNumber(float number, uint8_t decimalPlaces);
void executeCommand()

Executes the current command in the command buffer.

void executeCommand();
void loop()

Main execution loop for the CLI.

void loop();