From 20d21e7b6e47d494cf24022af69a7f8312b0db65 Mon Sep 17 00:00:00 2001 From: Douglas Rocha Ferraz Date: Fri, 3 Mar 2023 01:19:26 -0300 Subject: [PATCH] [chef] linux wpa fix (#25438) * fix: Wi-Fi init on linux target for chef * chg: removed uncessary namespace scoping, restyle --- examples/chef/linux/main.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/examples/chef/linux/main.cpp b/examples/chef/linux/main.cpp index 35cc7a242afcbd..af41f8b6588a1d 100644 --- a/examples/chef/linux/main.cpp +++ b/examples/chef/linux/main.cpp @@ -20,7 +20,9 @@ #include #include +#include #include +#include #include @@ -28,8 +30,21 @@ using namespace chip; using namespace chip::Shell; +using namespace chip::app; -void ApplicationInit() {} +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +namespace { +DeviceLayer::NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver; +Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(0, &sLinuxWiFiDriver); +} // namespace +#endif + +void ApplicationInit() +{ +#if CHIP_DEVICE_CONFIG_ENABLE_WPA + sWiFiNetworkCommissioningInstance.Init(); +#endif +} int main(int argc, char * argv[]) {