本文整理汇总了C++中TPositionInfo::SetModuleId方法的典型用法代码示例。如果您正苦于以下问题:C++ TPositionInfo::SetModuleId方法的具体用法?C++ TPositionInfo::SetModuleId怎么用?C++ TPositionInfo::SetModuleId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPositionInfo
的用法示例。
在下文中一共展示了TPositionInfo::SetModuleId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
// ---------------------------------------------------------
// CT_LbsInstallPsyTp273::NotifyPositionUpdate
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsInstallPsyTp273::NotifyPositionUpdate(
TPositionInfoBase& aPosInfo,
TRequestStatus& aStatus)
{
TInt err = KErrNone;
TTime tt;
tt.UniversalTime();
//Request ID must be unique, use universalime as seed
// to give a random number
TInt64 seed = tt.Int64();
TReal lat = 90 * Math::FRand(seed);
TReal lon = 90 * Math::FRand(seed);
TReal32 alt = (TReal32)(90 * Math::FRand(seed));
TPositionInfo* position = static_cast<TPositionInfo*> (&aPosInfo);
TUid implUid = { KPosImplementationUid };
position->SetModuleId(implUid);
TTime now;
now.UniversalTime();
TPosition posse;
posse.SetCoordinate(lat, lon, alt);
posse.SetTime(now);
position->SetPosition(posse);
TRequestStatus* status = &aStatus;
User::RequestComplete(status, err);
}
示例2: NotifyPositionUpdate
// ---------------------------------------------------------
// CT_LbsTestTimerPsy::NotifyPositionUpdate
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsTestTimerPsy::NotifyPositionUpdate(
TPositionInfoBase& aPosInfo,
TRequestStatus& aStatus)
{
TPositionInfo* position = NULL;
position = static_cast<TPositionInfo*> (&aPosInfo);
iStatus = &aStatus;
*iStatus = KRequestPending;
TUid implUid = { KPosImplementationUid };
position->SetModuleId(implUid);
if (iTrackingEnabled)
{
// Set this position when tracking is enabled (on-going)
TCoordinate coor(55.0, 55.0, 55.0);
TLocality loc (coor, 1.0, 1.0);
TPosition pos (loc, TTime(0));
position -> SetPosition(pos);
}
else
{
// Set a dummy position
TCoordinate coor(20.0, 20.0, 20.0);
TLocality loc (coor, 1.0, 1.0);
TPosition pos (loc, TTime(0));
position -> SetPosition(pos);
User::RequestComplete(iStatus, KErrNone);
}
}
示例3: NotifyPositionUpdate
// ---------------------------------------------------------
// CT_LbsTestPsySimulateIsa::NotifyPositionUpdate
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsTestPsySimulateIsa::NotifyPositionUpdate(
TPositionInfoBase& aPosInfo,
TRequestStatus& /*aStatus*/)
{
TPositionInfo* iPosition = static_cast<TPositionInfo*> (&aPosInfo);
TUid implUid = { KPosImplementationUid };
iPosition->SetModuleId(implUid);
}
示例4: NotifyPositionUpdate
// ---------------------------------------------------------
// CT_LbsStubPositioner::NotifyPositionUpdate
//
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CT_LbsStubPositioner::NotifyPositionUpdate(
TPositionInfoBase& aPosInfo,
TRequestStatus& aStatus)
{
TPositionInfo* position = static_cast<TPositionInfo*> (&aPosInfo);
TUid implUid = { KPosImplementationUid };
position->SetModuleId(implUid);
TRequestStatus* status = &aStatus;
User::RequestComplete(status, KErrNone);
}
示例5:
void CLcfPsyDummy1::GetBasicPositionInfoL(TPositionInfoBase& aPosInfo)
{
// The position info object is at least a TPositionInfo
TPositionInfo* posInfo =
static_cast<TPositionInfo*>(&aPosInfo);
TPosition pos;
// Calculate the position and fill in the position info
// object
// Latitude, Longtitude, altitude
pos.SetCoordinate(57.1, 11.3, 32.5);
// set horizontal and vertical accuracy
pos.SetAccuracy(40.0, 40.0);
// set time of fix
pos.SetCurrentTime();
// Set position in position info.
posInfo->SetPosition(pos);
// Set the implementation uid
posInfo->SetModuleId(ImplementationUid());
}
示例6:
void CLcfPsyDummy3::GetBasicPositionInfoL(TPositionInfoBase& aPosInfo)
{
// The position info object is at least a TPositionInfo
TPositionInfo* posInfo =
static_cast<TPositionInfo*>(&aPosInfo);
TPosition pos;
// Calculate the position and fill in the position info
// object
pos.SetCoordinate(67.567, -12.34, 45.32);
// set horizontal and vertical accuracy
pos.SetAccuracy(150.0, 500.0);
// set time of fix
pos.SetCurrentTime();
// Set position in position info.
posInfo->SetPosition(pos);
// Set the implementation uid
posInfo->SetModuleId(ImplementationUid());
}
示例7: OpenFileForAppend
// ---------------------------------------------------------
// 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);
//.........这里部分代码省略.........
示例8: targetTime
TVerdict ClbsinternalapiTest3Step::doTestStepL()
/**
* @return - TVerdict code
* Override of base class pure virtual
* Our implementation only gets called if the base class doTestStepPreambleL() did
* not leave. That being the case, the current test result value will be EPass.
*/
{
if (TestStepResult()==EPass)
{
//Let's test!
TPositionExtendedSatelliteInfo posSatInfo;
RLbsPositionUpdates::InitializeL(posSatInfo);
RLbsPositionUpdates posUpdates;
//First Open, Close, re-Open to check for handle leaks etc.
posUpdates.OpenL(KLbsGpsLocManagerUid);
CleanupClosePushL(posUpdates);
CleanupStack::PopAndDestroy(&posUpdates);
posUpdates.OpenL(KLbsGpsLocManagerUid);
CleanupClosePushL(posUpdates);
//First, check the default data is OK.
//Should be a default TPositionExtendedSatelliteInfo.
TPositionExtendedSatelliteInfo satInfo;
//Put some non-default data in it, then check we get the default data back.
satInfo.SetSatelliteTime(TTime(500));
TInt error=1;
TTime targetTime(100);
TTime actualTime(200);
TBool conflictControl;
error = posUpdates.GetPositionInfo(conflictControl, &satInfo, sizeof(satInfo),targetTime, actualTime);
//Now check we got deviuce not ready
if(error!=KErrNotReady)
User::Leave(KErrGeneral);
//Now check that the same for TPositionInfo and TPositionCourseInfo
TPositionInfo posInfo;
posInfo.SetModuleId(KLbsGpsLocManagerUid);
error = posUpdates.GetPositionInfo(conflictControl, &posInfo, sizeof(posInfo),targetTime, actualTime);
if(error!=KErrNotReady)
User::Leave(KErrGeneral);
TPositionCourseInfo courseInfo;
TCourse course;
course.SetSpeed(TReal32(100));
courseInfo.SetCourse(course);
error = posUpdates.GetPositionInfo(conflictControl, &courseInfo, sizeof(courseInfo),targetTime, actualTime);
if(error!=KErrNotReady)
User::Leave(KErrGeneral);
//OK - we are now reasonably happy with Getting - it donsn't mash up the class size/type data
//and it seems to be doing the data copying OK.
//Next move onto the set method...
//Choose some dummy values.
error = KErrGeneral;
targetTime = 1000;
actualTime = 1001;
satInfo.SetSatelliteTime(TTime(4020));
User::LeaveIfError(posUpdates.SetPositionInfo(error, EFalse, &satInfo, sizeof(satInfo),targetTime, actualTime));
error = posUpdates.GetPositionInfo(conflictControl, &satInfo, sizeof(satInfo),targetTime, actualTime);
if(error!=KErrGeneral)
User::Leave(KErrGeneral);
if(conflictControl!=EFalse)
User::Leave(KErrGeneral);
if(targetTime!=1000)
User::Leave(KErrGeneral);
if(actualTime!=1001)
User::Leave(KErrGeneral);
if(satInfo.SatelliteTime()!=TTime(4020))
User::Leave(KErrGeneral);
//Go on to check out notifications.
//Open another handle.
RLbsPositionUpdates posUpdates2;
//First Open, Close, re-Open to check for handle leaks etc.
posUpdates2.OpenL(KLbsGpsLocManagerUid);
CleanupClosePushL(posUpdates2);
TRequestStatus stat;
posUpdates2.NotifyPositionUpdate(stat);
User::LeaveIfError(posUpdates.SetPositionInfo(error, EFalse, &satInfo, sizeof(satInfo),targetTime, actualTime));
User::WaitForRequest(stat);
//.........这里部分代码省略.........