当前位置: 首页>>代码示例>>C++>>正文


C++ TName::Compare方法代码示例

本文整理汇总了C++中TName::Compare方法的典型用法代码示例。如果您正苦于以下问题:C++ TName::Compare方法的具体用法?C++ TName::Compare怎么用?C++ TName::Compare使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TName的用法示例。


在下文中一共展示了TName::Compare方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TestStepResult

enum TVerdict CTestIdna07::doTestStepL()
	{

	INFO_PRINTF1(_L(" Testing Punycode to IDN Conversion functionality   "));
	INFO_PRINTF1(_L("****************************************************"));
	
	SetTestStepResult(EFail); // By default start the test case with failure.	
	
	_LIT8(KPunyCodeName,"xn--rksmrgs-5wao1o.josefsson.org");
	TPunyCodeDndName punyCodeName;
	punyCodeName.Copy(KPunyCodeName());
	
	_LIT(KIDNName1,"räksmörgås.josefsson.org");
	
	TName myHostName ;
	TInt start =0;
	
	TInt err=punyCodeName.PunycodeToIdn(myHostName,start);
	if(err != KErrNone)
		{
		User::LeaveIfError(KErrNone); // just to suppress the LeaveScan warning
		INFO_PRINTF1(_L("Conversion of Punycode to IDN is NOT successful "));
		SetTestStepResult(EFail);
		return TestStepResult();
		}
	
	if( myHostName.Compare(KIDNName1()) == 0)
		{
		INFO_PRINTF1(_L(" Conversion of Punycode to IDN is successful"));
		SetTestStepResult(EPass);
		}
	
	return TestStepResult();
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:34,代码来源:te_unittestidna.cpp

示例2: RemoveCallsByLine

// ---------------------------------------------------------------------------
// CMmCallList::RemoveCallsByLine
// Removes Call objects from Call list that has been opened 
// from the Line (which name is given as a input parameter).
// ---------------------------------------------------------------------------
//
void CMmCallList::RemoveCallsByLine(
    const TName* aLineName )
    {
    //if call list exists
    if ( iObjectContainer )
        {
        TInt callCount = iObjectContainer->Count();
        TInt index( 0 );
        //search through call list
        for ( TInt i = 0; i < callCount; i++ )
            {
            //get current call
            CMmCallTsy* mmCall = 
              reinterpret_cast<CMmCallTsy*>( iObjectContainer->At( index ) );

            //get the name of the line from which this call has been opened.
            //see class CMmLineTsy to see how the call object naming works.
            TName curLineName = mmCall->
                                    CallName().Left( aLineName->Length() );

            //if the name is the same as the line name given as input param.
            if ( curLineName.Compare( *aLineName ) == 0 )
                {
                //close this call
                mmCall->Close();
                index--;
                }
            index++;
            }
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:37,代码来源:cmmcalllist.cpp

示例3: NamesMatch

TBool CFsObjectCon::NamesMatch(const TName& anObjectName, const CFsObject* aCurrentObject) const
//
// 
//
	{

	if (aCurrentObject->iName==NULL) // current object has no name, therefore not the same
		return(EFalse);
	return(anObjectName.Compare(*aCurrentObject->iName)==0); // short names are different, therefore not the same
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:10,代码来源:sf_obj.cpp

示例4: index

/**
@SYMTestCaseID BA-CTSY-SESMG-TGTN-0001
@SYMComponent  telephony_ctsy
@SYMTestCaseDesc Test support in CTSY for RTelServer::GetTsyName
@SYMTestPriority High
@SYMTestActions Invokes RTelServer::GetTsyName
@SYMTestExpectedResults Pass
@SYMTestType CT
*/
void CCTsySessionManagementFU::TestGetTsyName0001L()
	{

	OpenEtelServerL(EUseExtendedError);
	CleanupStack::PushL(TCleanupItem(Cleanup,this));

	TInt index(0);
	TName tsyName;
	
	_LIT(KTsyName, "PHONETSY");
	
	TInt ret = iTelServer.GetTsyName(index, tsyName);
	ASSERT_EQUALS(KErrNone, ret);
	ASSERT_EQUALS(0, tsyName.Compare(KTsyName));
	
	CleanupStack::PopAndDestroy(1, this);
	
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:27,代码来源:cctsysessionmanagementfu.cpp

示例5: GetRequestedTableViewsL

void CTsyConfig::GetRequestedTableViewsL()
	{
	
	if (iDbSession == NULL)
		{
#ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
		iDbSession = CMDBSession::NewL(KCDVersion1_2);
#else
		iDbSession = CMDBSession::NewL(KCDVersion1_1);
#endif
		__ASSERT_DEBUG(iDbSession,Panic(ETsyConfigNullDBPointer));
				
		iModemBearer = 0;

		CMDBField<TUint32>* bearerField = new(ELeave) CMDBField<TUint32>(KCDTIdIAPBearer);
		CleanupStack::PushL(bearerField);
		bearerField->SetRecordId(iMMTableSettings.iLocId);
		bearerField->LoadL(*iDbSession);
		iModemBearer = *bearerField;
		CleanupStack::PopAndDestroy(bearerField);
		}
		
		TName modem;
		CMDBField<TDesC>* tsyField = new(ELeave) CMDBField<TDesC>(KCDTIdTsyName);
		CleanupStack::PushL(tsyField);
		tsyField->SetRecordId(iModemBearer);
		tsyField->SetMaxLengthL(KMaxTextLength);
		tsyField->LoadL(*iDbSession);
		modem = *tsyField;
		CleanupStack::PopAndDestroy(tsyField);
		

		if(modem.Compare(_L("MM"))!=KErrNone)
			{
			// Selected bearer does not mention the MMTSY
			LOCAL_LOGTEXT("GetCurrentSettingsL","Bearer for selected IAP does not use MMTSY");
			__ASSERT_DEBUG(EFalse,Panic(ETsyConfigMMTSYNotInModemTables));
			User::Leave(KErrNotFound);
			}



	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:43,代码来源:TSYCONFG.CPP

示例6: GetMmCallByIndexAndLine

// ---------------------------------------------------------------------------
// CMmCallList::GetMmCallByIndexAndLine
// Returns call object by index and line.
// ---------------------------------------------------------------------------
//
CMmCallTsy* CMmCallList::GetMmCallByIndexAndLine(
    TInt aIndex,
    const TName* aLineName )
    {

    CMmCallTsy* mmCall = NULL;
    CMmCallTsy* mmCallSeek = NULL;

    TInt callCount = iObjectContainer->Count();
    TInt index( 0 );

    //search through call list
    for ( TInt i = 0; i < callCount; i++ )
        {
        //get current call
        mmCallSeek = reinterpret_cast<CMmCallTsy*>(
            iObjectContainer->At( i ) );

        //get the name of the line from which this call has been opened.
        //see class CMmLineTsy to see how the call object naming works.
        TName curLineName = mmCallSeek->
                                CallName().Left( aLineName->Length() );

        //if the name is the same as the line name given as input parameter
        if ( curLineName.Compare( *aLineName ) == 0 )
            {
            if ( index == aIndex )
                {
                //Break out
                mmCall = mmCallSeek;
                i = callCount;
                }
            else
                {
                index++;
                }
            }
        }

    return mmCall;
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:46,代码来源:cmmcalllist.cpp

示例7: GetMmCallByName

// ---------------------------------------------------------------------------
// CMmCallList::GetMmCallByName
// Returns call object by name.
// ---------------------------------------------------------------------------
//
CMmCallTsy* CMmCallList::GetMmCallByName(
    const TName* aName )
    {
    CMmCallTsy* mmCall = NULL;
    CMmCallTsy* mmCallSeek = NULL;

    if ( iObjectContainer )
        {
        for ( TInt i = 0; i < iObjectContainer->Count(); i++ )
            {
            mmCallSeek = reinterpret_cast<CMmCallTsy*>(
                iObjectContainer->At( i ) );  

            TName aCurrCallName = mmCallSeek->CallName();
            if ( aCurrCallName.Compare( *aName ) == KErrNone )
                {
                mmCall = mmCallSeek;
                break;
                }
            }
        }

    return mmCall;
    }
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:29,代码来源:cmmcalllist.cpp

示例8: TestAction

void CListCertificates::TestAction()
	{
	TInt count = iCertInfos.Count();
	if (count == iExpectedLabels.Count())
		{
		TInt i;
		for (i = 0; i < count; i++)
			{
			TName expected;
			TName retrieved;
			expected.Copy(iExpectedLabels[i].iName.Ptr());
			retrieved.Copy(iCertInfos[i]->Label());
			if (expected.Compare(retrieved))
				{
				break;
				}

			// this fails the test if any of the certs are marked as not
			// deletable
			if (iCertInfos[i]->IsDeletable() != !iExpectedLabels[i].iReadOnly)
				break;
			}
		if (i == count)
			{
			iResult = ETrue;
			}
		else 
			{
			iResult = EFalse;
			}
		}
	else
		{
		iResult = EFalse;
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:36,代码来源:T_certstoreactionslistcertificates.cpp

示例9: TestStepResult

// do Test step 1.1
enum TVerdict CEtelPacketTest1_3::doTestStepL( void )
{
	RPhone phone;
	TInt ret=phone.Open(iTelServer,DPCKTTSY_PHONE_NAME);
	CHECKPOINT(ret,KErrNone,CHP_OPEN_PHONE);

	RPacketService gprs;
	ret=gprs.Open(phone);
    CHECKPOINT(ret,KErrNone,CHP_SRVS_CASE("A.1"));

	RPacketContext gprsContext;
	TName contextName;
	ret=gprsContext.OpenNewContext(gprs, contextName);
	CHECKPOINT(ret,KErrNone,CHP_CNTXT_CASE("B.1"));

	RPacketQoS	gprsQoS;
	TName qosName;
	ret = gprsQoS.OpenNewQoS(gprsContext, qosName);
	CHECKPOINT(ret,KErrNone,CHP_QOS_CASE("C.1"));
	CHECKPOINT(qosName.Compare(DPCKTTSY_QOS_NAME),KErrNone,CHP_QOS_CASE("C.1"));
	// local variables used throughout the gprs tests
	TRequestStatus reqStatus;
	TRequestStatus notifyStatus;
	// post a notification
	RPacketQoS::TQoSGPRSNegotiated aNotifyQoS;
	TPckg<RPacketQoS::TQoSGPRSNegotiated> aNotifyQoSPckg(aNotifyQoS);

	gprsQoS.NotifyProfileChanged(notifyStatus, aNotifyQoSPckg);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrNone,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iDelay , DPCKTTSY_DELAY_MIN1,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iMeanThroughput , DPCKTTSY_MEAN_THROUGHPUT_MIN1,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iPeakThroughput , DPCKTTSY_PEAK_THROUGHPUT_MIN1,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iPrecedence , DPCKTTSY_PRECEDENCE_MIN1,CHP_QOS_CASE("C.7"));
	CHECKPOINT(aNotifyQoS.iReliability , DPCKTTSY_RELIABILITY_MIN1,CHP_QOS_CASE("C.7"));
	//fix for defect MPO-576M6R: added cancel case 
	gprsQoS.NotifyProfileChanged(notifyStatus, aNotifyQoSPckg);
	gprsQoS.CancelAsyncRequest(EPacketQoSNotifyProfileChanged);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrCancel,CHP_QOS_CASE("C.3"));
	// Get QoS GPRS Capabilities
	RPacketQoS::TQoSCapsGPRS aQoSCaps;
	TPckg<RPacketQoS::TQoSCapsGPRS> aQoSCapsPckg(aQoSCaps);
	
	gprsQoS.GetProfileCapabilities(reqStatus, aQoSCapsPckg);
	User::WaitForRequest(reqStatus);
	CHECKPOINT(reqStatus.Int(),KErrNone,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.ExtensionId(),TPacketDataConfigBase::KConfigGPRS,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iDelay,DPCKTTSY_DELAY,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iMean,DPCKTTSY_MEAN_THROUGHPUT,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iPeak,DPCKTTSY_PEAK_THROUGHPUT,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iPrecedence,DPCKTTSY_PRECEDENCE,CHP_QOS_CASE("C.6"));
	CHECKPOINT(aQoSCaps.iReliability,DPCKTTSY_RELIABILITY,CHP_QOS_CASE("C.6"));
	//fix for defect MPO-576M6R: added cancel case 
	gprsQoS.GetProfileCapabilities(reqStatus, aQoSCapsPckg);
	gprsQoS.CancelAsyncRequest(EPacketQoSGetProfileCaps);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrCancel,CHP_QOS_CASE("C.3"));
	// Set QoS Profile Params
	RPacketQoS::TQoSGPRSRequested aQoSReqConfig;
	TPckg<RPacketQoS::TQoSGPRSRequested> aQoSReqPckg(aQoSReqConfig);

	aQoSReqConfig.iMinDelay = DPCKTTSY_DELAY_MIN1;
	aQoSReqConfig.iMinMeanThroughput = DPCKTTSY_MEAN_THROUGHPUT_MIN1;
	aQoSReqConfig.iMinPeakThroughput = DPCKTTSY_PEAK_THROUGHPUT_MIN1;
	aQoSReqConfig.iMinPrecedence = DPCKTTSY_PRECEDENCE_MIN1;
	aQoSReqConfig.iMinReliability = DPCKTTSY_RELIABILITY_MIN1;
	aQoSReqConfig.iReqDelay = DPCKTTSY_DELAY_REQ1;
	aQoSReqConfig.iReqMeanThroughput = DPCKTTSY_MEAN_THROUGHPUT_REQ1;
	aQoSReqConfig.iReqPeakThroughput = DPCKTTSY_PEAK_THROUGHPUT_REQ1;
	aQoSReqConfig.iReqPrecedence = DPCKTTSY_PRECEDENCE_REQ1;
	aQoSReqConfig.iReqReliability = DPCKTTSY_RELIABILITY_REQ1;

	gprsQoS.SetProfileParameters(reqStatus, aQoSReqPckg);
	User::WaitForRequest(reqStatus);
	CHECKPOINT(reqStatus.Int(),KErrNone,CHP_QOS_CASE("C.4"));
	//fix for defect MPO-576M6R: added cancel case 
	gprsQoS.SetProfileParameters(reqStatus, aQoSReqPckg);
	gprsQoS.CancelAsyncRequest(EPacketQoSSetProfileParams);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrCancel,CHP_QOS_CASE("C.3"));
	// Get QoS Profile Params
	RPacketQoS::TQoSGPRSNegotiated aQoSNegConfig;
	TPckg<RPacketQoS::TQoSGPRSNegotiated> aQoSNegPckg(aQoSNegConfig);

	gprsQoS.GetProfileParameters(reqStatus, aQoSNegPckg);
	User::WaitForRequest(reqStatus);
	CHECKPOINT(reqStatus.Int(),KErrNone,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.ExtensionId(),TPacketDataConfigBase::KConfigGPRS,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iDelay,DPCKTTSY_DELAY_NEG2,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iMeanThroughput,DPCKTTSY_MEAN_THROUGHPUT_NEG2,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iPeakThroughput,DPCKTTSY_PEAK_THROUGHPUT_NEG2,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iPrecedence,DPCKTTSY_PRECEDENCE_NEG2,CHP_QOS_CASE("C.5"));
	CHECKPOINT(aQoSNegConfig.iReliability,DPCKTTSY_RELIABILITY_NEG2,CHP_QOS_CASE("C.5"));
	//fix for defect MPO-576M6R: added cancel case 
	gprsQoS.GetProfileParameters(reqStatus, aQoSNegPckg);
	gprsQoS.CancelAsyncRequest(EPacketQoSGetProfileParams);
	User::WaitForRequest(notifyStatus);
	CHECKPOINT(notifyStatus.Int(),KErrCancel,CHP_QOS_CASE("C.3"));
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:101,代码来源:Te_EtelPacketTest1_3.cpp

示例10: doTestStepL

TVerdict CSimPacketGPRSQOSTest::doTestStepL()
{
    INFO_PRINTF1(_L("BeginPacketGPRSQOSTest"));

    CreateConfigFileL(_L("c:\\config3.txt"));
    SetTestNumberL(6);

    TInt ret = iPhone.Open(iTelServer,KPhoneName);
    INFO_PRINTF2(_L("Result: %d"),ret);
    TESTL(ret == KErrNone);
    INFO_PRINTF1(_L("Opened phone object"));
    TESTL(iPacketService.Open(iPhone)==KErrNone);
    INFO_PRINTF1(_L("Opened Packet object"));
    TName contextName;
    TName contextNameCompare;
    TESTL(iFirstPrimaryPacketContext.OpenNewContext(iPacketService, contextName)==KErrNone);
    contextNameCompare.Append(KSimPrimaryPacketContextName);
    contextNameCompare.AppendNum(1);
    TESTL(contextName.Compare(contextNameCompare)==KErrNone);
    INFO_PRINTF1(_L("Opened Context object"));

    TRequestStatus reqStatus;
    TRequestStatus notifyStatus;
    TName gprsQosName;
    TESTL(iGPRSPacketqos.OpenNewQoS(iFirstPrimaryPacketContext, gprsQosName)==KErrNone);
    TName gprsQosNameCompare;
    gprsQosNameCompare.Append(KSimPacketQosName);
    gprsQosNameCompare.AppendNum(1);
    TESTL(gprsQosName.Compare(gprsQosNameCompare)==KErrNone);
    INFO_PRINTF1(_L("Opened GPRS QoS object"));

    TName qosname;
    iFirstPrimaryPacketContext.GetProfileName(qosname);
    INFO_PRINTF1(_L("Retrieved GPRS QoS object reference name"));

    // Set QoS Profile Params
    RPacketQoS::TQoSGPRSRequested aGPRSQoSReqConfig;
    TPckg<RPacketQoS::TQoSGPRSRequested> aGPRSQoSReqPckg(aGPRSQoSReqConfig);

    // post a notification
    RPacketQoS::TQoSGPRSNegotiated aGPRSNotifyQoS;
    TPckg<RPacketQoS::TQoSGPRSNegotiated> aGPRSNotifyQoSPckg(aGPRSNotifyQoS);

    //Profile data
    aGPRSQoSReqConfig.iMinDelay = RPacketQoS::EDelayClass1;
    aGPRSQoSReqConfig.iMinMeanThroughput = RPacketQoS::EMeanThroughput200;
    aGPRSQoSReqConfig.iMinPeakThroughput = RPacketQoS::EPeakThroughput16000;
    aGPRSQoSReqConfig.iMinPrecedence = RPacketQoS::EPriorityLowPrecedence;
    aGPRSQoSReqConfig.iMinReliability = RPacketQoS::EReliabilityClass1;
    aGPRSQoSReqConfig.iReqDelay = RPacketQoS::EDelayClass2;
    aGPRSQoSReqConfig.iReqMeanThroughput = RPacketQoS::EMeanThroughput2000;
    aGPRSQoSReqConfig.iReqPeakThroughput = RPacketQoS::EPeakThroughput64000;
    aGPRSQoSReqConfig.iReqPrecedence = RPacketQoS::EPriorityMediumPrecedence;
    aGPRSQoSReqConfig.iReqReliability = RPacketQoS::EReliabilityClass2;

    //post the notification
    iGPRSPacketqos.NotifyProfileChanged(notifyStatus, aGPRSNotifyQoSPckg);
    //Set the config
    iGPRSPacketqos.SetProfileParameters(reqStatus, aGPRSQoSReqPckg);

    User::WaitForRequest(notifyStatus);
    User::WaitForRequest(reqStatus);

    TESTL(aGPRSNotifyQoS.ExtensionId()==TPacketDataConfigBase::KConfigGPRS);
    TESTL(aGPRSNotifyQoS.iDelay == RPacketQoS::EDelayClass2);
    TESTL(aGPRSNotifyQoS.iDelay == RPacketQoS::EDelayClass2);
    TESTL(aGPRSNotifyQoS.iMeanThroughput == RPacketQoS::EMeanThroughput2000);
    TESTL(aGPRSNotifyQoS.iPeakThroughput == RPacketQoS::EPeakThroughput64000);
    TESTL(aGPRSNotifyQoS.iPrecedence == RPacketQoS::EPriorityMediumPrecedence);
    TESTL(aGPRSNotifyQoS.iReliability == RPacketQoS::EReliabilityClass2);

    // post a notification
    TRequestStatus cancelStatus;
    iGPRSPacketqos.NotifyProfileChanged(cancelStatus, aGPRSNotifyQoSPckg);
    iGPRSPacketqos.CancelAsyncRequest(EPacketQoSNotifyProfileChanged);
    User::WaitForRequest(cancelStatus);

    TESTL(cancelStatus.Int()==KErrCancel);
    INFO_PRINTF1(_L("Set Profile Test passed"));

    // need to call Notify first to set pending to true after
    // cancel event which sets it to false
    iGPRSPacketqos.NotifyProfileChanged(notifyStatus, aGPRSNotifyQoSPckg);
    iGPRSPacketqos.SetProfileParameters(reqStatus, aGPRSQoSReqPckg);
    User::WaitForRequest(notifyStatus);
    TESTL(notifyStatus.Int()==KErrNone);
    User::WaitForRequest(reqStatus);
    TESTL(reqStatus.Int()==KErrNone);

    // test RPacketContext::Activate - before calling ModifyActiveContext
    StartNTRasSimulation();
    iFirstPrimaryPacketContext.Activate(reqStatus);
    User::WaitForRequest(reqStatus);
    TESTL(reqStatus.Int()==KErrNone);
    INFO_PRINTF1(_L("Activate test passed"));

    // test RPacketContext::ModifyActiveContext - it shouldn't work unless
    // a profile/tft has changed since activation
    TRequestStatus modifyStatus;
    iFirstPrimaryPacketContext.ModifyActiveContext(modifyStatus);
//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:101,代码来源:Te_SimPacketGPRSQOSTest.cpp

示例11: TestStepResult

TVerdict CSimPacketGPRSRel99NotifyProfileChangeTest::doTestStepL()
	{
	INFO_PRINTF1(_L("BeginPacketGPRSRel99NotifyProfileChangeTest"));

 	CreateConfigFileL(_L("c:\\config3.txt"));
 	SetTestNumberL(6);

	TRequestStatus gprsReqStatus, rel99ReqStatus;
	TRequestStatus gprsNotifyStatus, rel99NotifyStatus;

	// Open phone
	TInt ret = iPhone.Open(iTelServer,KPhoneName); 
	INFO_PRINTF2(_L("Result: %d"),ret);
	TESTL(ret == KErrNone); 
	INFO_PRINTF1(_L("Opened phone object"));

	// Open GPRS packet service
	TESTL(iGPRSPacketService.Open(iPhone)==KErrNone);
	INFO_PRINTF1(_L("Opened Packet object"));

	// Open GPRS context
	TName contextName;
	TName contextNameCompare;
	TESTL(iGPRSPacketContext.OpenNewContext(iGPRSPacketService, contextName)==KErrNone);
	contextNameCompare.Append(KSimPrimaryPacketContextName);
	contextNameCompare.AppendNum(1);
	TESTL(contextName.Compare(contextNameCompare)==KErrNone);
	INFO_PRINTF1(_L("Opened Context object"));

	// Open GPRS PacketQoS
	TName gprsQosName;
	TESTL(iGPRSPacketqos.OpenNewQoS(iGPRSPacketContext, gprsQosName)==KErrNone);

	TName gprsQosNameCompare;
	gprsQosNameCompare.Append(KSimPacketQosName);
	gprsQosNameCompare.AppendNum(1);
	TESTL(gprsQosName.Compare(gprsQosNameCompare)==KErrNone);
	INFO_PRINTF1(_L("Opened GPRS QoS object"));
	
	// Open UMTS Rel99 packet service - opened from same session RTelServer object as GPRS packet service
	TESTL(iRel99PacketService.Open(iPhone)==KErrNone);
	INFO_PRINTF1(_L("Opened Rel99 Packet object"));

	// Open UMTS Rel99 context
	TESTL(iRel99PacketContext.OpenExistingContext(iRel99PacketService, contextName) == KErrNone);

	// Open Rel99 PacketQoS
	TESTL(iRel99Packetqos.OpenExistingQoS(iRel99PacketContext, gprsQosName)==KErrNone);
	INFO_PRINTF1(_L("Opened Rel99 QoS object"));

	//Configure GPRS parameters
	//
	//
	// Set GPRS QoS Profile Params
	RPacketQoS::TQoSGPRSRequested aGPRSQoSReqConfig;
	TPckg<RPacketQoS::TQoSGPRSRequested> aGPRSQoSReqPckg(aGPRSQoSReqConfig);

	// post a GPRS notification
 	RPacketQoS::TQoSGPRSNegotiated aGPRSNotifyQoS;
	TPckg<RPacketQoS::TQoSGPRSNegotiated> aGPRSNotifyQoSPckg(aGPRSNotifyQoS);

	//GPRS Profile data
	aGPRSQoSReqConfig.iMinDelay = RPacketQoS::EDelayClass1;
	aGPRSQoSReqConfig.iMinMeanThroughput = RPacketQoS::EMeanThroughput200;
	aGPRSQoSReqConfig.iMinPeakThroughput = RPacketQoS::EPeakThroughput16000;
	aGPRSQoSReqConfig.iMinPrecedence = RPacketQoS::EPriorityLowPrecedence;
	aGPRSQoSReqConfig.iMinReliability = RPacketQoS::EReliabilityClass1;
	aGPRSQoSReqConfig.iReqDelay = RPacketQoS::EDelayClass2;
	aGPRSQoSReqConfig.iReqMeanThroughput = RPacketQoS::EMeanThroughput2000;
	aGPRSQoSReqConfig.iReqPeakThroughput = RPacketQoS::EPeakThroughput64000;
	aGPRSQoSReqConfig.iReqPrecedence = RPacketQoS::EPriorityMediumPrecedence;
	aGPRSQoSReqConfig.iReqReliability = RPacketQoS::EReliabilityClass2;
	//
	//


	//Configure Rel99 QoS Profile Params
	//
	//
	RPacketQoS::TQoSR99_R4Requested aR99QoSReqConfig;
	TESTL(aR99QoSReqConfig.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4);
	TPckg<RPacketQoS::TQoSR99_R4Requested> aR99QoSReqPckg(aR99QoSReqConfig);

	RPacketQoS::TQoSR99_R4Negotiated aR99NotifyQoS;
	TPckg<RPacketQoS::TQoSR99_R4Negotiated> aR99NotifyQoSPckg(aR99NotifyQoS);

	TInt req = 4;
	TInt min = 2; 

	//Profile data
	aR99QoSReqConfig.iReqTrafficClass = RPacketQoS::ETrafficClassStreaming; // 0x04
	aR99QoSReqConfig.iMinTrafficClass = RPacketQoS::ETrafficClassConversational; // 0x02
	aR99QoSReqConfig.iReqDeliveryOrderReqd = RPacketQoS::EDeliveryOrderNotRequired; // 0x04
	aR99QoSReqConfig.iMinDeliveryOrderReqd = RPacketQoS::EDeliveryOrderRequired;	// 0x02
	aR99QoSReqConfig.iReqDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryNotRequired; // 0x08
	aR99QoSReqConfig.iMinDeliverErroneousSDU = RPacketQoS::EErroneousSDUDeliveryRequired; // 0x04
	aR99QoSReqConfig.iReqMaxSDUSize = req; // 4	
	aR99QoSReqConfig.iMinAcceptableMaxSDUSize = min; // 2
	aR99QoSReqConfig.iReqMaxRate.iUplinkRate = min;	// between 0 - 1840
	aR99QoSReqConfig.iReqMaxRate.iDownlinkRate = min;
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:101,代码来源:Te_SimPacketGPRSRel99NotifyProfileChangeTest.cpp


注:本文中的TName::Compare方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。