Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions examples/Cli_Example1/Cli_Example1.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,34 @@

Cli cli = Cli(Serial);

void FunctionHello(void) {Serial.println("\"functionHello\" is being executed!");}
void FunctionHello(void) {
Serial.println("\"functionHello\" is being executed!");
Serial.print("FunctionHello() parm: [");
Serial.print(cli.parm); // <== you can do something usefull with the String "cli.parm"
Serial.println("]");
}

void FunctionByebye(void) {Serial.println("\"functionByebye\" is being executed!");}
void FunctionSeeyou(void) {Serial.println("\"functionSeeyou\" is being executed!");}
void FunctionHelp(void) {Serial.println("==Help==\nType:\nHello\nByebye\nSeeyou\n");}

void setup(){
cli.RegisterCmd("hello",&FunctionHello);
cli.RegisterCmd("byebye",&FunctionByebye);
cli.RegisterCmd("seeyou",&FunctionSeeyou);
Serial.begin(115200);
cli.RegisterCmd("help",&FunctionHelp);
cli.RegisterCmd("Hello",&FunctionHello); // <== case does not matter
cli.RegisterCmd("ByeBye",&FunctionByebye);
cli.RegisterCmd("seeYou",&FunctionSeeyou);
Serial.begin(19200);

Serial.println("Enter command or type 'help'");
}

void loop(){
cli.Run();

}