diff --git a/examples/lighting-app/linux/main.cpp b/examples/lighting-app/linux/main.cpp index d3a07fb97445f2..74816f1c7106c7 100644 --- a/examples/lighting-app/linux/main.cpp +++ b/examples/lighting-app/linux/main.cpp @@ -22,15 +22,25 @@ #include #include #include +#include #include +#include #if defined(PW_RPC_ENABLED) #include "Rpc.h" #endif // PW_RPC_ENABLED using namespace chip; +using namespace chip::app; using namespace chip::app::Clusters; +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +namespace { +DeviceLayer::NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver; +Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(0, &sLinuxWiFiDriver); +} // namespace +#endif + void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & attributePath, uint8_t mask, uint8_t type, uint16_t size, uint8_t * value) { @@ -60,7 +70,12 @@ void emberAfOnOffClusterInitCallback(EndpointId endpoint) // TODO: implement any additional Cluster Server init actions } -void ApplicationInit() {} +void ApplicationInit() +{ +#if CHIP_DEVICE_CONFIG_ENABLE_WPA + sWiFiNetworkCommissioningInstance.Init(); +#endif +} int main(int argc, char * argv[]) { diff --git a/examples/thermostat/linux/main.cpp b/examples/thermostat/linux/main.cpp index 68598a48ad8c47..e5d92f58448819 100644 --- a/examples/thermostat/linux/main.cpp +++ b/examples/thermostat/linux/main.cpp @@ -21,12 +21,21 @@ #include #include #include +#include #include +#include using namespace chip; using namespace chip::app; // using namespace chip::app::Clusters; +#if CHIP_DEVICE_CONFIG_ENABLE_WPA +namespace { +DeviceLayer::NetworkCommissioning::LinuxWiFiDriver sLinuxWiFiDriver; +Clusters::NetworkCommissioning::Instance sWiFiNetworkCommissioningInstance(0, &sLinuxWiFiDriver); +} // namespace +#endif + bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::CommandHandler * commandObj) { emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS); @@ -87,7 +96,12 @@ static Identify gIdentify1 = { chip::EndpointId{ 1 }, OnIdentifyStart, OnIdentifyStop, EMBER_ZCL_IDENTIFY_IDENTIFY_TYPE_VISIBLE_LED, OnTriggerEffect, }; -void ApplicationInit() {} +void ApplicationInit() +{ +#if CHIP_DEVICE_CONFIG_ENABLE_WPA + sWiFiNetworkCommissioningInstance.Init(); +#endif +} int main(int argc, char * argv[]) {