# How to configure and enable WLAN The following steps illustrate how to configure WLAN. 1. Create the IWlanListener class. class NotificationListener: public telux::wlan::IWlanListener { public: void onEnableChanged(bool enable) { promise_.set_value(enable); } bool getEnableStatus() { return promise_.get_future().get(); } void resetPromise() { promise_ = std::promise(); } private: std::promise promise_; }; Copy to clipboard 2. Create the initialization callback object to be notified when initialization is complete and the object is ready to be used. auto initCb = [&](telux::common::ServiceStatus status) { initPromise.set_value(status); }; Copy to clipboard 3. Get the WlanFactory and WlanDeviceManager instances. auto &wlanFactory = telux::wlan::WlanFactory::getInstance(); wlanDevMgr = wlanFactory.getWlanDeviceManager(initCb); Copy to clipboard 4. Wait for the object to complete initialization. telux::common::ServiceStatus = subSystemStatus = initPromise.get_future().get(); if (subSystemStatus == telux::common::ServiceStatus::SERVICE_AVAILABLE) { std::cout << " *** Wlan SubSystem is Ready *** " << std::endl; } else { std::cout << " *** Unable to initialize Wlan subsystem *** " << std::endl; } Copy to clipboard 5. If WLAN is enabled, disable it. bool enableStat = false; std::vector ifStatus; if(telux::common::ErrorCode::SUCCESS != wlanDevMgr->getStatus(enableStat, ifStatus)) { std::cout << "Failed to retrieve Wlan status" <registerListener(listener); //Ensure callback returns SUCCESS and indication for Wlan disablement is received if((telux::common::ErrorCode::SUCCESS != wlanDevMgr->enable(false)) || (true == listener->getEnableStatus())) { std::cout << "Failed to disable Wlan " <setMode(numAp, numSta)) { std::cout << "Failed to set Wlan configuration" <resetPromise(); //Ensure callback returns SUCCESS and indication for Wlan enablement is received if((telux::common::ErrorCode::SUCCESS != wlanDevMgr->enable(true)) || (false == listener->getEnableStatus())) { std::cout << "Failed to enable Wlan " <