Skip to content

Commit 76d43f2

Browse files
committed
Addressed review comments and documented the IPv4 disabled change
1 parent 3f85107 commit 76d43f2

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

config/esp32/components/chip/CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ chip_gn_arg_append("chip_config_network_layer_ble" "false")
118118
endif()
119119

120120
if(CONFIG_DISABLE_IPV4)
121-
chip_gn_arg_append("chip_inet_config_enable_ipv4" "false")
121+
if(NOT CONFIG_LWIP_IPV4)
122+
chip_gn_arg_append("chip_inet_config_enable_ipv4" "false")
123+
else()
124+
message(FATAL_ERROR "Disable both IPV4 options i.e CONFIG_DISABLE_IPV4=y and CONFIG_LWIP_IPV4=n")
125+
endif()
122126
endif()
123127

124128
if(CONFIG_DISABLE_READ_CLIENT)

docs/guides/esp32/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ example on ESP32 series of SoCs
1919
- [Generating and Using ESP Secure Cert Partition](secure_cert_partition.md)
2020
- [BLE Settings](ble_settings.md)
2121
- [Providers](providers.md)
22+
- [Configuration Options](config_options.md)

docs/guides/esp32/config_options.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Configuration options
2+
3+
This file lists down few config options to be enabled in through menuconfig for
4+
specific scenarios.
5+
6+
### Building with IPV4 Disabled
7+
8+
Enable the options below through `idf.py menuconfig` and build the app.
9+
10+
```
11+
CONFIG_DISABLE_IPV4=y
12+
CONFIG_LWIP_IPV4=n
13+
```

src/platform/ESP32/BUILD.gn

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

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

17+
import("${chip_root}/src/inet/inet.gni")
1718
import("${chip_root}/src/platform/device.gni")
1819

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

3738
defines = [
3839
"CHIP_CONFIG_SOFTWARE_VERSION_NUMBER=${chip_config_software_version_number}",
40+
"CHIP_DEVICE_CONFIG_ENABLE_IPV4=${chip_inet_config_enable_ipv4}",
3941
]
4042

4143
static_library("ESP32") {

src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,8 @@ void ConnectivityManagerImpl::UpdateInternetConnectivityState(void)
999999
// If the station interface has been assigned an IPv4 address, and has
10001000
// an IPv4 gateway, then presume that the device has IPv4 Internet
10011001
// connectivity.
1002-
#if LWIP_IPV4
1002+
1003+
#if CHIP_DEVICE_CONFIG_ENABLE_IPV4
10031004
if (!ip4_addr_isany_val(*netif_ip4_addr(netif)) && !ip4_addr_isany_val(*netif_ip4_gw(netif)))
10041005
{
10051006
haveIPv4Conn = true;

0 commit comments

Comments
 (0)