Ejemplo n.º 1
0
void CLcfPsyDummy3::GetPositionCourseInfoL(TPositionInfoBase& aPosInfo)
    {
    TPositionCourseInfo* courseInfo = static_cast<TPositionCourseInfo*>(&aPosInfo);
    TCourse course;

    // fill in course data
    course.SetHeading(DUMMY_HEADING);
    course.SetSpeed(DUMMY_SPEED);
    course.SetHeadingAccuracy(DUMMY_HEADING_ACCURACY);
    course.SetSpeedAccuracy(DUMMY_SPEED_ACCURACY);

    // store it in course info
    courseInfo->SetCourse(course);

    courseInfo->SetModuleId(ImplementationUid());
    }
Ejemplo n.º 2
0
void CNetworkGateway::ProcessNetworkLocationMessage(const TLbsNetLocMsgBase& aMessage)
	{
	LBSLOG(ELogP2, "CNetworkGateway::ProcessNetworkLocationMessage:");
	LBSLOG2(ELogP3, "Type : %d", aMessage.Type());

	switch (aMessage.Type())
		{
		case TLbsNetLocMsgBase::ENetLocMsgNetworkLocationRequest:
			{
			TInt reason = KErrNone;
			const TLbsNetLocNetworkLocationRequestMsg& req = static_cast<const TLbsNetLocNetworkLocationRequestMsg&>(aMessage);
			iCurrentNetLocReqId = req.SessionId();
			
			if (req.Quality().MaxFixTime() == 0)//answer req with incorrect session id
				{		
				iCurrentNetLocReqId.SetSessionNum(999);
				TLbsNetLocNetworkLocationCompleteMsg msg(iCurrentNetLocReqId, reason);	
				iNetworkLocationChannel->SendNetworkLocationMessage(msg);
				}

			else if (req.Quality().MaxFixTime() == 1)//answer req with unknown response type
				{		
				TLbsNetLocNetworkLocationCancelMsg msg(iCurrentNetLocReqId, reason);
				iNetworkLocationChannel->SendNetworkLocationMessage(msg);
				}
				
			else
				{
				TLbsNetLocNetworkLocationCompleteMsg msg(iCurrentNetLocReqId, reason);	
				iNetworkLocationChannel->SendNetworkLocationMessage(msg);
				}
				
			// for testing return a fixed test location
			TPositionCourseInfo posInfo;
			TPosition pos;
			pos.SetCoordinate(50, 80);
			posInfo.SetPosition(pos);
			
			TCourse course;
            course.SetSpeed(10.0);
            course.SetVerticalSpeed(20.0);
            course.SetHeading(30.0);
            course.SetSpeedAccuracy(1.0);
            course.SetVerticalSpeedAccuracy(2.0);
            course.SetHeadingAccuracy(3.0);
            course.SetCourse(40.0);
            course.SetCourseAccuracy(4.0);
            
            posInfo.SetCourse(course);
			
			iNetworkLocationChannel->SetReferencePosition(iCurrentNetLocReqId, posInfo);
			break;
			}
		case TLbsNetLocMsgBase::ENetLocMsgNetworkLocationCancel:
			{
			const TLbsNetLocNetworkLocationCancelMsg& cancel = static_cast<const TLbsNetLocNetworkLocationCancelMsg&>(aMessage);
			// for test netlocmanager, return the location info directly without sending request to network protocol
			iCurrentNetLocReqId = cancel.SessionId();
			TInt reason = KErrNone;
			TLbsNetLocNetworkLocationCompleteMsg msg(iCurrentNetLocReqId, reason);
			iNetworkLocationChannel->SendNetworkLocationMessage(msg);
			break;
			}
		case TLbsNetLocMsgBase::ENetLocMsgNetworkLocationComplete:
		default:
			{
			break;
			}
		}
	}