# 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 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<int>(err) <<std::endl;
       }
    }
    Copy to clipboard

5. Set dubious cell for the NR netowrk

NrDubiousCellInfo 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;
    params.spacing = spacing;
    
    if(networkMgr) {
       ErrorCode err = networkMgr->setNrDubiousCell(params);
       std::cout << "ErrorCode: " << static_cast<int>(err) <<std::endl;
       }
    }
    Copy to clipboard

Last Published: May 20, 2026

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