From bcaf399eb43e52b0b0529f624eef161dff5078ef Mon Sep 17 00:00:00 2001 From: Doug Ferraz Date: Thu, 2 Mar 2023 14:36:41 +0000 Subject: [PATCH 1/2] fix: Wi-Fi init on linux target for chef --- examples/chef/linux/main.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/examples/chef/linux/main.cpp b/examples/chef/linux/main.cpp index 35cc7a242afcbd..acf10570d30c0b 100644 --- a/examples/chef/linux/main.cpp +++ b/examples/chef/linux/main.cpp @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include @@ -28,8 +30,22 @@ using namespace chip; using namespace chip::Shell; +using namespace chip::app; +using namespace chip::app::Clusters; -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[]) { From e0b3a303c424d925f04d1ef02f1c143c289f5383 Mon Sep 17 00:00:00 2001 From: Doug Ferraz Date: Thu, 2 Mar 2023 15:31:52 +0000 Subject: [PATCH 2/2] chg: removed uncessary namespace scoping, restyle --- examples/chef/linux/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/chef/linux/main.cpp b/examples/chef/linux/main.cpp index acf10570d30c0b..af41f8b6588a1d 100644 --- a/examples/chef/linux/main.cpp +++ b/examples/chef/linux/main.cpp @@ -20,8 +20,8 @@ #include #include -#include #include +#include #include #include @@ -31,7 +31,6 @@ using namespace chip; using namespace chip::Shell; using namespace chip::app; -using namespace chip::app::Clusters; #if CHIP_DEVICE_CONFIG_ENABLE_WPA namespace {