1
0
mirror of https://github.com/taigrr/arduinolibs synced 2025-01-18 04:33:12 -08:00

Special handling for TCP clients in the shell

This commit is contained in:
Rhys Weatherley
2016-03-12 05:51:33 +10:00
parent 6f03fa2cfc
commit 9221104977
5 changed files with 80 additions and 9 deletions

View File

@@ -29,13 +29,7 @@ void cmdLed(Shell &shell, int argc, const ShellArguments &argv)
digitalWrite(ledPin, LOW);
}
void cmdExit(Shell &shell, int argc, const ShellArguments &argv)
{
client.stop();
}
ShellCommand(led, "Turns the status LED on or off", cmdLed);
ShellCommand(exit, "Exit and log out", cmdExit);
void setup()
{
@@ -72,7 +66,7 @@ void loop()
client = server.available();
if (client) {
haveClient = true;
shell.begin(client, 5, Terminal::Telnet);
shell.begin(client, 5);
}
} else if (!client.connected()) {
// The current client has been disconnected. Shut down the shell.