×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    10

    Automatic Selection of GPRS Access Point

    Hi All,

    I have a custom built server to which i am uploading & downloading some data.For this i have used the TCP/IP Socket connection.I have used the RSocketServ & RSocket classes to establish connection & to upload or download data.This class which establishes the connection to the server is implemented as an active object.When i call the function RSocket::Connect() i get the internet access point selection dialog.

    My issue is that i want to hide this access point and programaticaly select the GPRS access point.

    From the forum i understand that we can use the following options to resolve this

    a) use the CInternetConnectionInitiator class
    b) use the RGenericAgent Class
    c) use the Preference Table in the Comms Database to set my preference.

    Option a) is a totally different implementation from mine.So if i have to use this then i will have to redo that connection part.Besides by the use of this implemenation will i be able connect to my custom server with the use my custom protocol.Otherwise this change would require that i change my server program itself.

    Option b) is the next feasible solution but i couldnot find any implemenation in the forum which tells me how i can use the RGeneric agent to connect.I understand that the RGenericAgent class is used to dial instead of NetDial of 6.0.Could anybody help me in giving code as to how to make use of RGenericAgent.Some Sample code integrated with Sockets Program in samples of series 60 would be useful.

    Option C) is what i have been trying out.But this did not work out since any attempt to insert or update a record in this table always gave me a system wide error such as Unknown object,Access denied etc.If anybody has made use of this table the code that u have tried out would be very helpful.

    If any body can send me some peice of code this would be of great help to me.This issue has become so critical.Please help.

    Regards

    Abraham

  2. #2
    Regular Contributor
    Join Date
    Jul 2003
    Posts
    63

    same mess here!!

    can u a plz tell me the library to link CIntConnectionInitiator class.

    Thanks
    Prakash

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    2

    CIntConnectionInitiator

    Use intconninit.lib. Just search in the .lib files in epoc32 for the name of the class you're looking to link to in future

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    35
    Hi!

    Did you find a proper way to solve the problem? ´m stuck in the same one, and getting very confused, because of the lack of proper documentation and the lack of examples in the sdk ...

    Could anybody help, or at least point to some resource/example?

    Cheers..


    jraluy

  5. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    26
    To turn the access point selection prompt off add this code to the start of your application. I have it in the initialization of my AppUI class.

    Just make sure to set the property to false in the destructor of the same class so that other applications do not have a problem.

    TRAPD(
    err, CCommsDatabase* db = CCommsDatabase::NewL(EDatabaseTypeIAP);
    db->SetGlobalSettingL(TPtrC(ASK_USER_BEFORE_DIAL),(TInt)false);
    delete db;
    )

    Shabbir

  6. #6
    Registered User
    Join Date
    Jun 2003
    Posts
    26
    oops...meant to say set the property to true in the destructor.

    you will need to link to commdb.lib and use commdb.h

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    35
    Yes, that bit I had it working ( but thanks anyway!! )

    The problem is that I don´t know how to set up the IAP that I what. I know (well, more or less)how to see them with ;

    optionA) CCommsDatabase and CCommsDbTableView
    In this case I don´t know how to set up the default one

    optionB) with RGenericAGent. This piece of code is from the Knowledge database of www.symbian.com ;
    CleanupClosePushL(netAgent);
    CCommsDatabase* db=CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(db);
    CCommsDbConnectionPrefTableView*
    view = db->OpenConnectionPrefTableViewOnRankLC(ECommDbConnectionDirectionOutgoing,1);
    view->GotoFirstRecord();
    view->UpdateDialogPrefL(ECommDbDialogPrefDoNotPrompt);
    TRequestStatus status;
    netAgent.StartOutgoing(status);
    User::WaitForRequest(status);
    CleanupStack::PopAndDestroy(3); // view, db, netAgent

    Ok, here I know how to set it up, but I don´t know how to navigate through them , so I can set up the one I want...


    optionC) with CApSelect and CApDataHandler( example taken from this forum , found in a couple of places ). Here the problem is that the code works fine on the emulator but crashed on the phone, on the function SetAsDefaultL of the CApDataHandler...



    Option B seems to be pretty good, because although in symbian.com it says that is only for 7.0, on the 6.1 works fine ( both emulator and mobile as I recall)...but it is incomplete, unfortunetely...


    Oh god, this is madness! Could anyone help?


    Cheers

    jraluy

  8. #8
    Registered User
    Join Date
    Nov 2003
    Posts
    3
    Hi all!

    I have encountered the same problem. The solution that (almost) worked for me was using the CIntConnectionInitiator class (see 'official' example by forum Nokia).

    The point is that CIntConnectionInitiator is only used to set up a GPRS connection. The sockets code (using RSocketServ and RSocket) will use existing connection if one is available, which is always the case when using this approach.

    So far, so good... Now comes the trouble...

    I had to check whether the default access point uses GPRS. For this, I used the following code (non-essential bits removed):

    CCommsDatabase* cdb = CCommsDatabase::NewL(EDatabaseTypeIAP);
    CApDataHandler* apDataHandler = CApDataHandler::NewLC(*cdb);
    CApUtils* apUtils = CApUtils::NewLC(*cdb);
    TUint32 apId = apDataHandler->DefaultL(EFalse);
    TApBearerType bearerType = apUtils->BearerTypeL(apId);

    This worked on emulator but not on phone (tested on Nokia 3650, 7650 and 6600). The last line caused a leave with KErrNotFound. When I changed the following line:

    TUint32 apId = apDataHandler->DefaultL(EFalse);
    -- changed with --
    TUint32 apId = apDataHandler->DefaultL(ETrue);

    The code stopped working on emulator, BUT started working on phone!!!

    Now comes the most interesting bit. The following code works (once again) only on the emulator, but not on the phone(s):

    TUint32 apId = apDataHandler->DefaultL(ETrue);
    apId = apUtils->WapIdFromIapIdL(apId);
    TApBearerType bearerType = apUtils->BearerTypeL(apId);

    It would seem that the call CApDataHandler:efaultL(ETrue) returns WAP entry UID on phone and ISP AP entry UID on emulator. On the other hand, I think that CApDataHandler:efaultL(EFalse) returns ISP AP entry UID on phone and WAP entry UID on emulator!?

    Is this really so or is the theory wrong? In any case, could someone from Nokia please shed some light on this matter!

    One issue that comes to mind and may be relevant to the problem is that I had to use an "etelbgsm.h" header that I found somewhere on the net (supposedly from the Nokia 9200 SDK). THis is because this header is missing from the Series 60 SDK. I needed the header to compile code that uses the CApDataHandler class.

    I have wasted the better part of the night to come this far and now I can't even get a default WAP GPRS connection up using Nokia phone software. The phone indicates that the GPRS connection is being negotiated even after all apps have been closed for more than 10 minutes! It seems my operator has put me on the s**t list due to "strange" activity or something, or I have totally and irreparably ruined the phone settings - must try with other phone and/or SIM tomorrow. Getting frustrated.

    Anyway, thanks in advance for all the help.
    Andrej

  9. #9
    Registered User
    Join Date
    Nov 2003
    Posts
    3
    CApDataHandler:efaultL(...) should be read
    CApDataHandler :: DefaultL(...)

  10. #10
    Registered User
    Join Date
    Jun 2003
    Location
    Italy
    Posts
    20

    as anyone solved the problem?

    I need to solve the same problem.I've to connect to a web server through GPRS.Now the program works only if I use the GPRS always on...and of course I don't want this to happen because it's not so user-friendly.
    I've already hidden the access point selection...the program seems to choose the first point in the list (which I suppose is the last used)and I want to choose the gprs access by default.
    The code I'm using is this one
    void CSocketTCPGrabber::InitInternetConnection()
    {


    CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(commDB);

    // Get connection preferences table view
    CCommsDbConnectionPrefTableView* connPrefView;
    connPrefView = commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionOutgoing);
    // Read first record in connection preferences table
    connPrefView->GotoFirstRecord();


    CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref connPref;
    connPrefView->ReadConnectionPreferenceL(connPref);
    CleanupStack::PopAndDestroy(); // connPrefView


    // Create over rides settings
    CCommDbOverrideSettings* commOR = CCommDbOverrideSettings::NewL(CCommDbOverrideSettings::EParamListFull,EDatabaseTypeIAP);
    connPref.iDialogPref = ECommDbDialogPrefDoNotPrompt; // no prompt
    commOR->SetConnectionPreferenceOverride(connPref);

    // Start connection using over rides
    iInitConn = CIntConnectionInitiator::NewL();

    iInitConn->ConnectL(connPref,iStatus);

    CleanupStack::PopAndDestroy()

  11. #11
    Registered User
    Join Date
    Mar 2007
    Posts
    10

    Re: Automatic Selection of GPRS Access Point

    Hello!

    This topic was very useful for me! Thank you guys!
    I have one more question: does anybody know how to do automatic selection of Access Point for MMS?
    I use CCommsDatabase & CCommsDbTableView classes to get the list of IAPs, but I can't find which one is the "right" Access Point.

  12. #12
    Regular Contributor
    Join Date
    Mar 2006
    Location
    Bangalore
    Posts
    148

    Re: Automatic Selection of GPRS Access Point

    Hi,

    Please do not use CCommsDb or CCommsDatabase it will be deprecated.
    You should be using CommsDat api.

    Regards,
    Pavan
    Regards,
    Pavan M.V
    ________________________________

    Email: pavan.mysore@symbian.com /pavan.vishu@gmail.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •