mirror of
https://github.com/taigrr/arduinolibs
synced 2025-01-18 04:33:12 -08:00
Memory-efficient encapsulation of command arguments
This commit is contained in:
@@ -10,7 +10,7 @@ int ledPin = 13;
|
||||
|
||||
Shell shell;
|
||||
|
||||
void cmdLed(Shell &shell, int argc, char *argv[])
|
||||
void cmdLed(Shell &shell, int argc, const ShellArguments &argv)
|
||||
{
|
||||
if (argc > 1 && !strcmp(argv[1], "on"))
|
||||
digitalWrite(ledPin, HIGH);
|
||||
|
||||
@@ -21,7 +21,7 @@ bool haveClient = false;
|
||||
|
||||
Shell shell;
|
||||
|
||||
void cmdLed(Shell &shell, int argc, char *argv[])
|
||||
void cmdLed(Shell &shell, int argc, const ShellArguments &argv)
|
||||
{
|
||||
if (argc > 1 && !strcmp(argv[1], "on"))
|
||||
digitalWrite(ledPin, HIGH);
|
||||
@@ -29,7 +29,7 @@ void cmdLed(Shell &shell, int argc, char *argv[])
|
||||
digitalWrite(ledPin, LOW);
|
||||
}
|
||||
|
||||
void cmdExit(Shell &shell, int argc, char *argv[])
|
||||
void cmdExit(Shell &shell, int argc, const ShellArguments &argv)
|
||||
{
|
||||
client.stop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user