Skip to content

Commit f57b791

Browse files
authored
ESP32: Fix to connect to wifi using shell command (#34080)
- Fix an issue that 'matter wifi connect' doesn't work on ESP32 by calling chip::Shell::SetWiFiDriver
1 parent eaac08e commit f57b791

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/platform/esp32/common/Esp32AppServer.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
#endif // CONFIG_BT_ENABLED
3939
#endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE
4040

41+
#ifdef CONFIG_ENABLE_CHIP_SHELL
42+
#include <lib/shell/commands/WiFi.h>
43+
#endif
44+
4145
#include <string.h>
4246

4347
using namespace chip;
@@ -147,6 +151,9 @@ void Esp32AppServer::Init(AppDelegate * sAppDelegate)
147151

148152
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
149153
sWiFiNetworkCommissioningInstance.Init();
154+
#ifdef CONFIG_ENABLE_CHIP_SHELL
155+
chip::Shell::SetWiFiDriver(&(chip::DeviceLayer::NetworkCommissioning::ESPWiFiDriver::GetInstance()));
156+
#endif
150157
#endif
151158
#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET
152159
sEthernetNetworkCommissioningInstance.Init();

0 commit comments

Comments
 (0)