Skip to content

Commit e2ad3fd

Browse files
committed
settings: Better definition for NETCONSUMER_OTA_CLIENT
1 parent b173f16 commit e2ad3fd

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

Firmware/RTK_Everywhere/NtripServer.ino

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ void ntripServerStart(int serverIndex)
557557
systemPrintf("NTRIP Server %d start\r\n", serverIndex);
558558
ntripServerStop(serverIndex, false);
559559
if (ntripServerEnabled(serverIndex, nullptr))
560-
networkConsumerAdd(NETCONSUMER_NTRIP_SERVER_0 + serverIndex, NETWORK_ANY, __FILE__, __LINE__);
560+
networkConsumerAdd(NETCONSUMER_NTRIP_SERVER + serverIndex, NETWORK_ANY, __FILE__, __LINE__);
561561
}
562562

563563
//----------------------------------------
@@ -588,7 +588,7 @@ void ntripServerStop(int serverIndex, bool shutdown)
588588

589589
// Determine the next NTRIP server state
590590
online.ntripServer[serverIndex] = false;
591-
networkConsumerOffline(NETCONSUMER_NTRIP_SERVER_0 + serverIndex);
591+
networkConsumerOffline(NETCONSUMER_NTRIP_SERVER + serverIndex);
592592
if (shutdown)
593593
{
594594
if (settings.debugNtripServerState)
@@ -599,7 +599,7 @@ void ntripServerStop(int serverIndex, bool shutdown)
599599
systemPrintf("NTRIP Server %d caster port not configured!\r\n", serverIndex);
600600
if (settings.debugNtripServerState && (!settings.ntripServer_MountPoint[serverIndex][0]))
601601
systemPrintf("NTRIP Server %d mount point not configured!\r\n", serverIndex);
602-
networkConsumerRemove(NETCONSUMER_NTRIP_SERVER_0 + serverIndex, NETWORK_ANY, __FILE__, __LINE__);
602+
networkConsumerRemove(NETCONSUMER_NTRIP_SERVER + serverIndex, NETWORK_ANY, __FILE__, __LINE__);
603603
ntripServerSetState(ntripServer, NTRIP_SERVER_OFF);
604604
ntripServer->connectionAttempts = 0;
605605
ntripServer->connectionAttemptTimeout = 0;
@@ -635,7 +635,7 @@ void ntripServerUpdate(int serverIndex)
635635

636636
// Shutdown the NTRIP server when the mode or setting changes
637637
DMW_ds(ntripServerSetState, ntripServer);
638-
connected = networkConsumerIsConnected(NETCONSUMER_NTRIP_SERVER_0 + serverIndex);
638+
connected = networkConsumerIsConnected(NETCONSUMER_NTRIP_SERVER + serverIndex);
639639
enabled = ntripServerEnabled(serverIndex, &line);
640640
if (!enabled && (ntripServer->state > NTRIP_SERVER_OFF))
641641
ntripServerShutdown(serverIndex);
@@ -676,14 +676,14 @@ void ntripServerUpdate(int serverIndex)
676676
reportHeapNow(settings.debugNtripServerState);
677677

678678
// Reset the timeout when the network changes
679-
if (networkChanged(NETCONSUMER_NTRIP_SERVER_0 + serverIndex))
679+
if (networkChanged(NETCONSUMER_NTRIP_SERVER + serverIndex))
680680
{
681681
ntripServer->connectionAttempts = 0;
682682
ntripServer->connectionAttemptTimeout = 0;
683683
}
684684

685685
// The network is available for the NTRIP server
686-
networkUserAdd(NETCONSUMER_NTRIP_SERVER_0 + serverIndex, __FILE__, __LINE__);
686+
networkUserAdd(NETCONSUMER_NTRIP_SERVER + serverIndex, __FILE__, __LINE__);
687687
ntripServerSetState(ntripServer, NTRIP_SERVER_NETWORK_CONNECTED);
688688
}
689689
}
@@ -887,8 +887,6 @@ void ntripServerUpdate()
887887
//----------------------------------------
888888
void ntripServerValidateTables()
889889
{
890-
if (NETCONSUMER_OTA_CLIENT != (NETCONSUMER_NTRIP_SERVER_0 + NTRIP_SERVER_MAX))
891-
reportFatalError("Adjust NETCONSUMER_NTRIP_SERVER_* entries to match NTRIP_SERVER_MAX");
892890
if (ntripServerStateNameEntries != NTRIP_SERVER_STATE_MAX)
893891
reportFatalError("Fix ntripServerStateNameEntries to match NTRIPServerState");
894892
}

Firmware/RTK_Everywhere/settings.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -581,11 +581,8 @@ enum
581581
NETCONSUMER_NTP_SERVER,
582582
NETCONSUMER_NTRIP_CLIENT,
583583
NETCONSUMER_NTRIP_SERVER,
584-
NETCONSUMER_NTRIP_SERVER_0 = NETCONSUMER_NTRIP_SERVER,
585-
NETCONSUMER_NTRIP_SERVER_1,
586-
NETCONSUMER_NTRIP_SERVER_2,
587-
NETCONSUMER_NTRIP_SERVER_3,
588-
NETCONSUMER_OTA_CLIENT,
584+
NETCONSUMER_NTRIP_SERVER_MAX = NETCONSUMER_NTRIP_SERVER + NTRIP_SERVER_MAX,
585+
NETCONSUMER_OTA_CLIENT = NETCONSUMER_NTRIP_SERVER_MAX,
589586
NETCONSUMER_PPL_KEY_UPDATE,
590587
NETCONSUMER_PPL_MQTT_CLIENT,
591588
NETCONSUMER_TCP_CLIENT,

0 commit comments

Comments
 (0)