# 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<telux::common::ServiceStatus> 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 list for the LTE netowrk

std::vector<telux::tel::LteDubiousCell> params;
    telux::tel::LteDubiousCell lteDbCellInfo;
    lteDbCellInfo.ci.mcc = mcc;
    lteDbCellInfo.ci.mnc = mnc;
    lteDbCellInfo.ci.arfcn = arfcn;
    lteDbCellInfo.ci.pci = pci;
    lteDbCellInfo.ci.activeBand = activeBand;
    lteDbCellInfo.ci.causeCodeMask = causeCodeMask;
    lteDbCellInfo.cgi = cgi;
    params.push_back(lteDbCellInfo);
    
    if(networkMgr) {
       ErrorCode err = networkMgr->setLteDubiousCell(params);
       std::cout << "ErrorCode: " << static_cast<int>(err) <<std::endl;
       }
    }
    Copy to clipboard

5. Set dubious cell list for the NR netowrk

std::vector<telux::tel::NrDubiousCell> params;
    telux::tel::NrDubiousCell nrDbCellInfo;
    nrDbCellInfo.ci.mcc = mcc;
    nrDbCellInfo.ci.dbCellInfo.mnc = mnc;
    nrDbCellInfo.ci.dbCellInfo.arfcn = arfcn;
    nrDbCellInfo.ci.dbCellInfo.pci = pci;
    nrDbCellInfo.ci.dbCellInfo.activeBand = activeBand;
    nrDbCellInfo.ci.dbCellInfo.causeCodeMask = causeCodeMask;
    nrDbCellInfo.cgi = cgi;
    nrDbCellInfo.spacing = spacing;
    params.push_back(nrDbCellInfo);
    
    if(networkMgr) {
       ErrorCode err = networkMgr->setNrDubiousCell(params);
       std::cout << "ErrorCode: " << static_cast<int>(err) <<std::endl;
       }
    }
    Copy to clipboard

Last Published: Mar 31, 2026

[Previous Topic
Request network selection mode](https://docs.qualcomm.com/bundle/publicresource/80-PF458-9/topics/network_selection.md) [Next Topic
Using remote SIM manager APIs](https://docs.qualcomm.com/bundle/publicresource/80-PF458-9/topics/remote_sim_api.md)