Exemplo n.º 1
0
void CLbsAllPosProxy::ConstructL(CLbsSatelliteTracker *aSatelliteTracker , CLbsNetworkTracker *aNWTracker)
{

    if (aSatelliteTracker == NULL)
        iSatelliteTracker = CLbsSatelliteTracker::NewL(iContainer, this);
    else {
        iSatelliteTracker = aSatelliteTracker;
        iSatelliteTracker->SetObserver(this);
    }

    if (aNWTracker == NULL)
        iNWTracker = CLbsNetworkTracker::NewL(iContainer, this);
    else {
        iNWTracker = aNWTracker;
        iNWTracker->SetObserver(this);
    }

    TMilliSeconds minInterval = (iSatelliteTracker->GetMinimumUpdateInterval()  < iNWTracker->GetMinimumUpdateInterval()) ?
                                iSatelliteTracker->GetMinimumUpdateInterval() : iNWTracker->GetMinimumUpdateInterval();

    iMinUpdateInterval = minInterval * 1000;
    SetUpdateInterval(minInterval);

    //Initialize states
    iIdle = CLbsAllPosIdle::NewL(this);
    iInitialHybrid = CLbsAllPosInitialHybrid::NewL(this);
    iSatelliteOnly = CLbsAllPosSatelliteOnly::NewL(this);
    iRunningHybrid = CLbsAllPosRunningHybrid::NewL(this);

    iCurrentState = iIdle;
}
XQLocation::Error CPositionerObserver::Init(RPositionServer& aPosServer, TInt aUpdateInterval)
{
    // Open sub-session to positioning server.
    TPositionModuleId positionModuleId;
    aPosServer.GetDefaultModuleId(positionModuleId);
    TInt error = iPositioner.Open(aPosServer,positionModuleId);

    // Opening of a sub-session failed
    if (error != KErrNone) {
        return XQLocation::OpenError;
    }

    // Set position requestor
    error = iPositioner.SetRequestor(CRequestor::ERequestorService,
                                     CRequestor::EFormatApplication,
                                     KXQLocationRequestor);

    // The requestor could not be set
    if (error != KErrNone) {
        iPositioner.Close();
        return XQLocation::OpenError;
    }

    XQLocation::Error err = SetUpdateInterval(aUpdateInterval);
    // The update interval could not be set
    if (err != XQLocation::NoError) {
        iPositioner.Close();
        return err;
    }
    
    return XQLocation::NoError;
}
Exemplo n.º 3
0
void CLbsSatelliteTracker::ConstructL()
{
    qDebug() << "CLbsSatelliteTracker::ConstructL - START " << iTrackType  ;

    CLbsTrackingTimerBase::ConstructL();

    //Initialize PSYs
    RArray<TPositionModuleInfo*>  modInfoArray;
    iContainer->GetAvailablePsys(EFalse, modInfoArray);

    CLbsTrackingTimerBase::InitializePSYs(modInfoArray, MIN_GPS_UPD_INTERVAL);

    modInfoArray.Close();

    SetUpdateInterval(iMinUpdateInterval.Int64() / 1000);

    //Register for callbacks
    iContainer->SetGPSPSYChangeCallback(this);
    qDebug() << "CLbsSatelliteTracker::ConstructL - End " << iTrackType  ;
}
Exemplo n.º 4
0
void CLbsNonSatellitePositionTracker::ConstructL()
{
    qDebug() << "CLbsNonSatellitePositionTracker::ConstructL - START " << iTrackerName  ;

    CLbsTrackTimerBase::ConstructL();

    //Initialize PSYs
    RArray<TPositionModuleInfo*>  modInfoArray;
    iContainer->GetAvailablePsys(ETrue, modInfoArray);

    InitializePSYs(modInfoArray, MIN_NW_UPD_INTERVAL);

    modInfoArray.Close();

    SetUpdateInterval(iMinUpdateInterval.Int64() / 1000);

    //Register for callbacks
    iContainer->SetNonSatellitePsyCountChangeCallback(this);
    qDebug() << "CLbsNonSatellitePositionTracker::ConstructL - End "  ;
}
Exemplo n.º 5
0
bool CLbsTrackingTimerBase::StartTimer()
{
    qDebug() << "CLbsTrackingTimerBase::StartTimer  " << iTrackType;
    bool sendClientUpdate = EFalse;

    iTTFFTimerActive = EFalse;


    if (iTimerInterval.itrMaxTimer > 0) {
        iTimer.After(iStatus, MAX_TIMER);
        iTimerInterval.itrMaxTimer--;

        //qDebug() << "CLbsTrackingTimerBase::StartTimer 1 "<<iTrackType;

        if (!IsActive()) {
            // qDebug() << "CLbsTrackingTimerBase::StartTimer 2 "<<iTrackType;
            SetActive();
            //qDebug() << "CLbsTrackingTimerBase::StartTimer 3 "<<iTrackType;
        }
        qDebug() << "CLbsTrackingTimerBase::StartTimer 4 " << iTrackType;
    } else if (iTimerInterval.balanceDuration.Int() > 0) {
        //qDebug() << "CLbsTrackingTimerBase::StartTimer 5 "<<iTrackType;
        iTimer.After(iStatus, iTimerInterval.balanceDuration);
        iTimerInterval.balanceDuration = 0;
        if (!IsActive()) {
            // qDebug() << "CLbsTrackingTimerBase::StartTimer 6 "<<iTrackType;
            SetActive();
            //qDebug() << "CLbsTrackingTimerBase::StartTimer 7 "<<iTrackType;
        }
        //qDebug() << "CLbsTrackingTimerBase::StartTimer 8 "<<iTrackType;
    } else {
        // qDebug() << "CLbsTrackingTimerBase::StartTimer 9 "<<iTrackType;
        //Start from the beginning
        SetUpdateInterval(iUpdateInterval.Int64() / 1000);
        sendClientUpdate = ETrue;
        StartTimer();
    }
    return sendClientUpdate;
}