// ---------------------------------------------------------
// CTestPsy4Positioner::NotifyPositionUpdate
// 
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsTestProxyPsy4Positioner::NotifyPositionUpdate(TPositionInfoBase& aPosInfo, TRequestStatus& aStatus)
	{
    TPositionInfo* posInfo = static_cast<TPositionInfo*> (&aPosInfo);

    TUint32 request = posInfo->UpdateType();
    switch (request)
        {
        case 12:
            iRequestHandler->SetErrorCode(KErrNone);
            break;
        default:
            iRequestHandler->SetErrorCode(KErrUnknown);
            break;
        }

	iRequestHandler->NotifyPositionUpdate(posInfo, &aStatus);
	}
EXPORT_C void MTe_LbsPsyStaticData::PrintPosInfo(const TPositionInfo& aPosInfo) const
	{	
	_LIT(KTimeFormat, "%H:%T:%S.%C");
	TBuf<100> cTimeStr;
	
	INFO_PRINTF2(_L("classSize=%d"), aPosInfo.PositionClassSize());
	INFO_PRINTF2(_L("classType=0x%x"), aPosInfo.PositionClassType());
	INFO_PRINTF2(_L("moduleId=0x%x"), aPosInfo.ModuleId());
	INFO_PRINTF2(_L("updateType=%d"), aPosInfo.UpdateType());
	INFO_PRINTF2(_L("positionMode=%d"), aPosInfo.PositionMode());
	INFO_PRINTF2(_L("positionModeReason=%d"), aPosInfo.PositionModeReason());
	
	TPosition pos;
	aPosInfo.GetPosition(pos);
	INFO_PRINTF2(_L("pos altitude=%f"), pos.Altitude());
	INFO_PRINTF2(_L("pos latitude=%f"), pos.Latitude());
	INFO_PRINTF2(_L("pos longitude=%f"), pos.Longitude());
	INFO_PRINTF2(_L("pos datum=0x%x"), pos.Datum());
	INFO_PRINTF2(_L("pos horAccuracy=%f"), pos.HorizontalAccuracy());
	INFO_PRINTF2(_L("pos verAccuracy=%f"), pos.VerticalAccuracy());
						
	TRAP_IGNORE(pos.Time().FormatL(cTimeStr, KTimeFormat);)
// ---------------------------------------------------------
// CTestPsy2Positioner::NotifyPositionUpdate
// 
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsTestProxyPsy2Positioner::NotifyPositionUpdate(TPositionInfoBase& aPosInfo, TRequestStatus& aStatus)
	{
    TBuf<256> buf;
    OpenFileForAppend();
    _LIT(KTestProxyPsy2Positioner, " Request issued to TestProxyPsy2Positioner");
    buf.Append(KTestProxyPsy2Positioner);
    _LIT(KAppend, "\r");
    buf.Append(KAppend);
    iFileText.Write(buf);
    iFile.Close();
    
    TRequestStatus* status = &aStatus;   
    TPositionInfo* posInfo = static_cast<TPositionInfo*> (&aPosInfo);
    TPosition pos;
	pos.SetCoordinate(10, 20, 30);
	posInfo->SetPosition(pos);
	
	TUid implUid = { KPosImplementationUid };
	posInfo->SetModuleId(implUid);	

    TUint32 request = posInfo->UpdateType();
    switch (request)
        {
        // case 1-10 - TC269
        // case 11-15 - TC270
        // case 21-26 - TC271
        case 1:
        case 5:
        case 12:
        case 13:
        case 14:
        case 21:
        case 23:
        case 24:
            User::RequestComplete( status, KPositionPartialUpdate);
            break;
        case 2:
        case 3:
        case 4:
        case 11:
        case 15:
        case 22:
            User::RequestComplete( status, KErrLocked);
            break;
        case 6:
        case 9:
        case 10:
        case 25:
            User::RequestComplete( status, KErrDied);
            break;
        case 7:
        case 8:
        case 26:
            User::RequestComplete( status, KErrBadPower);
            break;
        case 4701:
            iRequestHandler->SetErrorCode(KErrNone);
            iRequestHandler->SetTimerDelay(2000000);
            iRequestHandler->NotifyPositionUpdate(posInfo, status);
            break;
        case 4702:
            iRequestHandler->SetErrorCode(KErrNone);
            iRequestHandler->SetTimerDelay(3000000);
            iRequestHandler->NotifyPositionUpdate(posInfo, status);
            break;
        case 4703:
            iRequestHandler->SetErrorCode(KErrNone);
            iRequestHandler->SetTimerDelay(2000000);
            iRequestHandler->NotifyPositionUpdate(posInfo, status);
            break;
        case 4704:
            iRequestHandler->SetErrorCode(KErrNone);
            iRequestHandler->SetTimerDelay(3000000);
            iRequestHandler->NotifyPositionUpdate(posInfo, status);
            break;
        case 4708:
        case 304:
            iRequestHandler->SetErrorCode(KErrNone);
            iRequestHandler->SetTimerDelay(1000000);			// 1 second
            iRequestHandler->NotifyPositionUpdate(posInfo, status);
            break;
           
        
        case 100:
             iRequestHandler->ReportStatus(
				TPositionModuleStatus::EDeviceInitialising, 
				TPositionModuleStatus::EDataQualityUnknown);
			 User::RequestComplete( status, KErrNone );
			 break; 
			 
		case 200:
             iRequestHandler->ReportStatus(
				TPositionModuleStatus::EDeviceActive, 
				TPositionModuleStatus::EDataQualityUnknown);
			 User::RequestComplete( status, KErrNone );
			 break;
        
        default:
            User::RequestComplete( status, KErrDied);
            break;

        }
	}