[network] Use C++17 nested namespace syntax (#14248)

This commit is contained in:
J. Nick Koston
2026-02-24 02:00:21 +00:00
committed by GitHub
parent 7d9d90d3f8
commit ad2da0af52
3 changed files with 6 additions and 12 deletions
+2 -4
View File
@@ -37,8 +37,7 @@ using ip4_addr_t = in_addr;
#include <esp_netif.h>
#endif
namespace esphome {
namespace network {
namespace esphome::network {
/// Buffer size for IP address string (IPv6 max: 39 chars + null)
static constexpr size_t IP_ADDRESS_BUFFER_SIZE = 40;
@@ -187,6 +186,5 @@ struct IPAddress {
using IPAddresses = std::array<IPAddress, 5>;
} // namespace network
} // namespace esphome
} // namespace esphome::network
#endif
+2 -4
View File
@@ -17,8 +17,7 @@
#include "esphome/components/modem/modem_component.h"
#endif
namespace esphome {
namespace network {
namespace esphome::network {
// The order of the components is important: WiFi should come after any possible main interfaces (it may be used as
// an AP that use a previous interface for NAT).
@@ -109,6 +108,5 @@ const char *get_use_address() {
#endif
}
} // namespace network
} // namespace esphome
} // namespace esphome::network
#endif
+2 -4
View File
@@ -4,8 +4,7 @@
#include <string>
#include "ip_address.h"
namespace esphome {
namespace network {
namespace esphome::network {
/// Return whether the node is connected to the network (through wifi, eth, ...)
bool is_connected();
@@ -15,6 +14,5 @@ bool is_disabled();
const char *get_use_address();
IPAddresses get_ip_addresses();
} // namespace network
} // namespace esphome
} // namespace esphome::network
#endif