×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2013
    Posts
    7

    Unable to fetch GPS Location,it gives time out error(-33)

    Hi all,

    I am trying to fetch gps location but i am unable to get it.
    Actually i gave 30 sec time out .i also check for 2 minute time out,i did not success.

    My code is following :


    User::LeaveIfError(iLocationServer.Connect());
    LOG(_L("User::LeaveIfError(iLocationServer.Connect());"));
    TUint numOfModules = 0;
    User::LeaveIfError(iLocationServer.GetNumModules(numOfModules));

    TPositionModuleInfo modInfo;
    TPositionModuleId targetModule;
    for (TInt i = 0; i < numOfModules; i++)
    {
    // read current module info
    TInt error = iLocationServer.GetModuleInfoByIndex(i, modInfo);
    //TPositionModuleInfo::IsAvailable ()

    if (modInfo.IsAvailable())
    {
    TBuf<30> Modulename;
    modInfo.GetModuleName(Modulename);

    if (Modulename.Compare(_L("Integrated GPS")) == 0 || Modulename.Compare(_L("Assisted GPS")) == 0)
    {
    }

    }

    if (modInfo.IsAvailable() && error == KErrNone)
    {
    LOG(_L("if (modInfo.IsAvailable() && error == KErrNone)"));
    TBuf<200> buf(0);
    buf.SetLength(0);
    buf.FillZ();
    modInfo.GetModuleName(buf);

    if (!buf.Compare(_L("Network based")) && iIsGpsType == ENGpsType)
    {
    targetModule = modInfo.ModuleId();
    iSuccess = ETrue;
    break;
    }

    if (!buf.Compare(_L("Integrated GPS")) && iIsGpsType == EIGpsType)
    {

    targetModule = modInfo.ModuleId();
    iSuccess = ETrue;
    break;
    }

    if (!buf.Compare(_L("Assisted GPS")) && iIsGpsType == EAGpsType)
    {

    targetModule = modInfo.ModuleId();
    iSuccess = ETrue;
    break;
    }

    if (modInfo.TechnologyType() & TPositionModuleInfo::ETechnologyNetwork)
    {
    TPositionModuleInfo::TDeviceLocation deviceLoc =modInfo.DeviceLocation();
    if (deviceLoc == TPositionModuleInfo::EDeviceInternal)
    {
    LOG(_L("[if (deviceLoc == TPositionModuleInfo::EDeviceInternal]"));
    //Checked GPS is available, you can use the information to your app
    }
    }
    }
    else
    {

    }


    }

    // open positioner
    if (targetModule != TUid::Null())
    {
    User::LeaveIfError(iPositioner.Open(iLocationServer, targetModule));
    }
    else
    {
    User::LeaveIfError(iPositioner.Open(iLocationServer));
    }

    // set our application as location requestor
    User::LeaveIfError(iPositioner.SetRequestor(CRequestor::ERequestorService,CRequestor::EFormatApplication, *iAppName));
    // set maximum allowed time for a location requestp
    TTimeIntervalMicroSeconds timeOut(30000000);
    iUpdateOptions.SetUpdateTimeOut(timeOut);
    User::LeaveIfError(iPositioner.SetUpdateOptions(iUpdateOptions));

    Please help me...

    ---------------------
    Thanks,

    Pradip Kumar

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Unable to fetch GPS Location,it gives time out error(-33)

    Generally GPS can take loong time, this would happen if for example you do not have SIM card inserted as well as if you dont have working internet connection. Also do use the Assisted GPS, its lot faster than the standalone GPS.

    thus do check that you get the real GPS location with internal maps application, or with other app first.

    Then you could also try fetching the position with other than GPS based methods first, to bet at least somekind of location before getting the more accurate one.,

  3. #3
    Registered User
    Join Date
    Apr 2013
    Posts
    7

    Re: Unable to fetch GPS Location,it gives time out error(-33)

    Thank you Yucca sir...

    ...for reply.

    I am using device with SIM Card (Data services Enabled) and i have also tried with WLAN but i am unable to fetch location from AGPS and GPS either i am in door or out door and i am able to get GPS co-ordinates from another applications(Google maps) as well as.

    Also I am able to get network location properly with same code of lines in my application.

    But AGPS is not helping me.

    Please suggest me ...

    Thanks Again,

    Pradip kumar

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Unable to fetch GPS Location,it gives time out error(-33)

    I would check other examples in wiki, and see whether they would use the API differently. All and all, you could also check that you have needed capabilities. Would suppose that at least you would need NetworkServices, Location, ReadUserData.

Similar Threads

  1. Unable to fetch call log from Nokia E5.
    By rakesh.sharnagate in forum Symbian
    Replies: 0
    Last Post: 2012-05-23, 13:11
  2. How to fetch location details using GPRS
    By harinrd in forum Mobile Java General
    Replies: 6
    Last Post: 2010-08-09, 10:41
  3. how to fetch location coordinates from cell id??
    By poojs in forum Mobile Java General
    Replies: 2
    Last Post: 2010-03-12, 09:32
  4. Replies: 5
    Last Post: 2009-05-04, 13:56
  5. can we fetch location area name using HTTP API's
    By ash_21 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2007-08-28, 20:11

Posting Permissions

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