# Smart network selection This sample application demonstrates how to set dubious cells for LTE and NR networks and perform a smart network selection. 1. Get phone factory and network selection manager instances auto &phoneFactory = telux::tel::PhoneFactory::getInstance(); std::promise prom; auto networkMgr = phoneFactory.getNetworkSelectionManager(DEFAULT_SLOT_ID), [&](telux::common::ServiceStatus status) { prom.set_value(status); }); Copy to clipboard 2. Wait for the network selection subsystem initialization telux::common::ServiceStatus networkSelMgrStatus = prom.get_future().get(); Copy to clipboard 3. Exit the application if the network selection subsystem cannot be initialized if (networkSelMgrStatus == telux::common::ServiceStatus::SERVICE_AVAILABLE) { std::cout << "Network Selection Manager is ready " << "\n"; } else { std::cout << "ERROR - Unable to initialize," << " network selection manager subsystem " << std::endl; return 1; } Copy to clipboard 4. Set dubious cell for the LTE netowrk LteDubiousCellInfo params; DubiousCellInfo dbCellInfo; dbCellInfo.mcc = mcc; dbCellInfo.mnc = mnc; dbCellInfo.arfcn = arfcn; dbCellInfo.pci = pci; dbCellInfo.activeBand = activeBand; dbCellInfo.causeCodeMask = causeCodeMask; params.ciList.emplace_back(dbCellInfo); params.cgi = cgi; if(networkMgr) { ErrorCode err = networkMgr->setLteDubiousCell(params); std::cout << "ErrorCode: " << static_cast(err) <setNrDubiousCell(params); std::cout << "ErrorCode: " << static_cast(err) <