Skip to content

Commit 83d6e91

Browse files
committed
Rename NETCONSUMER_* to NETIF_*
1 parent 4fef3c3 commit 83d6e91

File tree

3 files changed

+30
-30
lines changed

3 files changed

+30
-30
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,8 +1398,8 @@ void networkUpdate()
13981398

13991399
// Once services have been updated, determine if the network needs to be started/stopped
14001400

1401-
static uint16_t previousConsumerTypes = NETCONSUMER_NONE;
1402-
static uint16_t consumerTypes = NETCONSUMER_NONE;
1401+
static uint16_t previousConsumerTypes = NETIF_NONE;
1402+
static uint16_t consumerTypes = NETIF_NONE;
14031403

14041404
int consumerCount = networkConsumers(&consumerTypes); // Update the current consumer types
14051405

@@ -1440,33 +1440,33 @@ void networkUpdate()
14401440
{
14411441
systemPrintf("Changing network from consumer type: 0x%02X (", previousConsumerTypes);
14421442

1443-
if (previousConsumerTypes == NETCONSUMER_NONE)
1443+
if (previousConsumerTypes == NETIF_NONE)
14441444
systemPrint("None");
14451445
else
14461446
{
1447-
if (previousConsumerTypes & (1 << NETCONSUMER_WIFI_STA))
1447+
if (previousConsumerTypes & (1 << NETIF_WIFI_STA))
14481448
systemPrint("/STA");
1449-
if (previousConsumerTypes & (1 << NETCONSUMER_WIFI_AP))
1449+
if (previousConsumerTypes & (1 << NETIF_WIFI_AP))
14501450
systemPrint("/AP");
1451-
if (previousConsumerTypes & (1 << NETCONSUMER_CELLULAR))
1451+
if (previousConsumerTypes & (1 << NETIF_CELLULAR))
14521452
systemPrint("/CELL");
1453-
if (previousConsumerTypes & (1 << NETCONSUMER_ETHERNET))
1453+
if (previousConsumerTypes & (1 << NETIF_ETHERNET))
14541454
systemPrint("/ETH");
14551455
}
14561456

14571457
systemPrintf(") to: 0x%02X (", consumerTypes);
14581458

1459-
if (consumerTypes == NETCONSUMER_NONE)
1459+
if (consumerTypes == NETIF_NONE)
14601460
systemPrint("None");
14611461
else
14621462
{
1463-
if (consumerTypes & (1 << NETCONSUMER_WIFI_STA))
1463+
if (consumerTypes & (1 << NETIF_WIFI_STA))
14641464
systemPrint("/STA");
1465-
if (consumerTypes & (1 << NETCONSUMER_WIFI_AP))
1465+
if (consumerTypes & (1 << NETIF_WIFI_AP))
14661466
systemPrint("/AP");
1467-
if (consumerTypes & (1 << NETCONSUMER_CELLULAR))
1467+
if (consumerTypes & (1 << NETIF_CELLULAR))
14681468
systemPrint("/CELL");
1469-
if (consumerTypes & (1 << NETCONSUMER_ETHERNET))
1469+
if (consumerTypes & (1 << NETIF_ETHERNET))
14701470
systemPrint("/ETH");
14711471
}
14721472

@@ -1487,19 +1487,19 @@ void networkUpdate()
14871487
{
14881488
// Attempt to start any network that is needed, in the order Ethernet/WiFi/Cellular
14891489

1490-
if (consumerTypes & (1 << NETCONSUMER_ETHERNET))
1490+
if (consumerTypes & (1 << NETIF_ETHERNET))
14911491
{
14921492
networkStart(NETWORK_ETHERNET, settings.debugNetworkLayer);
14931493
}
14941494

14951495
// Start WiFi if we need AP, or if we need STA+Internet
1496-
if ((consumerTypes & (1 << NETCONSUMER_WIFI_AP)) ||
1497-
((consumerTypes & (1 << NETCONSUMER_WIFI_STA) && networkHasInternet() == false)))
1496+
if ((consumerTypes & (1 << NETIF_WIFI_AP)) ||
1497+
((consumerTypes & (1 << NETIF_WIFI_STA) && networkHasInternet() == false)))
14981498
{
14991499
networkStart(NETWORK_WIFI, settings.debugNetworkLayer);
15001500
}
15011501

1502-
if ((networkHasInternet() == false) && (consumerTypes & (1 << NETCONSUMER_CELLULAR)))
1502+
if ((networkHasInternet() == false) && (consumerTypes & (1 << NETIF_CELLULAR)))
15031503
{
15041504
// If we're in AP only mode (no internet), don't start cellular
15051505
if (WIFI_SOFT_AP_RUNNING() == false)
@@ -1596,7 +1596,7 @@ uint8_t networkConsumers(uint16_t *consumerTypes)
15961596
uint8_t consumerCount = 0;
15971597
uint16_t consumerId = 0; // Used to debug print who is asking for access
15981598

1599-
*consumerTypes = NETCONSUMER_NONE; // Clear bitfield
1599+
*consumerTypes = NETIF_NONE; // Clear bitfield
16001600

16011601
// If a consumer needs the network or is currently consuming the network (is online) then increment
16021602
// consumer count
@@ -1649,7 +1649,7 @@ uint8_t networkConsumers(uint16_t *consumerTypes)
16491649
// Caster is available over ethernet, WiFi AP, WiFi STA, and cellular
16501650
// Caster is available in all mode: Rover, and Base
16511651
if (settings.enableNtripCaster == true || settings.baseCasterOverride == true)
1652-
*consumerTypes |= (1 << NETCONSUMER_WIFI_AP);
1652+
*consumerTypes |= (1 << NETIF_WIFI_AP);
16531653
}
16541654

16551655
// Network needed for UDP Server
@@ -1682,7 +1682,7 @@ uint8_t networkConsumers(uint16_t *consumerTypes)
16821682
{
16831683
consumerCount++;
16841684
consumerId |= (1 << 7);
1685-
*consumerTypes = (1 << NETCONSUMER_WIFI_STA); // OTA Pull library only supports WiFi
1685+
*consumerTypes = (1 << NETIF_WIFI_STA); // OTA Pull library only supports WiFi
16861686
}
16871687

16881688
// Network needed for Web Config
@@ -1694,14 +1694,14 @@ uint8_t networkConsumers(uint16_t *consumerTypes)
16941694
*consumerTypes = NETWORK_EWC; // Ask for eth/wifi/cellular
16951695

16961696
if (settings.wifiConfigOverAP == true)
1697-
*consumerTypes |= (1 << NETCONSUMER_WIFI_AP); // WebConfig requires both AP and STA (for firmware check)
1697+
*consumerTypes |= (1 << NETIF_WIFI_AP); // WebConfig requires both AP and STA (for firmware check)
16981698

16991699
// A good number of RTK products have only WiFi
17001700
// If WiFi STA has failed or we have no WiFi SSIDs, fall back to WiFi AP, but allow STA to keep hunting
17011701
if (networkIsPresent(NETWORK_ETHERNET) == false && networkIsPresent(NETWORK_CELLULAR) == false &&
17021702
settings.wifiConfigOverAP == false && (wifiGetStartTimeout() > 0 || wifiNetworkCount() == 0))
17031703
{
1704-
*consumerTypes |= (1 << NETCONSUMER_WIFI_AP); // Re-allow Webconfig over AP
1704+
*consumerTypes |= (1 << NETIF_WIFI_AP); // Re-allow Webconfig over AP
17051705
}
17061706
}
17071707

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,11 +752,11 @@ bool wifiStart()
752752
uint16_t consumerTypes = networkGetConsumerTypes();
753753

754754
// The consumers need station
755-
if (consumerTypes & (1 << NETCONSUMER_WIFI_STA))
755+
if (consumerTypes & (1 << NETIF_WIFI_STA))
756756
startWiFiStation = true;
757757

758758
// The consumers need AP
759-
if (consumerTypes & (1 << NETCONSUMER_WIFI_AP))
759+
if (consumerTypes & (1 << NETIF_WIFI_AP))
760760
startWiFiAp = true;
761761

762762
if (startWiFiStation == false && startWiFiAp == false)

Firmware/RTK_Everywhere/settings.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,15 +555,15 @@ const int numRegionalAreas = sizeof(Regional_Information_Table) / sizeof(Regiona
555555
//Bitfield for describing the type of network the consumer can use
556556
enum
557557
{
558-
NETCONSUMER_NONE = 0, // No consumers
559-
NETCONSUMER_WIFI_STA, // The consumer can use STA
560-
NETCONSUMER_WIFI_AP, // The consumer can use AP
561-
NETCONSUMER_CELLULAR, // The consumer can use Cellular
562-
NETCONSUMER_ETHERNET, // The consumer can use Ethernet
563-
NETCONSUMER_UNKNOWN
558+
NETIF_NONE = 0, // No consumers
559+
NETIF_WIFI_STA, // The consumer can use STA
560+
NETIF_WIFI_AP, // The consumer can use AP
561+
NETIF_CELLULAR, // The consumer can use Cellular
562+
NETIF_ETHERNET, // The consumer can use Ethernet
563+
NETIF_UNKNOWN
564564
};
565565

566-
#define NETWORK_EWC ((1 << NETCONSUMER_ETHERNET) | (1 << NETCONSUMER_WIFI_STA) | (1 << NETCONSUMER_CELLULAR))
566+
#define NETWORK_EWC ((1 << NETIF_ETHERNET) | (1 << NETIF_WIFI_STA) | (1 << NETIF_CELLULAR))
567567

568568
// This is all the settings that can be set on RTK Product. It's recorded to NVM and the config file.
569569
// Avoid reordering. The order of these variables is mimicked in NVM/record/parse/create/update/get

0 commit comments

Comments
 (0)