Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ESP32] Compilation fix when IPV4 is disabled. #33085

Merged
merged 5 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ chip_gn_arg_append("chip_config_network_layer_ble" "false")
endif()

if(CONFIG_DISABLE_IPV4)
chip_gn_arg_append("chip_inet_config_enable_ipv4" "false")
if(NOT CONFIG_LWIP_IPV4)
chip_gn_arg_append("chip_inet_config_enable_ipv4" "false")
else()
message(FATAL_ERROR "Please also disable config option CONFIG_LWIP_IPV4")
endif()
endif()

if(CONFIG_DISABLE_READ_CLIENT)
Expand Down
1 change: 1 addition & 0 deletions docs/guides/esp32/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ example on ESP32 series of SoCs
- [Generating and Using ESP Secure Cert Partition](secure_cert_partition.md)
- [BLE Settings](ble_settings.md)
- [Providers](providers.md)
- [Configuration Options](config_options.md)
13 changes: 13 additions & 0 deletions docs/guides/esp32/config_options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Configuration options

This file lists down few config options to be enabled in through menuconfig for
specific scenarios.

### Building with IPV4 Disabled

Enable the options below through `idf.py menuconfig` and build the app.

```
CONFIG_DISABLE_IPV4=y
CONFIG_LWIP_IPV4=n
```
2 changes: 2 additions & 0 deletions src/platform/ESP32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import("//build_overrides/chip.gni")

import("${chip_root}/src/inet/inet.gni")
import("${chip_root}/src/platform/device.gni")

assert(chip_device_platform == "esp32")
Expand All @@ -36,6 +37,7 @@ declare_args() {

defines = [
"CHIP_CONFIG_SOFTWARE_VERSION_NUMBER=${chip_config_software_version_number}",
"CHIP_DEVICE_CONFIG_ENABLE_IPV4=${chip_inet_config_enable_ipv4}",
]

static_library("ESP32") {
Expand Down
2 changes: 2 additions & 0 deletions src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ void ConnectivityManagerImpl::UpdateInternetConnectivityState(void)
// If the station interface has been assigned an IPv4 address, and has
// an IPv4 gateway, then presume that the device has IPv4 Internet
// connectivity.
#if CHIP_DEVICE_CONFIG_ENABLE_IPV4
if (!ip4_addr_isany_val(*netif_ip4_addr(netif)) && !ip4_addr_isany_val(*netif_ip4_gw(netif)))
{
haveIPv4Conn = true;
Expand All @@ -1013,6 +1014,7 @@ void ConnectivityManagerImpl::UpdateInternetConnectivityState(void)
IPAddress::FromString(addrStr, addr);
}
}
#endif

// Search among the IPv6 addresses assigned to the interface for a Global Unicast
// address (2000::/3) that is in the valid state. If such an address is found...
Expand Down
Loading