Establish temporary network connectivity

Telecommunication applications cannot initiate long-term connections. However, if you need temporary connectivity to a specific network, you can use the Mobile Broadband API as follows:

  1. Create an instance of IMbnConnectionManager.

  2. Register to the IMbnConnectionEvents connection point.

  3. Create an instance of IMbnInterfaceManager.

  4. Get an IMbnInterface interface for the device by passing the account device ID into IMbnInterfaceManager::GetInterface. (For more info, see Unlock a device.)

  5. Obtain an IMbnConnection interface for the device by calling IMbnConnectionManager::GetConnection.

  6. Establish a connection by calling IMbnConnection::Connect. The connectionMode parameter must be set to MBN_CONNECTION_MODE_TMP_PROFILE, and the strProfile parameter must be a mobile broadband profile description.

The results of the connect attempt are returned by using the IMbnConnectionEvents::OnConnectComplete method. To disconnect when you are finished, invoke the IMbnConnection::Disconnect method. Status is returned by using IMbnConnectionEvents::OnDisconnectComplete.

Related topics

Common tasks for mobile broadband Windows Runtime APIs

Send comments about this topic to Microsoft