Removed phone_timeout_secs pref references (#1503)

This commit is contained in:
Ben Meadors
2022-06-12 09:44:23 -05:00
committed by GitHub
co-authored by GitHub
parent 4458b470aa
commit 5106433572
8 changed files with 15 additions and 22 deletions
+4 -2
View File
@@ -4,6 +4,8 @@
#include "configuration.h"
#define Port Serial
// Defaulting to the formerly removed phone_timeout_secs value of 15 minutes
#define SERIAL_CONNECTION_TIMEOUT (15 * 60) * 1000UL
SerialConsole *console;
@@ -41,12 +43,12 @@ SerialConsole::SerialConsole() : StreamAPI(&Port), RedirectablePrint(&Port)
emitRebooted();
}
// For the serial port we can't really detect if any client is on the other side, so instead just look for recent messages
bool SerialConsole::checkIsConnected()
{
uint32_t now = millis();
uint32_t timeout = (config.power.phone_timeout_secs > 0 ? config.power.phone_timeout_secs : default_phone_timeout_secs )* 1000UL;
return (now - lastContactMsec) < timeout;
return (now - lastContactMsec) < SERIAL_CONNECTION_TIMEOUT;
}
/**