Monitoring EDGE Traffic

G

Giuseppe.Zarbo

Hi,
1 years ago I wrote a service that monitor the gprs traffic on a
smartphone and on pocket pc WM5.
The service first of all check if the connection is Gprs type and
after store the amount of traffic generated.
To check if the device is connected in GPRS mode here is the code:
bool isConnected = false;
RASCONN rgrc[4];
DWORD dwSize = sizeof(rgrc);
DWORD dwConn = 0;

rgrc[0].dwSize = sizeof(RASCONN);
if (!RasEnumConnections(rgrc, &dwSize, &dwConn)) {
RASENTRY rasEntry;
rasEntry.dwSize = sizeof(RASENTRY);
DWORD i;
for (i=0; i<dwConn; i++){
if(!RasGetEntryProperties(NULL, rgrc.szEntryName, &rasEntry,
&rasEntry.dwSize, NULL, NULL)){
if(wcsstr(rasEntry.szLocalPhoneNumber, L"~GPRS!") !
= NULL){
isConnected = true;
break;
}
}
else{
//Debug(_T("Error RasGetEntryProperties"));
}
}
}
else{
//Debug(_T("Error RasEnumConnections"));
}
DeleteObject(rgrc);
return isConnected;


To check the amount of traffic:

IPAddr dwDestAddr = inet_addr("207.46.19.60");
DWORD dwBestIfIndex = -1;
DWORD dwRes = GetBestInterface(dwDestAddr, &dwBestIfIndex);

MIB_IFROW IfRow;
IfRow.dwIndex = dwBestIfIndex;
dwRes = GetIfEntry(&IfRow);
if(dwRes == NO_ERROR){
DWORD dwTotal = IfRow.dwInOctets + IfRow.dwOutOctets;
return dwTotal;
}
else{
return 0;
}

I don't know if there is a better mode, but with GPRS connection this
works fine.
Now I have a problem with EDGE connection.
I try the same software with the Smartphone HTC S620 and the service
store the right traffic, instead with anothere HTC device, Pocket PC
P3600 the service store more traffic, for example 90 Mb in 2 o 3 days.
This is very strange.
Did anyone try to monitor edge traffic?

Thanks a lot

Giuseppe
 
P

Paul G. Tobey [eMVP]

Are you sure that there isn't a service running for the particular carrier
that you're using in the second case that's doing that sending/receiving?
Are you sure that the Inbox isn't set on the second device to check for new
messages every so often? I really doubt that there's something mysterious
about EDGE; more likely you just aren't realizing what's happening in the
background.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top