×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    NotifyChangeOfCurrentNetworkCancel on 6600

    I am using RBasicGsmPhone to get notification of cell changes, in an active object. THis code works fine on a 3650, and as well as expected on the emulator. However, when I run it on a 6600, the code hangs in the cancel function, NotifyChangeOfCurrentNetworkCancel. Of course this prevents the applciation from shutting down.

    What is a work around for this problem?

    thanks,
    Brendan

  2. #2
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    Some code to reproduce the problem:

    This problem is easy to reproduce. The code below hangs in the cancel function (until there is a real change in network location).

    Has anyone else experienced this? I'm thinking a work around may be to not call NotifyChangeOfCurrentNetworkCancel(), but to instead use User::CompleteRequest(iStatus, KErrCancel) (which seems a particularly nasty hack.

    -->
    void DoTestL()
    {
    RTelServer server;
    User::LeaveIfError(server.Connect());
    _LIT(KGsmModuleName,"phonetsy.tsy");
    User::LeaveIfError(server.LoadPhoneModule(KGsmModuleName));
    RTelServer::TPhoneInfo telInfo;
    RBasicGsmPhone phone;
    MBasicGsmPhoneNetwork::TCurrentNetworkInfo netInfo;
    User::LeaveIfError(server.GetPhoneInfo(0,telInfo));
    User::LeaveIfError(phone.Open(server,telInfo.iName));
    User::LeaveIfError(phone.GetCurrentNetworkInfo(netInfo));
    theConsole->Printf(_L("Phone opened\n"));
    theConsole->Printf(_L("CellId = %d\n"), netInfo.iCellId);

    TRequestStatus status=KRequestPending;
    theConsole->Printf(_L("Waiting for changes\n"));
    phone.NotifyChangeOfCurrentNetwork(status,netInfo);
    User::After(1);
    theConsole->Printf(_L("still...(%d)\n"),status.Int());
    phone.NotifyChangeOfCurrentNetworkCancel();
    theConsole->Printf(_L("Phone change cancelled, \npress any key"));
    phone.Close();
    server.Close();
    theConsole->Getch();
    }

  3. #3
    Regular Contributor
    Join Date
    Mar 2003
    Location
    UK
    Posts
    159
    Well you're trying to use 1.x code on a 2.0 device - so I guess you're just to have hack around the areas where the backwards compatibility isn't as good as you'd like.

    RBasicGsmPhone isn't used on the 6600. It's been replaced by RMobilePhone. So you think you can use the 2.0 SDK to create a native 6600 version? Thinks again, RMobilePhone is a private API...

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    RMobilePhone

    Thanks, I think you must be right.

    Hopefully there is some publically available info on RMobilePhone....

  5. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    5
    Hi,

    where can i find RMobilePhone header information?

    I need to use this NotifyChangeOfCurrentNetwork too.

    Other think: how can i get the neightbour's cell id's? ( there is more. Netmonitor can)

    I need this functions to use on Nokia 6600 ( SDK 2.0 )

    Thanks

    By

  6. #6
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    No luck and no help

    Hi, I havent been able to solve this I'm afraid. It seems that the RMobilePhone API is not published, and that no-one is willing to share it.

    I work around the problem by cheating:
    1) Never delete or cancel the active object until shutdown
    2) At shutdown, I "cancel" the active object, by implementing DoCancel like this:

    void CNetworkWatcher:oCancel()
    {
    // temporary hack to allow app to exit on a 6600.
    if (!i6600)
    {
    iPhone.NotifyChangeOfCurrentNetworkCancel();
    }
    else
    {
    TRequestStatus* ptrStatus = &iStatus;
    User::RequestComplete(ptrStatus, KErrCancel);
    }
    }

    Ugly I know, but I found no other way.

    regards,
    Brendan

Posting Permissions

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