Skip to content

Commit e96eb6c

Browse files
committed
Add settings.displayServerIP
1 parent 0c9d8c5 commit e96eb6c

File tree

6 files changed

+491
-388
lines changed

6 files changed

+491
-388
lines changed

Firmware/RTK_Surveyor/Display.ino

Lines changed: 437 additions & 387 deletions
Large diffs are not rendered by default.

Firmware/RTK_Surveyor/Network.ino

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ void menuNetwork()
236236
if (settings.enablePvtUdpServer)
237237
systemPrintf("7) PVT UDP Server Port: %ld\r\n", settings.pvtUdpServerPort);
238238

239+
if ((settings.enablePvtServer) || (settings.enablePvtUdpServer))
240+
systemPrintf("8) Display server IP address: %s\r\n", settings.displayServerIP ? "Enabled" : "Disabled");
241+
239242
if (HAS_ETHERNET)
240243
{
241244
//------------------------------
@@ -348,7 +351,10 @@ void menuNetwork()
348351
}
349352
}
350353

351-
//------------------------------
354+
else if (incoming == 8 && ((settings.enablePvtServer) || (settings.enablePvtUdpServer)))
355+
settings.displayServerIP ^= 1;
356+
357+
//------------------------------
352358
// Get the network layer parameters
353359
//------------------------------
354360

Firmware/RTK_Surveyor/PvtServer.ino

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ static volatile RING_BUFFER_OFFSET pvtServerClientTails[PVT_SERVER_MAX_CLIENTS];
8383
// PVT Server handleGnssDataTask Support Routines
8484
//----------------------------------------
8585

86+
bool pvtServerRunning() { return (pvtServerState == PVT_SERVER_STATE_RUNNING); }
87+
8688
// Send data to the PVT clients
8789
int32_t pvtServerClientSendData(int index, uint8_t *data, uint16_t length)
8890
{
@@ -576,4 +578,21 @@ void pvtServerZeroTail()
576578
pvtServerClientTails[index] = 0;
577579
}
578580

581+
void paintPvtServerIP()
582+
{
583+
IPAddress localIp;
584+
NETWORK_DATA * network;
585+
network = &networkData;
586+
if (network)
587+
localIp = networkGetIpAddress(network->type);
588+
589+
char message[31];
590+
591+
snprintf(message, sizeof(message), "%d.%d. %d.%d: %d",
592+
localIp[0], localIp[1], localIp[2], localIp[3],
593+
settings.pvtServerPort);
594+
595+
displayMessageSmall(message, 0);
596+
}
597+
579598
#endif // COMPILE_NETWORK

Firmware/RTK_Surveyor/PvtUdpServer.ino

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ static volatile RING_BUFFER_OFFSET pvtUdpServerTail;
101101
// PVT UDP Server handleGnssDataTask Support Routines
102102
//----------------------------------------
103103

104+
bool udpServerRunning()
105+
{
106+
return (pvtUdpServerState == PVT_UDP_SERVER_STATE_RUNNING);
107+
}
104108
// Send data as broadcast
105109
int32_t pvtUdpServerSendDataBroadcast(uint8_t *data, uint16_t length)
106110
{
@@ -378,4 +382,21 @@ void pvtUdpServerZeroTail()
378382
pvtUdpServerTail = 0;
379383
}
380384

385+
void paintUdpServerIP()
386+
{
387+
IPAddress localIp;
388+
NETWORK_DATA * network;
389+
network = &networkData;
390+
if (network)
391+
localIp = networkGetIpAddress(network->type);
392+
393+
char message[31];
394+
395+
snprintf(message, sizeof(message), "%d.%d. %d.%d: %d",
396+
localIp[0], localIp[1], localIp[2], localIp[3],
397+
settings.pvtUdpServerPort);
398+
399+
displayMessageSmall(message, 0);
400+
}
401+
381402
#endif // COMPILE_NETWORK

Firmware/RTK_Surveyor/RTK_Surveyor.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,12 @@ const uint8_t btMaxEscapeCharacters = 3; // Number of characters needed to enter
481481
// External Display
482482
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
483483
#include <SparkFun_Qwiic_OLED.h> //http://librarymanager/All#SparkFun_Qwiic_Graphic_OLED
484+
485+
#ifdef COMPILE_NETWORK
486+
bool pvtServerRunning(); // Header
487+
bool udpServerRunning(); // Header
488+
#endif // COMPILE_NETWORK
489+
484490
//=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
485491

486492
// Firmware binaries loaded from SD

Firmware/RTK_Surveyor/settings.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,7 @@ typedef struct
11921192
bool debugPvtServer = false;
11931193
bool enablePvtServer = false;
11941194
uint16_t pvtServerPort = 2948; // PVT server port, 2948 is GPS Daemon: http://tcp-udp-ports.com/port-2948.htm
1195+
bool displayServerIP = true;
11951196

11961197
// UDP Server
11971198
bool debugPvtUdpServer = false;

0 commit comments

Comments
 (0)