示例#1
0
void RMobilePhone::GetMailboxNumbers(
    TRequestStatus& aReqStatus, 
    TDes8& aMailBox) const
{
    RMobilePhone::TMobilePhoneVoicemailIdsV3 info;
    RMobilePhone::TMobilePhoneVoicemailIdsV3Pckg infoPckg(info);
    info.iVoice = 1;
    aMailBox.Copy(infoPckg);
    TRequestStatus* tmp = &aReqStatus;
    User::RequestComplete(tmp, KErrNone);
    qDebug("RMobilePhoneStore::GetMailboxNumbers mock");
}
示例#2
0
TVerdict CPhoneStoreTest::doTestStepL( void )
	{
	// Get phone store info for various phonebooks
	RMobilePhoneStore::TMobilePhoneStoreInfoV1 info;
	RMobilePhoneStore::TMobilePhoneStoreInfoV1Pckg infoPckg(info);

    INFO_PRINTF1(_L("Test the phone stores"));

	iPhone.GetPhoneStoreInfo(iStatus, infoPckg, KETelIccAdnPhoneBook);
	User::WaitForRequest(iStatus);
	if(iStatus.Int())
		{
		return EFail;
		}
	

	INFO_PRINTF2(TRefByValue<const TDesC>(_L("Store Name: %S")), &info.iName);
	TESTL(info.iType==RMobilePhoneStore::EPhoneBookStore);
	INFO_PRINTF2(TRefByValue<const TDesC>(_L("Number of used entries: %d")), info.iUsedEntries);
	INFO_PRINTF2(TRefByValue<const TDesC>(_L("Number of total entries: %d")), info.iTotalEntries);

	RMobilePhoneBookStore::TMobilePhoneBookInfoV1 phbkInfo;
	RMobilePhoneBookStore::TMobilePhoneBookInfoV1Pckg phbkInfoPckg(phbkInfo);


	iPhone.GetPhoneStoreInfo(iStatus, phbkInfoPckg, KETelIccAdnPhoneBook);
	User::WaitForRequest(iStatus);
	if(iStatus.Int())
		{
		return EFail;
		}

	INFO_PRINTF2(TRefByValue<const TDesC>(_L("Store Name: %S")), &phbkInfo.iName);
	TESTL(phbkInfo.iType==RMobilePhoneStore::EPhoneBookStore);
	INFO_PRINTF2(TRefByValue<const TDesC>(_L("Number of used entries: %d")), phbkInfo.iUsedEntries);
	INFO_PRINTF2(TRefByValue<const TDesC>(_L("Number of total entries: %d")), phbkInfo.iTotalEntries);
	INFO_PRINTF2(TRefByValue<const TDesC>(_L("Max text length: %d")), phbkInfo.iMaxTextLength);
	INFO_PRINTF2(TRefByValue<const TDesC>(_L("Max number length: %d")), phbkInfo.iMaxNumLength);
	return TestStepResult();
	}
