@@ -576,8 +576,9 @@ void RemoteDebug::handle() {
576
576
if (_password != " " && !_passwordOk) { // Request password - 18/08/08
577
577
maxTime = 60000 ; // One minute to password
578
578
}
579
+ else maxTime = connectionTimeout; // When password is ok set normal timeout
579
580
580
- if ((millis () - _lastTimeCommand) > maxTime) {
581
+ if ((maxTime > 0 ) && (( millis () - _lastTimeCommand) > maxTime) ) {
581
582
582
583
debugPrintln (" * Closing session by inactivity" );
583
584
@@ -1326,6 +1327,7 @@ void RemoteDebug::showHelp() {
1326
1327
help.concat (" s -> set debug silence on/off\r\n " );
1327
1328
help.concat (" l -> show debug level\r\n " );
1328
1329
help.concat (" t -> show time (millis)\r\n " );
1330
+ help.concat (" timeout -> set connection timeout (sec, 0 = disabled)\r\n " );
1329
1331
help.concat (" profiler:\r\n " );
1330
1332
help.concat (
1331
1333
" p -> show time between actual and last message (in millis)\r\n " );
@@ -1617,6 +1619,20 @@ void RemoteDebug::processCommand() {
1617
1619
1618
1620
debugPrintf (" * Show time: %s\r\n " , (_showTime) ? " On" : " Off" );
1619
1621
1622
+ } else if (_command.startsWith (" timeout" )) {
1623
+
1624
+ // Set or get connection timeout
1625
+
1626
+ if (options.length () > 0 ) { // With minimal time
1627
+ if ((options.toInt () >= 60 ) || (options.toInt () == 0 )) {
1628
+ connectionTimeout = options.toInt () * 1000 ;
1629
+ }
1630
+ else {
1631
+ debugPrintf (" * Connection Timeout must be minimal 60 seconds.\r\n " );
1632
+ }
1633
+ }
1634
+ debugPrintf (" * Connection Timeout: %d seconds (0=disabled)\r\n " , connectionTimeout/1000 );
1635
+
1620
1636
} else if (_command == " s" ) {
1621
1637
1622
1638
// Toogle silence (new) = 28/08/18
0 commit comments