Skip to content

Commit

Permalink
Addressed review comments and documented the IPv4 disabled change
Browse files Browse the repository at this point in the history
  • Loading branch information
shripad621git committed Jun 21, 2024
1 parent 3f85107 commit c0c62a2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
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 "Disable both IPV4 options i.e CONFIG_DISABLE_IPV4=y and CONFIG_LWIP_IPV4=n")
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: 1 addition & 1 deletion src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +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 LWIP_IPV4
#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 Down

0 comments on commit c0c62a2

Please sign in to comment.