From 1e42be051bd8ee0372d64307e5439cf37d9c9cfa Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Tue, 10 Nov 2020 11:30:53 +0100 Subject: [PATCH] set telnet timeout from console --- src/console.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/console.cpp b/src/console.cpp index ac96c2cbd..d90832a72 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -300,6 +300,16 @@ void EMSESPShell::add_console_commands() { "local"); }); + commands->add_command(ShellContext::MAIN, + CommandFlags::USER, + flash_string_vector{F_(set), F_(timeout)}, + flash_string_vector{F_(n_mandatory)}, + [](Shell & shell, const std::vector & arguments) { + uint16_t value = Helpers::atoint(arguments.front().c_str()); + telnet_.initial_idle_timeout(value * 60); + shell.printfln(F("Telnet timout is %d minutes"), value); + }); + commands->add_command(ShellContext::MAIN, CommandFlags::ADMIN, flash_string_vector{F_(send), F_(telegram)},