Skip to content

Commit

Permalink
ESP: Add support on all-clusters-app and lighting-app for ESP32-C6 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 authored and pull[bot] committed Sep 5, 2023
1 parent 42e613d commit 3f4c723
Show file tree
Hide file tree
Showing 12 changed files with 180 additions and 27 deletions.
14 changes: 9 additions & 5 deletions config/esp32/components/chip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ if (CONFIG_ENABLE_CHIP_SHELL)
chip_gn_arg_append("chip_build_libshell" "true")
endif()

if (CONFIG_IDF_TARGET_ESP32H2)
if (CONFIG_ENABLE_WIFI_STATION OR CONFIG_ENABLE_WIFI_AP)
chip_gn_arg_append("chip_enable_wifi" "true")
else()
chip_gn_arg_append("chip_enable_wifi" "false")
endif()

Expand Down Expand Up @@ -286,20 +288,22 @@ target_include_directories(${COMPONENT_LIB} INTERFACE
idf_component_get_property(esp32_mbedtls_lib esp32_mbedtls COMPONENT_LIB)

if(CONFIG_BT_ENABLED)
idf_component_get_property(bt_lib bt COMPONENT_LIB)
if("${CONFIG_IDF_TARGET}" STREQUAL "esp32h2")
idf_component_get_property(bt_lib bt COMPONENT_LIB)
idf_component_get_property(bt_dir bt COMPONENT_DIR)
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}>)
if(CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2)
list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/beta2/libble_app.a)
endif()
elseif("${CONFIG_IDF_TARGET}" STREQUAL "esp32c2")
idf_component_get_property(bt_lib bt COMPONENT_LIB)
idf_component_get_property(bt_dir bt COMPONENT_DIR)
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}>)
list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32c2/esp32c2-bt-lib/libble_app.a)
elseif("${CONFIG_IDF_TARGET}" STREQUAL "esp32c6")
idf_component_get_property(bt_dir bt COMPONENT_DIR)
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}>)
list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32c6/esp32c6-bt-lib/libble_app.a)
else()
idf_component_get_property(bt_lib bt COMPONENT_LIB)
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}> -lbtdm_app)
endif()
endif()
Expand All @@ -314,7 +318,7 @@ if(CONFIG_OPENTHREAD_ENABLED)
list(APPEND chip_libraries $<TARGET_FILE:${openthread_lib}>)
endif()

