Listing & Selecting a data profile/APN for making Data call in a BrewMP App (GSM/UMTS devices) | developer.brewmp.com Listing & Selecting a data profile/APN for making Data call in a BrewMP App (GSM/UMTS devices) | developer.brewmp.com

Developer

Listing & Selecting a data profile/APN for making Data call in a BrewMP App (GSM/UMTS devices)

Forums:

To make a data connection on a GSM device it’s required that the device has a valid Data Connection Profile created & set as the default APN for the device.

 Look at this thread to know more about Data Connection Profiles on UMTS:

https://developer.brewmp.com/forum/data-callapndata-connection-profiles-gsm-umts-devices

 A Brew MP Application will use the default Data Profile, set on the device, if nothing is specified explicitly by the Application. This would be applicable to all APIs used for data related services like - IWeb, ISocket, ISockport, INetwork etc..

 Since there may be more than one Data Profiles on the device according to end user's choice, an Application may give an option in the Application to choose a data profile.

 

Here is how to get the list of all data profiles:-

_______________________________________________________________

#include "AEEINetUtils.h"

#include "AEENetUtils.bid"

 

int listProfiles(module6 *pMe) {

INetUtils *pNetUtil;

AEEPDPInfo pdpinfo;

uint16 nCount;

uint16 i;

uint16 nMyBMPProfileNo;

 

ISHELL_CreateInstance(pMe->applet.m_pIShell, AEECLSID_NetUtils, (void**)&pNetUtil);

 

INetUtils_GetPDPCount(pNetUtil, &nCount);

for(i = 1; i <= nCount; i++)  {

INetUtils_GetPDPInfo(pNetUtil, i, &pdpinfo);

 

// pdpinfo.szName is the name of the profile

// pdpinfo.bValid is TRUE if profile is valid

// you may create a list for user to select

//taking a profile with name "My BMP Profile", i want to use as an example

if(WSTRCMP(pdpinfo.szName, L"My BMP Profile") == 0) {

nMyBMPProfileNo = i;

}

}

return nMyBMPProfileNo;

}

______________________________________________________________

 

Selecting a desired profile:-

____________________________

 

#include "AEEINetwork.h"

#include "AEENetwork.bid"

 

void selectPDP(module6 *pMe) {

 

uint16 nProfile;

nProfile = listProfiles(pMe);

ISHELL_CreateInstance(pMe->applet.m_pIShell, AEECLSID_Network, (void**)&pMe->pNetwork);

 

INetwork_SelectNetwork(pMe->pNetwork, AEE_NETWORK_UMTS(nProfile), AEE_AF_INET);

 

}

________

 

Note: that the available profiles are numbered consecutively from one to the count, although they may not all be valid.

 

 

When using IWeb:-

Add WEBOPT_NETWORK to the call to IWEB_GetResponse(), similar to below:-

 

IWEB_GetResponse(pWeb->m_pIWeb,(pWeb->m_pIWeb, &pWeb->m_pIWebResp, &pWeb->m_CB, pWeb->pUrl,

WEBOPT_HANDLERDATA, pWeb,

WEBOPT_METHOD, "GET",

WEBOPT_NETWORK, AEE_NETWORK_UMTS(nProfile),

WEBOPT_END));

 

Is this the same for CDMA?  And how do you actually make the data call?

Is this the same for CDMA?  And how do you actually make the data call?

data call can be made by either using ISockPort or IWeb.

data call can be made by either using ISockPort or IWeb.