Skip to content

Commit a32a1cc

Browse files
committed
feat(net): Show DHCPC status as OFF when static IP is used
1 parent 81f8467 commit a32a1cc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: libraries/Network/src/NetworkInterface.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,12 @@ size_t NetworkInterface::printTo(Print & out) const {
759759

760760
bytes += out.print(" (");
761761
esp_netif_flags_t flags = esp_netif_get_flags(_esp_netif);
762-
if(flags & ESP_NETIF_DHCP_CLIENT) bytes += out.print("DHCPC");
762+
if(flags & ESP_NETIF_DHCP_CLIENT){
763+
bytes += out.print("DHCPC");
764+
if(getStatusBits() & ESP_NETIF_HAS_STATIC_IP_BIT){
765+
bytes += out.print("_OFF");
766+
}
767+
}
763768
if(flags & ESP_NETIF_DHCP_SERVER) bytes += out.print("DHCPS");
764769
if(flags & ESP_NETIF_FLAG_AUTOUP) bytes += out.print(",AUTOUP");
765770
if(flags & ESP_NETIF_FLAG_GARP) bytes += out.print(",GARP");

0 commit comments

Comments
 (0)