void CIAPAvailabilityTestMonitor::GetPckgAttribute( const TUint /*aConnectionId*/,const TUint /*aSubConnectionId*/,const TUint aAttribute,TDes8& aValue,TRequestStatus& aStatus ) const
{
	iClientStatus = &aStatus;
	*iClientStatus = KRequestPending;
	switch(aAttribute)
	{
		case KIapAvailability:
		{
			TConnMonIapInfo info;
			TPckg<TConnMonIapInfo> infoPckg(info);
			
			info.iCount = 1;
			info.iIap[0].iIapId = 0xdeadbeef;
			aValue.Copy(infoPckg);
			User::RequestComplete(iClientStatus,KErrNone);
			iClientStatus = NULL;
			break;
		}
		default:
			CActiveScheduler::Stop();
	}
}
void CNetworkTestMonitor::GetPckgAttribute( const TUint /*aConnectionId*/,const TUint /*aSubConnectionId*/,const TUint aAttribute,TDes8& aValue,TRequestStatus& aStatus ) const
{
	iClientStatus = &aStatus;
	*iClientStatus = KRequestPending;
	switch(aAttribute)
	{
		case KNetworkNames:
		{
			TConnMonNetworkNames info;
			TPckg<TConnMonNetworkNames> infoPckg(info);
			info.iCount = 1;
			info.iNetwork[0].iName.Copy(_L("Marks network"));
			info.iNetwork[0].iSignalStrength = 10;
			aValue.Copy(infoPckg);
			TRequestStatus* status = &aStatus; 
			User::RequestComplete(status,KErrNone);
			break;
		}
		default:
			TRequestStatus* status = &aStatus; 
			User::RequestComplete(status,KErrNone);
	}
}
TVerdict CSimONStoreTest::doTestStepL()
	{
	INFO_PRINTF1(_L("BeginONStoreTest"));

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

	TInt ret = iPhone.Open(iTelServer,KPhoneName); 
	INFO_PRINTF2(_L("Result: %d"),ret); 
	TESTL(ret == KErrNone); 
	INFO_PRINTF1(_L("Opened phone object"));
	CleanupClosePushL(iPhone);
	
	TUint32 caps;
	INFO_PRINTF1(_L("Testing Get ICC Access Capabilites from Phone level."));
	iPhone.GetIccAccessCaps(caps);
	TESTL(caps==7);

	ret=iOwnNumberStore.Open(iPhone);
	TESTL(ret==KErrNone);
	INFO_PRINTF1(_L("Opened Mobile Station International Subscriber Directory Number (MSISDN) Store object"));
	CleanupClosePushL(iOwnNumberStore);
	
	INFO_PRINTF1(_L("Retrieve MSISDN Information"));
	RMobileONStore::TMobileONStoreInfoV1 info;
	RMobileONStore::TMobileONStoreInfoV1Pckg infoPckg(info);

	TRequestStatus accessStatus;
	iOwnNumberStore.GetInfo(accessStatus,infoPckg);
	User::WaitForRequest(accessStatus);
	TESTL(accessStatus==KErrNone);
	
	INFO_PRINTF1(_L("Testing MSISDN Read"));
	TESTL(info.iNumberLen==50);
	TESTL(info.iTextLen==60);
	TESTL(info.iTotalEntries==5);

	// Try reading ON store one entry at a time
	for (TInt i = 1; i <= info.iTotalEntries && i<=KONMaxNoOfNumbersToTest; i++)
		{
		RMobileONStore::TMobileONEntryV1 ownNumberEntry;
	
		ownNumberEntry.iIndex = i;
		RMobileONStore::TMobileONEntryV1Pckg ownNumberEntryPckg(ownNumberEntry);

		iOwnNumberStore.Read(accessStatus, ownNumberEntryPckg);
		User::WaitForRequest(accessStatus);
		
		if(accessStatus == KErrNone)
			{
			ownNumberEntry.iIndex = i;
			INFO_PRINTF5(_L("OWN number entry: index=%d, service=%d, number=%S, text=%S"), ownNumberEntry.iIndex, ownNumberEntry.iService, &ownNumberEntry.iNumber.iTelNumber, &ownNumberEntry.iText);
			}
		}	
	
	CleanupStack::Pop();
	iOwnNumberStore.Close();
	CleanupStack::Pop();
	iPhone.Close();
	ASSERT(RThread().RequestCount()==0);

	return TestStepResult();
	}
