Skip to content

Commit

Permalink
ESP32: Fix to connect to wifi using shell command (#34080)
Browse files Browse the repository at this point in the history
- Fix an issue that 'matter wifi connect' doesn't work on ESP32
  by calling chip::Shell::SetWiFiDriver
  • Loading branch information
ready2die4u authored and pull[bot] committed Sep 3, 2024
1 parent e68b044 commit 357d179
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/platform/esp32/common/Esp32AppServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
#endif // CONFIG_BT_ENABLED
#endif // CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE

#ifdef CONFIG_ENABLE_CHIP_SHELL
#include <lib/shell/commands/WiFi.h>
#endif

#include <string.h>

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

#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
sWiFiNetworkCommissioningInstance.Init();
#ifdef CONFIG_ENABLE_CHIP_SHELL
chip::Shell::SetWiFiDriver(&(chip::DeviceLayer::NetworkCommissioning::ESPWiFiDriver::GetInstance()));
#endif
#endif
#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET
sEthernetNetworkCommissioningInstance.Init();
Expand Down

0 comments on commit 357d179

Please sign in to comment.