Skip to content

Commit 72fb0bb

Browse files
committed
TcpServer: Periodically display all of the client connections
1 parent 0916654 commit 72fb0bb

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Firmware/RTK_Everywhere/TcpServer.ino

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -346,12 +346,9 @@ void tcpServerClientUpdate(uint8_t index)
346346

347347
// Periodically display this client connection
348348
if (PERIODIC_DISPLAY(PD_TCP_SERVER_DATA) && (!inMainMenu))
349-
{
350-
PERIODIC_CLEAR(PD_TCP_SERVER_DATA);
351349
systemPrintf("%s client %d connected to %s\r\n",
352350
tcpServerName, index,
353351
tcpServerClientIpAddress[index].toString().c_str());
354-
}
355352
break;
356353
}
357354

@@ -371,14 +368,10 @@ void tcpServerClientUpdate(uint8_t index)
371368
// TCP server client found
372369
// Start processing the new TCP server client connection
373370
tcpServerClientIpAddress[index] = tcpServerClient[index]->remoteIP();
374-
375371
if ((settings.debugTcpServer || PERIODIC_DISPLAY(PD_TCP_SERVER_DATA)) && (!inMainMenu))
376-
{
377-
PERIODIC_CLEAR(PD_TCP_SERVER_DATA);
378372
systemPrintf("%s client %d connected to %s\r\n",
379373
tcpServerName, index,
380374
tcpServerClientIpAddress[index].toString().c_str());
381-
}
382375

383376
// If we are acting as an NTRIP Caster, intercept the initial communication from the client
384377
// and respond accordingly
@@ -550,8 +543,6 @@ void tcpServerStopClient(int index)
550543
// Done with this client connection
551544
if ((settings.debugTcpServer || PERIODIC_DISPLAY(PD_TCP_SERVER_DATA)) && (!inMainMenu))
552545
{
553-
PERIODIC_CLEAR(PD_TCP_SERVER_DATA);
554-
555546
// Determine the shutdown reason
556547
connected = tcpServerClient[index]->connected()
557548
&& (!(tcpServerClientWriteError & (1 << index)));
@@ -664,21 +655,19 @@ void tcpServerUpdate()
664655
if (connected == false)
665656
{
666657
if ((settings.debugTcpServer || PERIODIC_DISPLAY(PD_TCP_SERVER_DATA)) && (!inMainMenu))
667-
{
668-
PERIODIC_CLEAR(PD_TCP_SERVER_DATA);
669658
systemPrintf("%s initiating shutdown\r\n", tcpServerName);
670-
}
671659

672660
// Network connection failed, attempt to restart the network
673661
tcpServerStop();
662+
if (PERIODIC_DISPLAY(PD_TCP_SERVER_DATA))
663+
PERIODIC_CLEAR(PD_TCP_SERVER_DATA);
674664
break;
675665
}
676666

677667
// Walk the list of TCP server clients
678668
for (index = 0; index < TCP_SERVER_MAX_CLIENTS; index++)
679-
{
680669
tcpServerClientUpdate(index);
681-
}
670+
PERIODIC_CLEAR(PD_TCP_SERVER_DATA);
682671

683672
// Check for data moving across the connections
684673
if ((millis() - tcpServerTimer) >= TCP_SERVER_CLIENT_DATA_TIMEOUT)

0 commit comments

Comments
 (0)