TVerdict CSimOutGoingDataTest::doTestStepL()
	{
	INFO_PRINTF1(_L("BeginOutGoingDataTest"));

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

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

	TESTL(iPhone.Initialise()==KErrNone);
	INFO_PRINTF1(_L("Opened phone object"));

	TESTL(iLine.Open(iPhone,KDataLineName)==KErrNone);
	INFO_PRINTF1(_L("Opened Line object"));

	TName callName;
	TESTL(iCall.OpenNewCall(iLine,callName)==KErrNone);
	INFO_PRINTF1(_L("Opened Call object"));

// Test a Dial with Core Call Params...
	INFO_PRINTF1(_L("Get Bearer Information"));
	RCall::TBearerService bearerServiceInfo;
	TESTL(iCall.GetBearerServiceInfo(bearerServiceInfo)==KErrEtelCallNotActive);

 	INFO_PRINTF1(_L("Get DataCall Capabilities"));
 	RMobileCall::TMobileCallDataCapsV1 callCaps;
 	RMobileCall::TMobileCallDataCapsV1Pckg callCapsPckg(callCaps);
 	ret=iCall.GetMobileDataCallCaps(callCapsPckg);
 	CHECKPOINTL(ret,KErrNone,CHP_DATA_CASE("B.7"));
 
 	INFO_PRINTF1(_L("Get DataCall RLP Range"));
 	TRequestStatus stat0;
 	RMobileCall::TMobileDataRLPRangesV1 rlp;
 	RMobileCall::TMobileDataRLPRangesV1Pckg rlpPckg(rlp);
 	iCall.GetMobileDataCallRLPRange(stat0,1,rlpPckg);
 	User::WaitForRequest(stat0);
 	CHECKPOINTL(stat0,KErrNone,CHP_DATA_CASE("B.6"));
 
 	INFO_PRINTF1(_L("Get DataCall Hscsd information"));
 	RMobileCall::TMobileCallHscsdInfoV1 info;
 	RMobileCall::TMobileCallHscsdInfoV1Pckg infoPckg(info);
 	ret=iCall.GetCurrentHscsdInfo(infoPckg);
 	CHECKPOINTL(ret,KErrNone,CHP_DATA_CASE("B.9"));
 
 	INFO_PRINTF1(_L("Get Hscsd Call Params"));
 	RMobileCall::TMobileHscsdCallParamsV1 callParams;
 	RMobileCall::TMobileHscsdCallParamsV1Pckg callParamsPckg(callParams);
 
 	TESTL(iCall.GetCallParams(callParamsPckg)==KErrEtelCallNotActive);

	StartNTRasSimulation();
 	INFO_PRINTF2(_L("Dialling %S "),&KTelephoneNumber);
 	TRequestStatus reqStatus0;
 	callParams.iSpeakerControl=RCall::EMonitorSpeakerControlAlwaysOn;
 	callParams.iSpeakerVolume=RCall::EMonitorSpeakerVolumeHigh;
 	callParams.iWaitForDialTone=RCall::EDialToneWait;
 	callParams.iInterval=1234;
 	callParams.iWantedAiur=RMobileCall::EAiurBps9600;
 	callParams.iWantedRxTimeSlots=5;
 	callParams.iMaxTimeSlots=30;
 	callParams.iCodings=RMobileCall::ETchCoding48;

 	iCall.Dial(reqStatus0,callParamsPckg,KTelephoneNumber);
 	User::WaitForRequest(reqStatus0);		// Wait for the Call Status Change notification
 	TESTL(reqStatus0==KErrNone);
	INFO_PRINTF2(_L("Result: %d"),reqStatus0.Int());
 	CHECKPOINTL(reqStatus0,KErrNone,CHP_DATA_CASE("B.1"));
 
 	INFO_PRINTF1(_L("Get Bearer Information again..."));
 	TESTL(iCall.GetBearerServiceInfo(bearerServiceInfo)==KErrNone);
 	TESTL(bearerServiceInfo.iBearerCaps==RCall::KBearerCapsCompressionV42bis);
 	TESTL(bearerServiceInfo.iBearerSpeed==RCall::EBearerData19200);
 
 	INFO_PRINTF1(_L("Check call state..."));
 	RMobileCall::TMobileCallStatus state;
 	TESTL(iCall.GetMobileCallStatus(state)==KErrNone);
 	TESTL(state==RMobileCall::EStatusConnected);
 
 	INFO_PRINTF1(_L("Check call params..."));
 	TESTL(iCall.GetCallParams(callParamsPckg)==KErrNone);
 	TESTL(callParams.iSpeakerControl==RCall::EMonitorSpeakerControlAlwaysOn);
 	TESTL(callParams.iSpeakerVolume==RCall::EMonitorSpeakerVolumeHigh);
 	TESTL(callParams.iWaitForDialTone==RCall::EDialToneWait);
 	TESTL(callParams.iInterval==1234);
 
 	INFO_PRINTF1(_L("Notification for Hscsd info changes"));
 	TRequestStatus reqStatus1;
 	iCall.NotifyHscsdInfoChange(reqStatus1,infoPckg);
 
 	INFO_PRINTF1(_L("Set DataCall Hscsd Dynamic Parameters"));
 	iCall.SetDynamicHscsdParams(reqStatus0,RMobileCall::EAiurBps57600, 15);
 	User::WaitForRequest(reqStatus0);
 	CHECKPOINTL(reqStatus0,KErrNone,CHP_DATA_CASE("B.8"));
 	User::WaitForRequest(reqStatus1);
 	CHECKPOINTL(reqStatus1,KErrNone,CHP_DATA_CASE("B.10"));
 	INFO_PRINTF1(_L("Completed notification..."));
 
 	INFO_PRINTF1(_L("Hanging up call"));
 
 	TESTL(iCall.HangUp()==KErrNone);
 
 	INFO_PRINTF1(_L("Check call state..."));
 	TESTL(iCall.GetMobileCallStatus(state)==KErrNone);
 	TESTL(state==RMobileCall::EStatusIdle);
 
 // Start another session, this time using Multimode Call Params, so re-start the
 // NTRasSimulator
 	StartNTRasSimulation();
 
 	INFO_PRINTF2(_L("Dialling %S "),&KTelephoneNumber);
 	RMobileCall::TMobileCallParamsV1 mobileCallParams;
 	RMobileCall::TMobileCallParamsV1Pckg mobileCallParamsPckg(mobileCallParams);
 	mobileCallParams.iSpeakerControl=RCall::EMonitorSpeakerControlOnExceptDuringDialling;
 	mobileCallParams.iSpeakerVolume=RCall::EMonitorSpeakerVolumeUnknown;
 	mobileCallParams.iWaitForDialTone=RCall::EDialToneNoWait;
 	mobileCallParams.iInterval=5678;
 	mobileCallParams.iAutoRedial=ETrue;
 	mobileCallParams.iCug.iCugIndex=99;
 	mobileCallParams.iIdRestrict=RMobileCall::ESendMyId;
 	iCall.Dial(reqStatus0,mobileCallParamsPckg,KTelephoneNumber);
 	User::WaitForRequest(reqStatus0);		// Wait for the Call Status Change notification
 	TESTL(reqStatus0==KErrNone);
 	CHECKPOINTL(reqStatus0,KErrNone,CHP_DATA_CASE("B.2"));
 
 	INFO_PRINTF1(_L("Check call state..."));
 	TESTL(iCall.GetMobileCallStatus(state)==KErrNone);
 	TESTL(state==RMobileCall::EStatusConnected);
 
 	INFO_PRINTF1(_L("Check call params..."));
 	TESTL(iCall.GetCallParams(mobileCallParamsPckg)==KErrNone);
 	TESTL(mobileCallParams.iSpeakerControl==RCall::EMonitorSpeakerControlOnExceptDuringDialling);
 	TESTL(mobileCallParams.iSpeakerVolume==RCall::EMonitorSpeakerVolumeUnknown);
 	TESTL(mobileCallParams.iWaitForDialTone==RCall::EDialToneNoWait);
 	TESTL(mobileCallParams.iInterval==5678);
 	TESTL(mobileCallParams.iAutoRedial/*==ETrue*/);
 	TESTL(mobileCallParams.iCug.iCugIndex==99);
 	TESTL(mobileCallParams.iIdRestrict==RMobileCall::ESendMyId);
 
 	TESTL(iCall.HangUp()==KErrNone);
 
 	INFO_PRINTF1(_L("Check call state..."));
 	TESTL(iCall.GetMobileCallStatus(state)==KErrNone);
 	TESTL(state==RMobileCall::EStatusIdle);
 	CHECKPOINTL(state,RMobileCall::EStatusIdle,CHP_DATA_CASE("B.3"));
 
 	iCall.Close();
 	iLine.Close();
 	iPhone.Close();
	ASSERT(RThread().RequestCount()==0);

	return TestStepResult();
	}
