本文整理汇总了C++中TPositionInfo::SetPositionModeReason方法的典型用法代码示例。如果您正苦于以下问题:C++ TPositionInfo::SetPositionModeReason方法的具体用法?C++ TPositionInfo::SetPositionModeReason怎么用?C++ TPositionInfo::SetPositionModeReason使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPositionInfo
的用法示例。
在下文中一共展示了TPositionInfo::SetPositionModeReason方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: options
//.........这里部分代码省略.........
TInt reason = KErrNone;
iProxy->CallL(ENetMsgProcessAssistanceData, &dataRequestMask, &assistanceData, &reason);
CleanupStack::PopAndDestroy(1); //assistanceData
// Assistance Data Notification End
// Network Location Request Start
// ProcessLocationRequest()
const TBool emergency(EFalse);
TLbsNetPosRequestQuality quality = ArgUtils::QualityAlpha2();
TLbsNetPosRequestMethod method = ArgUtils::RequestHybridMethod();
iProxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method);
// Network Location Request Stop
//Start the timer
TTime timerStart;
timerStart.HomeTime();
// RequestAssistanceData(0)
TESTL(iProxy->WaitForResponse(KSmallTimeOut) == ENetMsgRequestAssistanceData);
TLbsAsistanceDataGroup dataGroup;
cleanupCnt = iProxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataGroup);
TESTL(dataGroup == EAssistanceDataNone);
CleanupStack::PopAndDestroy(cleanupCnt);
// now wait for either to complete - but we will expect only the asynchrous request
// waiting for the REF position to complete with KErrNone
User::WaitForRequest(refPosStatus, transPosStatus);
TESTL(refPosStatus==KErrNone);
TESTL(transPosStatus.Int() == KRequestPending);
//Find the time elapsed from timer
TTimeIntervalMicroSeconds microseconds;
TTime timerStop;
timerStop.HomeTime();
microseconds = timerStop.MicroSecondsFrom(timerStart);
TInt64 timeElapsed = microseconds.Int64();
/*** NRH's Alpha2 timer expires. We enter Hybrid mode.***/
//Test that we do not get response before alpha2 has expired
TESTL(iProxy->WaitForResponse(KAlpha2Timeout-timeElapsed-KDelta) == ENetMsgTimeoutExpired);
TESTL(iProxy->WaitForResponse(2*KDelta) == ENetMsgRespondLocationRequest);
getSessionId = NULL;
TInt getReason = KErrNone;
TPositionSatelliteInfo* getPositionInfo = NULL;
cleanupCnt = iProxy->GetArgsLC(ENetMsgRespondLocationRequest, &getSessionId, &getReason, &getPositionInfo);
TESTL(getSessionId->SessionNum() == iSessionId.SessionNum());
TESTL(getReason==KErrNone);
CleanupStack::PopAndDestroy(cleanupCnt);
// no need for looping, we assume that the next update location from GPS will give accurate fix
quality = ArgUtils::Quality();
iProxy->CallL(ENetMsgProcessLocationRequest, &iSessionId, &emergency, &service, &quality, &method);
// RequestAssistanceData(0)
TESTL(iProxy->WaitForResponse(KSmallTimeOut) == ENetMsgRequestAssistanceData);
cleanupCnt = iProxy->GetArgsLC(ENetMsgRequestAssistanceData, &dataGroup);
TESTL(dataGroup == EAssistanceDataNone);
CleanupStack::PopAndDestroy(cleanupCnt);
// GPS positions meets required accuracy. This is sent immediately to protocol module
// The ini file should contain accurate gps fix for this test case to work
TESTL(iProxy->WaitForResponse(KTTimeout) == ENetMsgRespondLocationRequest);
getSessionId = NULL;
getReason = KErrNone;
getPositionInfo = NULL;
cleanupCnt = iProxy->GetArgsLC(ENetMsgRespondLocationRequest, &getSessionId, &getReason, &getPositionInfo);
TESTL(getSessionId->SessionNum() == iSessionId.SessionNum());
TESTL(getReason == KErrNone);
// Test position is the same as in the ini file data fed to the GPS module
// $update,1,2,51.5015,-0.105,50,2,3*
TPosition gpsPos;
getPositionInfo->GetPosition(gpsPos);
TESTL(gpsPos.Latitude()==51.5015 && gpsPos.Longitude()==-0.105 && gpsPos.Altitude()==50 && gpsPos.HorizontalAccuracy()==2 && gpsPos.VerticalAccuracy()==3);
CleanupStack::PopAndDestroy(cleanupCnt);
// Network Result Notification Start
// ProcessLocationUpdate()
//Final Network Position is the GPS position
TPositionInfo gpsPosInfo;
gpsPosInfo.SetPosition(gpsPos);
gpsPosInfo.SetUpdateType(EPositionUpdateGeneral);
gpsPosInfo.SetPositionMode(TPositionModuleInfo::ETechnologyNetwork | TPositionModuleInfo::ETechnologyAssisted);
gpsPosInfo.SetPositionModeReason(EPositionModeReasonNone);
iProxy->CallL(ENetMsgProcessLocationUpdate, &iSessionId, &gpsPosInfo);
// Network Result Notification Stop
// Session Complete Start
reason = KErrNone;
iProxy->CallL(ENetMsgProcessSessionComplete, &iSessionId, &reason);
MLbsNetworkProtocolObserver::TLbsNetProtocolServiceMask activeServiceMask = MLbsNetworkProtocolObserver::EServiceNone;
iProxy->CallL(ENetMsgProcessStatusUpdate, &activeServiceMask);
// Session Complete Stop
// the REF position request has completed, so now, after injecting the FNP and Session Complete
// we expect that the other request to complete with KErrNone
User::WaitForRequest(transPosStatus);
TESTL(transPosStatus==KErrNone);
return TestStepResult();
}