@@ -31,7 +31,7 @@ tcpServer.ino
31
31
32
32
*/
33
33
34
- #ifdef COMPILE_WIFI
34
+ #ifdef COMPILE_NETWORK
35
35
36
36
// ----------------------------------------
37
37
// Constants
@@ -65,7 +65,7 @@ const RtkMode_t tcpServerMode = RTK_MODE_BASE_FIXED | RTK_MODE_BASE_SURVEY_IN |
65
65
// ----------------------------------------
66
66
67
67
// TCP server
68
- static WiFiServer *tcpServer = nullptr ;
68
+ static NetworkServer *tcpServer = nullptr ;
69
69
static uint8_t tcpServerState;
70
70
static uint32_t tcpServerTimer;
71
71
@@ -234,13 +234,13 @@ bool tcpServerStart()
234
234
systemPrintln (" TCP server starting the server" );
235
235
236
236
// Start the TCP server
237
- tcpServer = new WiFiServer (settings.tcpServerPort );
237
+ tcpServer = new NetworkServer (settings.tcpServerPort , TCP_SERVER_MAX_CLIENTS );
238
238
if (!tcpServer)
239
239
return false ;
240
240
241
241
tcpServer->begin ();
242
242
online.tcpServer = true ;
243
- localIp = wifiGetIpAddress ( );
243
+ localIp = networkGetIpAddress ( networkGetType () );
244
244
systemPrintf (" TCP server online, IP address %d.%d.%d.%d:%d\r\n " , localIp[0 ], localIp[1 ], localIp[2 ], localIp[3 ],
245
245
settings.tcpServerPort );
246
246
return true ;
@@ -460,7 +460,7 @@ void tcpServerUpdate()
460
460
break ;
461
461
462
462
// Start processing the new TCP server client connection
463
- tcpServerClient[index] = new RTKNetworkClientType (client, NETWORK_TYPE_WIFI );
463
+ tcpServerClient[index] = new RTKNetworkClientType (client, networkGetType () );
464
464
tcpServerClientIpAddress[index] = tcpServerClient[index]->remoteIP ();
465
465
tcpServerClientConnected = tcpServerClientConnected | (1 << index);
466
466
tcpServerClientDataSent = tcpServerClientDataSent | (1 << index);
@@ -515,4 +515,4 @@ void tcpServerZeroTail()
515
515
tcpServerClientTails[index] = 0 ;
516
516
}
517
517
518
- #endif // COMPILE_WIFI
518
+ #endif // COMPILE_NETWORK
0 commit comments