get rid of that damn IAP selection box
| Wed, 2005-12-14 07:19 | |
|
Hey guys, I have read so many articles about programatically setting the IAP settings to GPRS that my eyes hurt, problem is every solution doesnt seem to work for me!! Has anyone out there been able to implement a solution? I want to be able to automatically select GPRS so that I can send a file to a server, without user notification. Is this possible on Series 60?? Any answers would be awesome!! R "beer is proof that god loves us, and wants us to be happy!" |
|






Forum posts: 214
TInt ret;
ret=conn.Open(iSocketServ);
isConn=1;
// Create overrides
TCommDbConnPref prefs;
prefs. SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
prefs.SetIapId(aIap);
// Start an Outgoing Connection with overrides
TRequestStatus status;
conn.Start(prefs,status);
User::WaitForRequest(status);
"I only know that I know nothing." (Socrates)
Forum posts: 20
db->SetGlobalSettingL(TPtrC(ASK_USER_BEFORE_DIAL),(TInt)false);
delete db;
I think this thing also works.
regards
Forum posts: 75
I.e. in the examples you need to specify the uid of the gprs connection, but how do I find this? Also I am using RSockets to connect.....
thanks
R
"beer is proof that god loves us, and wants us to be happy!"
Forum posts: 75
int ConnectToServer(RSocket &conn, PSERVERINFO pServerInfo)
{
TInetAddr addr;
int z;
TUint16 server[MAX_PATH];
TBuf16<MAX_PATH> serverW;
#ifndef __WINS__
// This only works on target machine
z = mbstowcs((__wchar_t*)server, pServerInfo->szServer, MAX_PATH);
#else
// This only works on emulator
z = mbstowcs(server, pServerInfo->szServer, MAX_PATH);
#endif
serverW.Copy((TUint16*)server, z);
RHostResolver resolver;
TNameEntry name;
TNameRecord nameRec;
TRequestStatus aStatus;
TInt ret;
ret=conn.Open(iSocketServ);
isConn=1;
// Create overrides
TCommDbConnPref prefs;
prefs. SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
prefs.SetDirection(ECommDbConnectionDirectionOutgoing);
prefs.SetIapId(aIap);
// Start an Outgoing Connection with overrides
TRequestStatus status;
conn.Start(prefs,status);
User::WaitForRequest(status);
TInt err;
RSocketServ ss;
err=ss.Connect();
if(err==KErrNone)
{
err=resolver.Open(ss, KAfInet, KProtocolInetUdp);
if(err==KErrNone)
{
TPtrC16 serverDesc;
serverDesc.Set(serverW.Ptr(), z);
resolver.GetByName(serverDesc, name, aStatus);
User::WaitForRequest(aStatus);
if(aStatus.Int()==KErrNone)
{
nameRec = name();
addr = (TInetAddr) nameRec.iAddr;
addr.SetPort(pServerInfo->port);
err=conn.Open(ss, KAfInet, KSockStream, KUndefinedProtocol);
if(err==KErrNone)
{
TRequestStatus stat;
conn.Connect(addr, stat);
User::WaitForRequest(stat);
if(stat.Int()==KErrNone)
{
// LyncMDA Server connection established. RSocket = sock
////////////////////////////////////////////////////////////////
TBuf8<512> buff;
TBuf16<512> sBuff;
int z;
z=recvLine(conn,buff, 512); //Server Ready message
buff.Append(0);
sBuff.Copy(buff);
}
else
{
return stat.Int();
}
}
else
{
return err;
}
}
}
else
{
return err;
}
resolver.Close();
}
else
{
return err;
}
return KErrNone;
}
"beer is proof that god loves us, and wants us to be happy!"
Forum posts: 20
check out the conncetion preferences table in CommDB, it has
default GPRS settings, rather settings in prefrence order:-
CCommsDbConnectionPrefTableView* prefView = db->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionOutgoing);
prefView->GotoFirstRecord();
CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref;
prefView->ReadConnectionPreferenceL(pref);
TUint32 id = pref.iBearer.iIapId;
Now id is the access point id of the default connection, the one you wanted.
ABhinav