if((NOT CONFIG_USE_MINIMAL_MDNS) AND (NOT CONFIG_IDF_TARGET_ESP32H2))
if((NOT CONFIG_USE_MINIMAL_MDNS) AND (CONFIG_ENABLE_WIFI_STATION OR CONFIG_ENABLE_WIFI_AP))
idf_build_get_property(build_components BUILD_COMPONENTS)
# For IDF v5.x, the mdns component was moved to idf_managed_components.
# We should use 'espressif__mdns' for 'idf_component_get_property'.
Expand Down
10 changes: 10 additions & 0 deletions docs/guides/esp32/setup_idf_chip.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ step.
$ ./install.sh
```
- For ESP32C6, please use commit
[afbdb0f3e](https://github.com/espressif/esp-idf/tree/afbdb0f3e).
```
$ cd esp-idf
$ git checkout afbdb0f3e
$ git submodule update --init
$ ./install.sh
```
## Setup Matter environment
### Install Prerequisites
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-secur
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=maybe-uninitialized" APPEND)

idf_build_set_property(COMPILE_OPTIONS "-Wno-error=array-bounds" APPEND)

flashing_script()

if (CONFIG_ENABLE_PW_RPC)
Expand Down
14 changes: 7 additions & 7 deletions examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set(PRIV_INCLUDE_DIRS_LIST
"${CMAKE_CURRENT_LIST_DIR}/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/nlfaultinjection/repo/include"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/third_party/nlfaultinjection/repo/include"
)
set(SRC_DIRS_LIST
"${CMAKE_CURRENT_LIST_DIR}"
Expand All @@ -40,9 +40,9 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/test-cluster-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fault-injection-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fan-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fan-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server"
Expand All @@ -67,7 +67,7 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/target-navigator-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-user-interface-configuration-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/channel-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server"
Expand All @@ -83,8 +83,8 @@ set(SRC_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wake-on-lan-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wake-on-lan-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server"
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server"
Expand All @@ -108,7 +108,7 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}"
)
endif (CONFIG_ENABLE_PW_RPC)

if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C2_DEVKITM}" STREQUAL "y"))
if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C2_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC}" STREQUAL "y"))
list(APPEND PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include")
set(PRIV_REQUIRES_LIST chip QRCode bt)
Expand Down
14 changes: 9 additions & 5 deletions examples/all-clusters-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ menu "Demo"
default DEVICE_TYPE_ESP32_DEVKITC if IDF_TARGET_ESP32
default DEVICE_TYPE_ESP32_C3_DEVKITM if IDF_TARGET_ESP32C3
default DEVICE_TYPE_ESP32_C2_DEVKITM if IDF_TARGET_ESP32C2
default DEVICE_TYPE_ESP32_C6_DEVKITC if IDF_TARGET_ESP32C6
help
Specifies the type of ESP32 device.

Expand All @@ -50,6 +51,9 @@ menu "Demo"
config DEVICE_TYPE_ESP32_C2_DEVKITM
bool "ESP32C2-DevKitM"
depends on IDF_TARGET_ESP32C2
config DEVICE_TYPE_ESP32_C6_DEVKITC
bool "ESP32C6-DevKitC"
depends on IDF_TARGET_ESP32C6
endchoice

choice
Expand Down Expand Up @@ -81,7 +85,7 @@ menu "Demo"
int
range 0 5
default 0 if DEVICE_TYPE_ESP32_DEVKITC
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM || DEVICE_TYPE_ESP32_C6_DEVKITC
default 3 if DEVICE_TYPE_M5STACK
default 4 if DEVICE_TYPE_ESP32_WROVER_KIT

Expand All @@ -102,12 +106,12 @@ menu "Demo"
To reduce wear and heat the M5Stack's Display is automatically switched off after a few seconds

config STATUS_LED_GPIO_NUM
int
int
range 0 40
default 2 if DEVICE_TYPE_ESP32_DEVKITC #Use LED1 (blue LED) as status LED on DevKitC
default 2 if DEVICE_TYPE_ESP32_DEVKITC #Use LED1 (blue LED) as status LED on DevKitC
default 2 if DEVICE_TYPE_ESP32_ETHERNET_KIT
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
default 26 if DEVICE_TYPE_ESP32_WROVER_KIT
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM || DEVICE_TYPE_ESP32_C6_DEVKITC
default 26 if DEVICE_TYPE_ESP32_WROVER_KIT
default 40 if DEVICE_TYPE_M5STACK
help
Each board has a status led, define its pin number.
Expand Down
10 changes: 5 additions & 5 deletions examples/all-clusters-app/esp32/main/LEDWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "esp_log.h"
#include "esp_system.h"
#include "esp_timer.h"
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM || CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC
#include "driver/rmt.h"
#include "led_strip.h"
#define RMT_TX_DEFAULT_GPIO GPIO_NUM_8
Expand All @@ -51,7 +51,7 @@ void LEDWidget::Init(gpio_num_t gpioNum)
mState = false;
mError = false;
errorTimer = NULL;
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM || CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC
if (gpioNum == RMT_TX_DEFAULT_GPIO)
{
rmt_config_t config = RMT_DEFAULT_CONFIG_TX(RMT_TX_DEFAULT_GPIO, RMT_TX_DEFAULT_CHANNEL);
Expand Down Expand Up @@ -98,7 +98,7 @@ void LEDWidget::Set(bool state)

void LEDWidget::SetBrightness(uint8_t brightness)
{
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM || CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC
if (strip)
{
uint8_t red, green, blue;
Expand Down Expand Up @@ -186,7 +186,7 @@ void LEDWidget::DoSet(bool state)
{
bool stateChange = (mState != state);
mState = state;
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM || CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC
if (strip)
{
uint8_t red, green, blue;
Expand Down Expand Up @@ -229,7 +229,7 @@ void LEDWidget::SetVLED(int id1, int id2)
}
#endif

#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM || CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC
void LEDWidget::SetColor(uint8_t Hue, uint8_t Saturation)
{
uint8_t red, green, blue;
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/esp32/main/include/LEDWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class LEDWidget
void BlinkOnError();

void Animate();
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM || CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC
void SetColor(uint8_t Hue, uint8_t Saturation);

void HSB2rgb(uint16_t Hue, uint8_t Saturation, uint8_t brightness, uint8_t & red, uint8_t & green, uint8_t & blue);
Expand All @@ -61,7 +61,7 @@ class LEDWidget
uint32_t mBlinkOnTimeMS;
uint32_t mBlinkOffTimeMS;
uint8_t mDefaultOnBrightness;
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM || CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC
uint16_t mHue; // mHue [0, 360]
uint8_t mSaturation; // mSaturation [0, 100]
#endif
Expand Down
64 changes: 64 additions & 0 deletions examples/all-clusters-app/esp32/sdkconfig.defaults.esp32c6
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
CONFIG_IDF_TARGET="esp32c6"

# Default to 921600 baud when flashing and monitoring device
CONFIG_ESPTOOLPY_BAUD_921600B=y
CONFIG_ESPTOOLPY_BAUD=921600
CONFIG_ESPTOOLPY_COMPRESSED=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y
CONFIG_ESPTOOLPY_MONITOR_BAUD=115200

# libsodium
CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y


# NIMBLE
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_NIMBLE_EXT_ADV=n
CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70
CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n

# Disable OpenThread
CONFIG_OPENTHREAD_ENABLED=n

# Disable lwip ipv6 autoconfig
CONFIG_LWIP_IPV6_AUTOCONFIG=n

# Use a custom partition table
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"

# LwIP config for OpenThread
CONFIG_LWIP_IPV6_NUM_ADDRESSES=8
CONFIG_LWIP_MULTICAST_PING=y

# mbedTLS
CONFIG_MBEDTLS_HARDWARE_AES=n
CONFIG_MBEDTLS_HARDWARE_MPI=n
CONFIG_MBEDTLS_HARDWARE_SHA=n
CONFIG_MBEDTLS_HARDWARE_ECC=y
CONFIG_MBEDTLS_CMAC_C=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=y
CONFIG_MBEDTLS_ECJPAKE_C=y

# MDNS platform
CONFIG_USE_MINIMAL_MDNS=y
CONFIG_ENABLE_EXTENDED_DISCOVERY=y

# FreeRTOS should use legacy API
CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y

# Wi-Fi Settings
CONFIG_ENABLE_WIFI_STATION=y
CONFIG_ENABLE_WIFI_AP=n
# Enable this to avoid implicit declaration of function 'esp_send_assoc_resp'
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y

# Enable OTA Requestor
CONFIG_ENABLE_OTA_REQUESTOR=y

# Enable chip shell
CONFIG_ENABLE_CHIP_SHELL=y
2 changes: 2 additions & 0 deletions examples/lighting-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ idf_build_set_property(COMPILE_OPTIONS "-Wno-error=maybe-uninitialized" APPEND)

#For the H2, -Werror=uninitialized will cause an error in "src/lib/support/LambdaBridge.h"
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=uninitialized" APPEND)
#For ESP32-C6, -Werror=array-bounds will cause an error in 'third_party/nlfaultinjection/repo/src/nlfaultinjection.cpp'
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=array-bounds" APPEND)

flashing_script()

Expand Down
64 changes: 64 additions & 0 deletions examples/lighting-app/esp32/sdkconfig.defaults.esp32c6
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
CONFIG_IDF_TARGET="esp32c6"

# Default to 921600 baud when flashing and monitoring device
CONFIG_ESPTOOLPY_BAUD_921600B=y
CONFIG_ESPTOOLPY_BAUD=921600
CONFIG_ESPTOOLPY_COMPRESSED=y
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y
CONFIG_ESPTOOLPY_MONITOR_BAUD=115200

# libsodium
CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y


# NIMBLE
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y
CONFIG_BT_NIMBLE_EXT_ADV=n
CONFIG_BT_NIMBLE_HCI_EVT_BUF_SIZE=70
CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING=n

# Disable OpenThread
CONFIG_OPENTHREAD_ENABLED=n

# Disable lwip ipv6 autoconfig
CONFIG_LWIP_IPV6_AUTOCONFIG=n

# Use a custom partition table
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"

# LwIP config for OpenThread
CONFIG_LWIP_IPV6_NUM_ADDRESSES=8
CONFIG_LWIP_MULTICAST_PING=y

# mbedTLS
CONFIG_MBEDTLS_HARDWARE_AES=n
CONFIG_MBEDTLS_HARDWARE_MPI=n
CONFIG_MBEDTLS_HARDWARE_SHA=n
CONFIG_MBEDTLS_HARDWARE_ECC=y
CONFIG_MBEDTLS_CMAC_C=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECJPAKE=y
CONFIG_MBEDTLS_ECJPAKE_C=y

# MDNS platform
CONFIG_USE_MINIMAL_MDNS=y
CONFIG_ENABLE_EXTENDED_DISCOVERY=y

# FreeRTOS should use legacy API
CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY=y

# Wi-Fi Settings
CONFIG_ENABLE_WIFI_STATION=y
CONFIG_ENABLE_WIFI_AP=n
# Enable this to avoid implicit declaration of function 'esp_send_assoc_resp'
CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y

# Enable OTA Requestor
CONFIG_ENABLE_OTA_REQUESTOR=y

# Enable chip shell
CONFIG_ENABLE_CHIP_SHELL=y
2 changes: 1 addition & 1 deletion src/platform/ESP32/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager,
void UpdateInternetConnectivityState(void);
void OnStationIPv4AddressAvailable(const ip_event_got_ip_t & got_ip);
void OnStationIPv4AddressLost(void);
void OnIPv6AddressAvailable(const ip_event_got_ip6_t & got_ip);
void OnStationIPv6AddressAvailable(const ip_event_got_ip6_t & got_ip);
#endif // CHIP_DEVICE_CONFIG_ENABLE_WIFI

// ===== Members for internal use by the following friends.
Expand Down
7 changes: 5 additions & 2 deletions src/platform/ESP32/ConnectivityManagerImpl_WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,10 @@ void ConnectivityManagerImpl::OnWiFiPlatformEvent(const ChipDeviceEvent * event)
break;
case IP_EVENT_GOT_IP6:
ChipLogProgress(DeviceLayer, "IP_EVENT_GOT_IP6");
OnIPv6AddressAvailable(event->Platform.ESPSystemEvent.Data.IpGotIp6);
if (strcmp(esp_netif_get_ifkey(event->Platform.ESPSystemEvent.Data.IpGotIp6.esp_netif), "WIFI_STA_DEF") == 0)
{
OnStationIPv6AddressAvailable(event->Platform.ESPSystemEvent.Data.IpGotIp6);
}
break;
default:
break;
Expand Down Expand Up @@ -1080,7 +1083,7 @@ void ConnectivityManagerImpl::OnStationIPv4AddressLost(void)
PlatformMgr().PostEventOrDie(&event);
}

void ConnectivityManagerImpl::OnIPv6AddressAvailable(const ip_event_got_ip6_t & got_ip)
void ConnectivityManagerImpl::OnStationIPv6AddressAvailable(const ip_event_got_ip6_t & got_ip)
{
#if CHIP_PROGRESS_LOGGING
{
Expand Down

0 comments on commit 3f4c723

Please sign in to comment.