Browse Source

Reset first telnet command on every connection

softuart
Xose Pérez 6 years ago
parent
commit
2d2f44d3b5
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      code/espurna/telnet.ino

+ 4
- 3
code/espurna/telnet.ino View File

@ -14,6 +14,7 @@ Parts of the code have been borrowed from Thomas Sarlandie's NetServer
AsyncServer * _telnetServer;
AsyncClient * _telnetClients[TELNET_MAX_CLIENTS];
bool _telnetFirst = true;
// -----------------------------------------------------------------------------
// Private methods
@ -50,9 +51,8 @@ unsigned char _telnetWrite(void *data, size_t len) {
void _telnetData(unsigned char clientId, void *data, size_t len) {
// Skip first message since it's always garbage
static bool first = true;
if (first) {
first = false;
if (_telnetFirst) {
_telnetFirst = false;
return;
}
@ -109,6 +109,7 @@ void _telnetNewClient(AsyncClient *client) {
}, 0);
DEBUG_MSG_P(PSTR("[TELNET] Client #%u connected\n"), i);
_telnetFirst = true;
wifiReconnectCheck();
return;


Loading…
Cancel
Save