# Get available modem profiles

This sample application demonstrates how to request list of available modem profiles.

1. Implement initialization callback and get the DataFactory instance

Optionally initialization callback can be provided with get manager instance.
Data factory will call callback when manager initialization is complete.

auto initCb = [&](telux::common::ServiceStatus status) {
       std::lock_guard<std::mutex> lock(mtx);
       status_ = status;
       initCv.notify_all();
    };
    auto &dataFactory = DataFactory::getInstance();
    Copy to clipboard

2. Get DataProfileManager instances

std::unique_lock<std::mutex> lck(mtx);
    auto dataProfileMgr = dataFactory.getDataProfileManager(slotId, initCb);
    Copy to clipboard

3. Wait for DataProfileManager initialization to be complete

initCv.wait(lck);
    Copy to clipboard

3.1 Check DataProfileManager initialization state

If DataProfileManager initialization failed, new initialization attempt can be accomplished by
calling step 2. If initialization succeed, proceed to step 4

if (status == telux::common::ServiceStatus::SERVICE_AVAILABLE) {
       // Go to step 4
    }
    else {
       // Go to step 2 for another initialization attempt
    }
    Copy to clipboard

4. Instantiate requestProfileList callback

auto dataProfileListCb_ = std::make_shared<DataProfileListCallback>();
    Copy to clipboard

4.1 Implement IDataProfileListCallback interface to know status of requestProfileList

class DataProfileListCallback : public telux::common::IDataProfileListCallback {
    
      virtual void onProfileListResponse(const std::vector<std::shared_ptr<DataProfile>> &profiles,
                                         telux::common::ErrorCode error) override {
    
       std::cout<<"Length of available profiles are "<<profiles.size()<<std::endl;
      }
    };
    Copy to clipboard

5. Send a requestProfileList along with required callback method

telux::common::Status status = dataProfileMgr->requestProfileList(dataProfileListCb_);
    Copy to clipboard

Now, receive DataProfileListCallback responses for requestProfileList request.

Last Published: Apr 14, 2026

[Previous Topic
Start/Stop Cellular Data Call](https://docs.qualcomm.com/bundle/publicresource/80-PF458-1/topics/start_or_stop_data_call.md) [Next Topic
Get/Set data filter mode](https://docs.qualcomm.com/bundle/publicresource/80-PF458-1/topics/get_and_set_data_filter_mode.md)