Skip to content

Commit 7902dd2

Browse files
committed
Network: Rename *ConsumerCount to *ConsumerCountBits, add *ConsumerCount
1 parent 2382129 commit 7902dd2

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,10 +501,18 @@ NETCONSUMER_MASK_t networkConsumerBits(NetIndex_t index)
501501
return networkConsumersAny | netIfConsumers[index];
502502
}
503503

504+
//----------------------------------------
505+
// Count the number of network consumers
506+
//----------------------------------------
507+
int networkConsumerCount(NetIndex_t index)
508+
{
509+
return networkConsumerCountBits(networkConsumerBits(index));
510+
}
511+
504512
//----------------------------------------
505513
// Count the network consumer bits
506514
//----------------------------------------
507-
int networkConsumerCount(NETCONSUMER_MASK_t bits)
515+
int networkConsumerCountBits(NETCONSUMER_MASK_t bits)
508516
{
509517
int bitCount;
510518
NETCONSUMER_MASK_t bitMask;
@@ -543,7 +551,7 @@ void networkConsumerDisplay()
543551
bits |= netIfConsumers[index];
544552
users = netIfUsers[index];
545553
}
546-
systemPrintf("Network Consumers: %d", networkConsumerCount(bits));
554+
systemPrintf("Network Consumers: %d", networkConsumerCountBits(bits));
547555
networkConsumerPrint(bits, users, ", ");
548556
systemPrintln();
549557

@@ -2025,7 +2033,7 @@ NETCONSUMER_MASK_t networkSoftApConsumerBits()
20252033
//----------------------------------------
20262034
void networkSoftApConsumerDisplay()
20272035
{
2028-
systemPrintf("WiFi Soft AP Consumers: %d", networkConsumerCount(networkSoftApConsumer));
2036+
systemPrintf("WiFi Soft AP Consumers: %d", networkConsumerCountBits(networkSoftApConsumer));
20292037
networkConsumerPrint(networkSoftApConsumer, 0, ", ");
20302038
systemPrintln();
20312039
}
@@ -2465,7 +2473,7 @@ void networkUserDisplay(NetIndex_t index)
24652473

24662474
// Determine if there are any users
24672475
bits = netIfUsers[index];
2468-
systemPrintf("%s Users: %d", networkInterfaceTable[index].name, networkConsumerCount(bits));
2476+
systemPrintf("%s Users: %d", networkInterfaceTable[index].name, networkConsumerCountBits(bits));
24692477
networkConsumerPrint(bits, 0, ", ");
24702478
systemPrintln();
24712479
}

0 commit comments

Comments
 (0)