# Request network selection mode

This sample application demonstrates how to request current network selection mode.

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 network selection subsystem can not be initialzed

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. Implement response callback to receive response for request network selection mode

class SelectionModeResponseCallback {
    public:
       void selectionModeResponse(
          telux::tel::NetworkModeInfo info,
          telux::common::ErrorCode errorCode) {
          if(errorCode == telux::common::ErrorCode::SUCCESS) {
             std::cout << "Network selection mode: "
                       << static_cast<int>(info.mode)
                       << std::endl;
             if (networkSelectionMode == NetworkSelectionMode::MANUAL) {
                 std::cout << "MCC is: " << info.mcc << ", MNC is: " << info.mnc << std::endl;
             }
          } else {
             std::cout << "\n requestNetworkSelectionMode failed, ErrorCode: "
                       << static_cast<int>(errorCode)
                       << std::endl;
          }
       }
    };
    Copy to clipboard

5. Send requestNetworkSelectionMode along with response callback

if(networkMgr) {
       auto status = networkMgr->requestNetworkSelectionMode(
          SelectionModeResponseCallback::selectionModeResponse);
       std::cout << static_cast<int>(status) <<std::endl;
       }
    }
    Copy to clipboard

Now, selectionModeResponse() callback gets invoked with current network selection mode information.

Last Published: Mar 31, 2026

[Previous Topic
Using SAP APIs](https://docs.qualcomm.com/bundle/publicresource/80-PF458-9/topics/sap_api_and_listener.md) [Next Topic
Smart network selection](https://docs.qualcomm.com/bundle/publicresource/80-PF458-9/topics/smart_network_selection.md)