TVerdict CSimIncomingDataTest::doTestStepL()
	{
	INFO_PRINTF1(_L("BeginIncomingDataTest"));

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

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

	TESTL(iPhone.Initialise()==KErrNone);
	INFO_PRINTF1(_L("Opened phone object"));

	TESTL(iLine.Open(iPhone,KDataLineName)==KErrNone);
	INFO_PRINTF1(_L("Opened Line object"));

	TName callName;
	TESTL(iCall.OpenNewCall(iLine,callName)==KErrNone);
	INFO_PRINTF1(_L("Opened Call object"));

	INFO_PRINTF1(_L("Get DataCall Capabilities"));
	RMobileCall::TMobileCallDataCapsV1 callCaps;
	RMobileCall::TMobileCallDataCapsV1Pckg callCapsPckg(callCaps);
	TESTL(iCall.GetMobileDataCallCaps(callCapsPckg)==KErrNone);
	 
	INFO_PRINTF1(_L("Get DataCall RLP Range"));
	TRequestStatus stat0;
	RMobileCall::TMobileDataRLPRangesV1 rlp;
	RMobileCall::TMobileDataRLPRangesV1Pckg rlpPckg(rlp);
	iCall.GetMobileDataCallRLPRange(stat0,1,rlpPckg);
	User::WaitForRequest(stat0);
	TESTL(stat0==KErrNone);
	
	INFO_PRINTF1(_L("Get DataCall Hscsd information"));
	RMobileCall::TMobileCallHscsdInfoV1 info;
	RMobileCall::TMobileCallHscsdInfoV1Pckg infoPckg(info);
	TESTL(iCall.GetCurrentHscsdInfo(infoPckg)==KErrNone);

	TRequestStatus reqStatus0, reqStatus1;
	RMobileCall::TMobileCallStatus lineStatus;
	iLine.NotifyMobileLineStatusChange(reqStatus0,lineStatus);

	TName incomingCallName;
	iLine.NotifyIncomingCall(reqStatus1,incomingCallName);

	TInt state = 999;
	INFO_PRINTF1(_L("Testing the Publish & Subscribe..."));
	RProperty::Set(KUidPSSimTsyCategory, KPSSimTsyIncomingDataCall, state);
	
	User::WaitForRequest(reqStatus1);
	if(reqStatus1!=KErrNone)
		{
		INFO_PRINTF1(_L("Incoming data call test failed..."));
		TESTL(reqStatus1==KErrNone);		// Force a failure...
		}
	CHECKPOINTL(reqStatus1,KErrNone,CHP_DATA_CASE("B.4"));

	User::WaitForRequest(reqStatus0);
	TESTL(reqStatus0==KErrNone);
	TESTL(lineStatus==RMobileCall::EStatusRinging);

	TESTL(iCallAnswer.OpenExistingCall(iLine,incomingCallName)==KErrNone);

	INFO_PRINTF1(_L("Answering incoming call..."));
	RMobileCall::TMobileHscsdCallParamsV1 mobileCallParams;
	RMobileCall::TMobileHscsdCallParamsV1Pckg mobileCallParamsPckg(mobileCallParams);

	mobileCallParams.iSpeakerControl=RCall::EMonitorSpeakerControlOnExceptDuringDialling;
	mobileCallParams.iSpeakerVolume=RCall::EMonitorSpeakerVolumeUnknown;
	mobileCallParams.iWaitForDialTone=RCall::EDialToneNoWait;
	mobileCallParams.iInterval=5678;
	mobileCallParams.iAutoRedial=ETrue;
	mobileCallParams.iCug.iCugIndex=99;
	mobileCallParams.iIdRestrict=RMobileCall::ESendMyId;
	mobileCallParams.iWantedAiur=RMobileCall::EAiurBps9600;
	mobileCallParams.iWantedRxTimeSlots=5;
	mobileCallParams.iMaxTimeSlots=30;
	mobileCallParams.iCodings=RMobileCall::ETchCoding48;

	TESTL(iCallAnswer.AnswerIncomingCall(mobileCallParamsPckg)==KErrNone);
	INFO_PRINTF1(_L("Connected"));

	RCall::TStatus callStatus;
	TESTL(iCallAnswer.GetStatus(callStatus)==KErrNone);
	TESTL(callStatus==RCall::EStatusConnected);

	INFO_PRINTF1(_L("Checking Call Params"));	
	RMobileCall::TMobileHscsdCallParamsV1 mobileCallParams2;
	RMobileCall::TMobileHscsdCallParamsV1Pckg mobileCallParams2Pckg(mobileCallParams2);
	TESTL(iCallAnswer.GetCallParams(mobileCallParams2Pckg)==KErrNone);
	TESTL(mobileCallParams2.iSpeakerControl==RCall::EMonitorSpeakerControlOnExceptDuringDialling);
	TESTL(mobileCallParams2.iSpeakerVolume==RCall::EMonitorSpeakerVolumeUnknown);
	TESTL(mobileCallParams2.iWaitForDialTone==RCall::EDialToneNoWait);
	TESTL(mobileCallParams2.iInterval==5678);

	INFO_PRINTF1(_L("Notification for Hscsd info changes"));
	iCall.NotifyHscsdInfoChange(reqStatus1,infoPckg);
	 
	INFO_PRINTF1(_L("Set DataCall Hscsd Dynamic Parameters"));
	iCall.SetDynamicHscsdParams(reqStatus0,RMobileCall::EAiurBps57600, 15);
	User::WaitForRequest(reqStatus0);	
	TESTL(reqStatus0==KErrNone);
	User::WaitForRequest(reqStatus1);	
	TESTL(reqStatus1==KErrNone);
	INFO_PRINTF1(_L("Completed notification..."));

	INFO_PRINTF1(_L("Hanging up..."));
	TESTL(iCallAnswer.HangUp()==KErrNone);
	INFO_PRINTF1(_L("Disconnected"));

	TESTL(iCallAnswer.GetStatus(callStatus)==KErrNone);
	TESTL(callStatus==RCall::EStatusIdle);

	INFO_PRINTF1(_L("Closing objects..."));

	iCallAnswer.Close();
	iCall.Close();
	iLine.Close();
   	iPhone.Close();
	ASSERT(RThread().RequestCount()==0);

	return TestStepResult();
	}