enum TVerdict CTestOpenCallFrLine::doTestStepL() { INFO_PRINTF1(_L("Open Call from RLine!")); RTelServer server; TInt ret = server.Connect(); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); RPhone phone; ret = phone.Open(server,DSTD_PHONE_NAME); TESTCHECK(ret, KErrNone); RLine line; ret = line.Open(phone,DSTD_LINE_NAME); TESTCHECK(ret, KErrNone); RCall call; ret = call.OpenNewCall(line); TESTCHECK(ret, KErrNone); call.Close(); line.Close(); phone.Close(); ret=server.UnloadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ServerClose(server); return TestStepResult(); }
enum TVerdict CTestErrNewTelObjectIllegalBuffer::doTestStepL() /** Check that CTelSession::NewTelObject fails when an illegal buffer is passed to it for the name of the call. (Uses similar code to that in RTelServer::OpenNewCall().) @return EPass or EFail */ { RTelServer1 server; TInt ret = server.Connect(); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); RTelServer::TPhoneInfo phoneInfo; ret = server.GetPhoneInfo( 0, phoneInfo ); TESTCHECK(ret, KErrNone); RPhone phone; ret = phone.Open( server, phoneInfo.iName ); TESTCHECK(ret, KErrNone); RPhone::TLineInfo lineInfo; ret = phone.GetLineInfo( 0, lineInfo ); TESTCHECK(ret, KErrNone); RLine line; ret = line.Open( phone, lineInfo.iName ); char retName; // Illegal buffer. RCall1 call; // Taken from OpenNewCall(line , retName); RSessionBase* session=&line.SessionHandle(); call.ConstructL(); TInt subSessionHandle=line.SubSessionHandle(); TPtrC name(_L("::")); // necessary so that server knows to ask TSY for new name TIpcArgs args(&name,REINTERPRET_CAST(TDes*,&retName),subSessionHandle); call.SetSessionHandle(*session); ret = call.CreateSubSession(*session,EEtelOpenFromSubSession,args); call.Destruct(); TESTCHECK(ret, KErrBadDescriptor); line.Close(); phone.Close(); ret=server.UnloadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ServerClose(server); return TestStepResult(); }
enum TVerdict CTestMemZeroLength::doTestStepL() { INFO_PRINTF1(_L("Test Zero Length Dials")); RTelServer server; TInt ret = server.Connect(); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); RPhone phone; ret = phone.Open(server,DSTD_PHONE_NAME); TESTCHECK(ret, KErrNone); RLine line; ret = line.Open(phone,DSTD_LINE_NAME); TESTCHECK(ret, KErrNone); RCall call; TName name; ret = call.OpenNewCall(line,name); TESTCHECK(ret, KErrNone); RCall::TTelNumberC number(_L("")); TPtrC8 callParams(_L8("")); ret=call.Dial(number); TESTCHECK(ret, KErrArgument); ret=call.Dial(callParams,number); TESTCHECK(ret, KErrArgument); TRequestStatus status; call.Dial(status,number); User::WaitForRequest(status); TESTCHECK(status.Int(), KErrArgument); call.Dial(status,callParams,number); User::WaitForRequest(status); TESTCHECK(status.Int(), KErrArgument); call.Close(); line.Close(); INFO_PRINTF1(_L("Passed illegal Cancel Test")); INFO_PRINTF1(_L("Test an illegal Cancel")); // This shouldn't panic phone.NotifyModemDetectedCancel(); phone.Close(); ServerClose(server); INFO_PRINTF1(_L("Passed illegal Cancel Test")); return TestStepResult(); }
enum TVerdict CTestErrNewTelObjectOk::doTestStepL() /** Check that RTelServer::OpenNewCall returns no errors when it has a large enough valid buffer to put the call name in. @return EPass or EFail */ { RTelServer1 server; TInt ret = server.Connect(); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); RTelServer::TPhoneInfo phoneInfo; ret = server.GetPhoneInfo( 0, phoneInfo ); TESTCHECK(ret, KErrNone); RPhone phone; ret = phone.Open( server, phoneInfo.iName ); TESTCHECK(ret, KErrNone); RPhone::TLineInfo lineInfo; ret = phone.GetLineInfo( 0, lineInfo ); TESTCHECK(ret, KErrNone); RLine line; ret = line.Open( phone, lineInfo.iName ); TName retName; // Check that we can get a name for the newly opened call. RCall call; ret = call.OpenNewCall(line , retName); TESTCHECK(ret, KErrNone); call.Close(); line.Close(); phone.Close(); ret=server.UnloadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ServerClose(server); return TestStepResult(); }
enum TVerdict CTestSetDes::doTestStepL() { INFO_PRINTF1(_L("Set By Des")); RTelServer server; TInt ret = server.Connect(); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); RPhone phone; ret = phone.Open(server,DSTD_PHONE_NAME); TESTCHECK(ret, KErrNone); RCall call; ret=call.OpenNewCall(phone,DSTD_OPEN_CALL_FROM_PHONE_NAME); TESTCHECK(ret, KErrNone); RCall::TCallParams callParams; RCall::TCallParamsPckg callParamsPckg(callParams); TDummyString dialString=DACQ_PHONE_NUMBER_TO_DIAL; ret=call.Dial(callParamsPckg,dialString); TESTCHECK(ret, KErrNone); RFax fax; ret=fax.Open(call); TRequestStatus faxReadStatus; TRequestStatus faxWriteStatus; TAcqFaxBuf readbuf=DACQ_FAX_BUF_DATA; TAcqFaxBuf writebuf=DACQ_FAX_BUF_DATA; // check each req complete correctly fax.Read(faxReadStatus,readbuf); User::WaitForRequest(faxReadStatus); TESTCHECKSTR(readbuf, DACQ_FAX_BUF_DATA); fax.Write(faxWriteStatus,writebuf); User::WaitForRequest(faxWriteStatus); fax.Close(); call.Close(); phone.Close(); ret=server.UnloadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ServerClose(server); return TestStepResult(); }
enum TVerdict CTestErrNewTelObjectSmallBuffer::doTestStepL() /** Check that CTelSession::NewTelObject fails when a small buffer is passed to it for the name of the call. (Uses similar code to that in RTelServer::OpenNewCall().) @return EPass or EFail */ { RTelServer1 server; TInt ret = server.Connect(); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); RTelServer::TPhoneInfo phoneInfo; ret = server.GetPhoneInfo( 0, phoneInfo ); TESTCHECK(ret, KErrNone); RPhone phone; ret = phone.Open( server, phoneInfo.iName ); TESTCHECK(ret, KErrNone); RPhone::TLineInfo lineInfo; ret = phone.GetLineInfo( 0, lineInfo ); TESTCHECK(ret, KErrNone); RLine line; ret = line.Open( phone, lineInfo.iName ); TBuf<1> retName; //Buffer too small to recieve name. RCall call; ret = call.OpenNewCall(line , retName); TESTCHECK(ret, KErrOverflow); line.Close(); phone.Close(); ret=server.UnloadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ServerClose(server); return TestStepResult(); }
/** * "Outgoing Call" function. This function will wait until the * Watchers have started and then will make and terminate a call. */ void CTelWatchersIntTestOutgoingCallStatusWithPublishSubscribe::OutgoingCallL() { const TInt KStartupPollPeriod = 1*1000000; const TInt KCallActivePeriod = 5*1000000; TInt val(KErrNotFound); while (val < KErrNone) { User::After(KStartupPollPeriod); User::LeaveIfError(RProperty::Get(KUidSystemCategory, KUidCurrentCall.iUid, val)); } RTelServer telServer; User::LeaveIfError(telServer.Connect()); CleanupClosePushL(telServer); RPhone phone; User::LeaveIfError(phone.Open(telServer, KPhoneName)); CleanupClosePushL(phone); RLine line; User::LeaveIfError(line.Open(phone, KVoiceLineName)); CleanupClosePushL(line); RCall call; TName callName; User::LeaveIfError(call.OpenNewCall(line, callName)); CleanupClosePushL(call); _LIT(KTelNumber,"1234"); User::LeaveIfError(call.Dial(KTelNumber)); User::After(KCallActivePeriod); call.HangUp(); CleanupStack::PopAndDestroy(&call); CleanupStack::PopAndDestroy(&line); CleanupStack::PopAndDestroy(&phone); CleanupStack::PopAndDestroy(&telServer); } // CTelWatchersIntTestOutgoingCallStatusWithPublishSubscribe::OutgoingCallL
void CTelServerProcessor::GetLineInfoL(RPhone::TLineInfo& aInfo,const TDesC& aPhoneName, TUint aLineType) { RPhone phone; User::LeaveIfError(phone.Open(iTelServer,aPhoneName)); CleanupClosePushL(phone); TInt count = 0; User::LeaveIfError(phone.EnumerateLines(count)); if (count <= 0) { OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVERPROCESSOR_GETLINEINFOL_1,"NetDial:\tGetLineInfoL(): no line info available - leaving with -1"); User::Leave(KErrNotFound); } TBool found = EFalse; for (TInt i=0; i<count && !found; ++i) { User::LeaveIfError(phone.GetLineInfo(i,aInfo)); /* if (aInfo.iLineCapsFlags & aLineType) // Required line found { found=ETrue; } */ RLine line; User::LeaveIfError(line.Open(phone,aInfo.iName)); CleanupClosePushL(line); RLine::TCaps caps; User::LeaveIfError(line.GetCaps(caps)); if (caps.iFlags & aLineType) // Required line found { found=ETrue; } CleanupStack::PopAndDestroy(&line); } CleanupStack::PopAndDestroy(&phone); if (!found) { OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVERPROCESSOR_GETLINEINFOL_2, "NetDial:\tGetLineInfoL(): required line not found - leaving with -1"); User::Leave(KErrNotFound); } }
enum TVerdict CTestOpenPhoneFrServ::doTestStepL() { INFO_PRINTF1(_L("Test Open Phone From Server")); RTelServer server; TInt ret = server.Connect(); TESTCHECK(ret, KErrNone); ret=server.LoadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); RPhone phone; ret = phone.Open(server,DSTD_PHONE_NAME); TESTCHECK(ret, KErrNone); phone.Close(); ret=server.UnloadPhoneModule(DSTD_MODULE_NAME); TESTCHECK(ret, KErrNone); ServerClose(server); return TestStepResult(); }
void CSmsStackTestServer::LoadTsyL(RTelServer& aServer, RPhone& aPhone, const TDesC& aTsyName) { INFO_PRINTF2(_L("Using TSY \"%S\"Loading RTelServer..."), &aTsyName); TInt ret = aServer.LoadPhoneModule(aTsyName); if (ret!=KErrNone) { ERR_PRINTF2(_L("Loading Phone Module returned %d"), ret); User::Leave(ret); } // Find the phone corresponding to this TSY and open a number of handles on it TInt numPhones; ret = aServer.EnumeratePhones(numPhones); if (ret!=KErrNone) { ERR_PRINTF2(_L("Enumerate Phones returned %d"), ret); User::Leave(ret); } TBool found=EFalse; while (numPhones--) { TName phoneTsy; ret = aServer.GetTsyName(numPhones,phoneTsy); if (ret!=KErrNone) { ERR_PRINTF2(_L("GetTsyName returned %d"), ret); User::Leave(ret); } if (phoneTsy.CompareF(aTsyName)==KErrNone) { INFO_PRINTF1(_L("Found RPhone...")); found = ETrue; RTelServer::TPhoneInfo info; ret = aServer.GetPhoneInfo(numPhones,info); if (ret!=KErrNone) { ERR_PRINTF2(_L("GetPhoneInfo returned %d"), ret); User::Leave(ret); } ret = aPhone.Open(aServer,info.iName); if (ret!=KErrNone) { ERR_PRINTF2(_L("Opening phone returned %d"), ret); User::Leave(ret); } INFO_PRINTF1(_L("Initializing...")); ret = aPhone.Initialise(); TTimeIntervalMicroSeconds32 InitPause=9000000; //Required Pause to Allow SMSStack to Complete its Async Init User::After(InitPause); //call to the TSY and finish its StartUp. if (ret!=KErrNone) { ERR_PRINTF2(_L("Completed Initialize returned %d"), ret); User::Leave(ret); } break; } } if(!found) { ERR_PRINTF2(_L("Couldn't find the phone for TSY %S"), &aTsyName); } }
// 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")); //Fix for defect MPO-576M6R: Added call to RPacket::OpenExistingQos() RPacketQoS gprsQoS2; ret = gprsQoS2.OpenExistingQoS(gprsContext, qosName); CHECKPOINT(ret,KErrNone,CHP_QOS_CASE("C.2")); gprsQoS.Close(); gprsQoS2.Close(); gprsContext.Close(); gprs.Close(); phone.Close(); return TestStepResult(); }
static void DialNumberL(PktBuf &in, PktBuf &out) { /// @todo maybe use a CActive object to allow the call to be cancelled from gammu TBuf<100> aPhoneNumber; in >> aPhoneNumber; cons->Printf( _L("dialing... number:\n") ); cons->Printf( aPhoneNumber ); cons->Printf( _L("\n") ); TName newCallName = _L("call"); //Create a connection to the tel server RTelServer server; CleanupClosePushL(server); User::LeaveIfError(server.Connect()); //Load in the phone device driver User::LeaveIfError(server.LoadPhoneModule(KTsyName)); //Find the number of phones available from the tel server TInt numberPhones; User::LeaveIfError(server.EnumeratePhones(numberPhones)); //Check there are available phones if (numberPhones < 1) { User::Leave(KErrNotFound); } //Get info about the first available phone RTelServer::TPhoneInfo info; User::LeaveIfError(server.GetPhoneInfo(0, info)); //Use this info to open a connection to the phone, the phone is identified by its name RPhone phone; CleanupClosePushL(phone); User::LeaveIfError(phone.Open(server, info.iName)); //Get info about the first line from the phone RPhone::TLineInfo lineInfo; User::LeaveIfError(phone.GetLineInfo(0, lineInfo)); //Use this to open a line RLine line; CleanupClosePushL(line); User::LeaveIfError(line.Open(phone, lineInfo.iName)); //Open a new call on this line RCall call; CleanupClosePushL(call); User::LeaveIfError(call.OpenNewCall(line, newCallName)); if ((call.Dial(aPhoneNumber) == KErrNone)) { TRequestStatus iStatus; RCall::TStatus iLineStatus; line.NotifyStatusChange(iStatus, iLineStatus); User::WaitForRequest(iStatus); } CleanupStack::PopAndDestroy(4);//phone, line, call //Unload the phone device driver User::LeaveIfError(server.UnloadPhoneModule(KTsyName)); out << (TUint16)GNAPPLET_MSG_PHONEBOOK_DIAL_RESP; out << (TUint16)GN_ERR_NONE; }
enum TVerdict CTestSatEnvelopeCmds::doTestStepL() { INFO_PRINTF1(_L("**************************************")); INFO_PRINTF1(_L("Test RSat Envelope Cmds Functionality")); INFO_PRINTF1(_L("**************************************")); RPhone phone; TInt ret=phone.Open(iTelServer,DSATTSY_PHONE_NAME); TEST(ret==KErrNone); RSat sat; ret=sat.Open(phone); TEST(ret==KErrNone); // // Local variables used throughout the sat tests // TRequestStatus reqStatus; iTestCount=1; // // Get ME side SAT profile for V2 // RSat::TSatProfileV2 profile; RSat::TSatProfileV2Pckg profilePckg(profile); TEST(profile.ExtensionId() == RSat::KSatV2); sat.GetMeSideSatProfile(reqStatus, profilePckg); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); TEST(profile.iSatProfileByte1==0x01); TEST(profile.iSatProfileByte2==0x02); TEST(profile.iSatProfileByte3==0x03); TEST(profile.iSatProfileByte4==0x04); TEST(profile.iSatProfileByte5==0x05); TEST(profile.iSatProfileByte6==0x06); TEST(profile.iSatProfileByte7==0x07); TEST(profile.iSatProfileByte8==0x08); TEST(profile.iSatProfileByte9==0x09); TEST(profile.iSatProfileByte10==0x0A); TEST(profile.iSatProfileByte11==0x0B); TEST(profile.iSatProfileByte12==0x0C); TEST(profile.iSatProfileByte13==0x0D); TEST(profile.iSatProfileByte14==0x0E); TEST(profile.iSatProfileByte15==0x0F); TEST(profile.iSatProfileByte16==0x10); TEST(profile.iSatProfileByte17==0x20); TEST(profile.iSatProfileByte18==0x30); TEST(profile.iNumOfChannels==DSATTSY_NUMBER_OF_CHANNELS); TEST(profile.iScreenHeight==DSATTSY_SCREEN_HEIGHT); TEST(profile.iScreenWidth==DSATTSY_SCREEN_WIDTH); TEST(profile.iTiaEiaProtoVersion==DSATTSY_PROTO_VERSION); TEST(profile.iWidthReduction==DSATTSY_WIDTH_REDUCTION); INFO_PRINTF2(_L("Test %d - RSat::GetMeSideSatProfile with RSat::TSatProfileV2 passed"),iTestCount++); sat.GetMeSideSatProfile(reqStatus, profilePckg); sat.CancelAsyncRequest(ESatGetMeSideSatProfile); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); INFO_PRINTF2(_L("Test %d - RSat::GetMeSideSatProfileCancel with RSat::TSatProfileV2 passed"),iTestCount++); // // Client SAT profile indication // TEST(sat.ClientSatProfileIndication(profilePckg)==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::ClientSatProfileIndication with RSat::TSatProfileV2 passed"),iTestCount++); // // Get ME side SAT profile for V5 // RSat::TSatProfileV5 profileV5; RSat::TSatProfileV5Pckg profileV5Pckg(profileV5); TEST(profileV5.ExtensionId() == RSat::KSatV5); sat.GetMeSideSatProfile(reqStatus, profileV5Pckg); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); // Pre-version 5 parameters in SAT profile TEST(profileV5.iSatProfileByte1==0x01); TEST(profileV5.iSatProfileByte2==0x02); TEST(profileV5.iSatProfileByte3==0x03); TEST(profileV5.iSatProfileByte4==0x04); TEST(profileV5.iSatProfileByte5==0x05); TEST(profileV5.iSatProfileByte6==0x06); TEST(profileV5.iSatProfileByte7==0x07); TEST(profileV5.iSatProfileByte8==0x08); TEST(profileV5.iSatProfileByte9==0x09); TEST(profileV5.iSatProfileByte10==0x0A); TEST(profileV5.iSatProfileByte11==0x0B); TEST(profileV5.iSatProfileByte12==0x0C); TEST(profileV5.iSatProfileByte13==0x0D); TEST(profileV5.iSatProfileByte14==0x0E); TEST(profileV5.iSatProfileByte15==0x0F); TEST(profileV5.iSatProfileByte16==0x10); TEST(profileV5.iSatProfileByte17==0x20); TEST(profileV5.iSatProfileByte18==0x30); TEST(profileV5.iNumOfChannels==DSATTSY_NUMBER_OF_CHANNELS); TEST(profileV5.iScreenHeight==DSATTSY_SCREEN_HEIGHT); TEST(profileV5.iScreenWidth==DSATTSY_SCREEN_WIDTH); TEST(profileV5.iTiaEiaProtoVersion==DSATTSY_PROTO_VERSION); TEST(profileV5.iWidthReduction==DSATTSY_WIDTH_REDUCTION); // Version 5 parameters in profile // (test also that the TSatProfileByte28 and TSatProfileByte29 // have been defined correctly as each should set a different bit). TEST(profileV5.iSatProfileByte28== (RSat::KCapsTextAttributeAlignmentLeft | RSat::KCapsTextAttributeAlignmentCentre | RSat::KCapsTextAttributeAlignmentRight | RSat::KCapsTextAttributeFontSizeNormal | RSat::KCapsTextAttributeFontSizeLarge | RSat::KCapsTextAttributeFontSizeSmall)); // 0x3F TEST(profileV5.iSatProfileByte29==(RSat::KCapsTextAttributeStyleNormal | RSat::KCapsTextAttributeStyleBold | RSat::KCapsTextAttributeStyleItalic | RSat::KCapsTextAttributeStyleUnderline | RSat::KCapsTextAttributeStyleStrikethrough | RSat::KCapsTextAttributeStyleForeground | RSat::KCapsTextAttributeStyleBackground)); // 0x7F INFO_PRINTF2(_L("Test %d - RSat::GetMeSideSatProfile with RSat::TSatProfileV5 passed"),iTestCount++); sat.GetMeSideSatProfile(reqStatus, profileV5Pckg); sat.CancelAsyncRequest(ESatGetMeSideSatProfile); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); INFO_PRINTF2(_L("Test %d - RSat::GetMeSideSatProfileCancel with RSat::TSatProfileV5 passed"),iTestCount++); // // Client SAT profile indication for V5 // TEST(sat.ClientSatProfileIndication(profileV5Pckg)==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::ClientSatProfileIndication RSat::TSatProfileV5 passed"),iTestCount++); // Menu Selection RSat::TMenuSelectionV1 selection; RSat::TMenuSelectionV1Pckg selectionPckg(selection); selection.iHelp =DSATTSY_HELP_REQUESTED; selection.iItemId =DSATTSY_ITEM_ID; sat.MenuSelection(reqStatus, selectionPckg); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::MenuSelection passed"),iTestCount++); // Menu Selection Cancel sat.MenuSelection(reqStatus,selectionPckg); sat.CancelAsyncRequest(ESatMenuSelection); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); INFO_PRINTF2(_L("Test %d - RSat::MenuSelectionCancel passed"),iTestCount++); // Event Download // Test each event RSat::TEventList eventList; RSat::TEventDownloadBaseV2 eventBaseV2; RSat::TEventDownloadBaseV2Pckg eventBaseV2Pckg( eventBaseV2 ); // KUserActivity eventList = RSat::KUserActivity; sat.EventDownload( reqStatus, eventList, eventBaseV2Pckg ); // No associated data User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KUserActivity) passed"),iTestCount++); // Event Download Cancel sat.EventDownload( reqStatus, eventList, eventBaseV2Pckg ); // No associated data sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); INFO_PRINTF2(_L("Test %d - RSat::EventDownloadCancel passed"),iTestCount++); // KIdleScreenAvailable eventList = RSat::KIdleScreenAvailable; sat.EventDownload( reqStatus, eventList, eventBaseV2Pckg ); // No associated data User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KIdleScreenAvailable) passed"),iTestCount++); sat.EventDownload( reqStatus, eventList, eventBaseV2Pckg ); // No associated data sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); // KCardReaderStatus RSat::TCardReaderStatusEventV2 eventCardStatus; RSat::TCardReaderStatusEventV2Pckg eventCardStatusPckg(eventCardStatus); eventList = RSat::KCardReaderStatus; eventCardStatus.iCardReaderStatus = DSATTSY_EVENT_CARD_READER_STATUS; sat.EventDownload( reqStatus, eventList, eventCardStatusPckg ); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KCardReaderStatus) passed"),iTestCount++); sat.EventDownload( reqStatus, eventList, eventCardStatusPckg ); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); // KLanguageSelection RSat::TLanguageSelectionEventV2 languageSelect; RSat::TLanguageSelectionEventV2Pckg languageSelectPckg(languageSelect); eventList = RSat::KLanguageSelection; languageSelect.iLanguage = DSATTSY_EVENT_LANGUAGE_SELECTION; sat.EventDownload( reqStatus, eventList, languageSelectPckg ); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KLanguageSelection) passed"),iTestCount++); sat.EventDownload( reqStatus, eventList, languageSelectPckg ); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); // KBrowserTermination RSat::TBrowserTerminationEventV2 browserTerm; RSat::TBrowserTerminationEventV2Pckg browserTermPckg( browserTerm ); eventList = RSat::KBrowserTermination; browserTerm.iCause = DSATTSY_EVENT_BROWSER_TERMINATION_CAUSE; sat.EventDownload( reqStatus, eventList, browserTermPckg ); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KBrowserTermination) passed"),iTestCount++); sat.EventDownload( reqStatus, eventList, browserTermPckg ); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); // KDataAvailable RSat::TDataAvailableEventV2 dataAvailable; RSat::TDataAvailableEventV2Pckg dataAvailablePckg( dataAvailable ); eventList = RSat::KDataAvailable; dataAvailable.iStatus.Append( DSATTSY_EVENT_DATA_AVAILABLE_STATUS ); dataAvailable.iLength = DSATTSY_EVENT_DATA_AVAILABLE_LENGTH; sat.EventDownload( reqStatus, eventList, dataAvailablePckg ); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KDataAvailable) passed"),iTestCount++); sat.EventDownload( reqStatus, eventList, dataAvailablePckg ); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); // KChannelStatus RSat::TChannelStatusEventV2 channelStatus; RSat::TChannelStatusEventV2Pckg channelStatusPckg( channelStatus ); eventList = RSat::KChannelStatus; channelStatus.iStatus = DSATTSY_EVENT_CHANNEL_STATUS; sat.EventDownload( reqStatus, eventList, channelStatusPckg ); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KChannelStatus) passed"),iTestCount++); sat.EventDownload( reqStatus, eventList, channelStatusPckg ); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); // KDisplayParamsChanges RSat::TDisplayParamsEventV2 displayParams; RSat::TDisplayParamsEventV2Pckg displayParamsPckg( displayParams ); eventList = RSat::KDisplayParamsChanges; displayParams.iSatProfileByte14 = DSATTSY_EVENT_DISPLAY_PROF14; displayParams.iScreenHeight = DSATTSY_SCREEN_HEIGHT; displayParams.iSatProfileByte15 = DSATTSY_EVENT_DISPLAY_PROF15; displayParams.iScreenWidth = DSATTSY_SCREEN_WIDTH; displayParams.iSatProfileByte16 = DSATTSY_EVENT_DISPLAY_PROF16; displayParams.iWidthReduction = DSATTSY_WIDTH_REDUCTION; sat.EventDownload( reqStatus, eventList, displayParamsPckg ); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KDisplayParams) passed"),iTestCount++); sat.EventDownload( reqStatus, eventList, displayParamsPckg ); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); // KLocalConnection RSat::TLocalConnectionEventV2 localConnection; RSat::TLocalConnectionEventV2Pckg localConnectionPckg( localConnection ); eventList = RSat::KLocalConnection; localConnection.iRecord.iBearerId = DSATTSY_EVENT_LOCAL_BEARER_ID; localConnection.iRecord.iServiceId = DSATTSY_EVENT_LOCAL_SERVICE_ID; localConnection.iRecord.iRecord = DSATTSY_EVENT_LOCAL_SERVICE_RECORD; localConnection.iAddress.iCoding = DSATTSY_EVENT_LOCAL_ADDR_CODING ; localConnection.iAddress.iAddress = DSATTSY_EVENT_LOCAL_ADDRESS; sat.EventDownload( reqStatus, eventList, localConnectionPckg ); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::EventDownload(KLocalConnection) passed"),iTestCount++); sat.EventDownload( reqStatus, eventList, displayParamsPckg ); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); /** Testing the Release 6 features supported by the envelope commands*/ /** Testing Event Download envelope command w.r.t NetworkSearchModeChangeEvent which has been updated as part of the Release 6 Features of USIM Application ToolKit @test TSAT324 */ RSat::TNetworkSearchModeChangeEventV6 networkSearchModeChangeEvent; RSat::TNetworkSearchModeChangeEventV6Pckg networkSearchModeChangeEventPckg(networkSearchModeChangeEvent); eventList=RSat::KNetworkSearchModeChange; networkSearchModeChangeEvent.iNetworkSearchMode=DSATTSY_NETWORK_SEARCH_MODE1; sat.EventDownload(reqStatus,eventList,networkSearchModeChangeEventPckg); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - EventDownload - NetworkSearchModeChangeEvent- passed"),iTestCount++); /** Testing Cancel API for the Event Download envelope command @test TSAT325 */ //Cancel sat.EventDownload(reqStatus,eventList,networkSearchModeChangeEventPckg); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); //BrowsingStatusEvent /** Testing Event Download envelope command w.r.t TBrowsingStatusEventV6 which has been updated as part of the Release 6 Features of USIM Application ToolKit @test TSAT326 */ RSat::TBrowsingStatusEventV6 browsingStatusEvent; RSat::TBrowsingStatusEventV6Pckg browsingStatusEventPckg(browsingStatusEvent); eventList=RSat::KBrowsingStatusChange; browsingStatusEvent.iBrowserStatus = DSATTSY_BROWSING_STATUS1; sat.EventDownload(reqStatus,eventList,browsingStatusEventPckg); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - EventDownload - BrowsingStatusEvent- passed"),iTestCount++); /** Testing Cancel API for the Event Download envelope command @test TSAT327 */ //Cancel sat.EventDownload(reqStatus,eventList, browsingStatusEventPckg); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); //FramesInformationChangedEvent /** Testing Event Download envelope command w.r.t FramesInformationChangedEvent which has been updated as part of the Release 6 Features of USIM Application ToolKit @test TSAT328 */ RSat::TFramesInformationChangedEventV6 framesInfoChangedEvent; RSat::TFramesInformationChangedEventV6Pckg framesInfoChangedEventPckg(framesInfoChangedEvent); eventList=RSat::KFramesInformationChange; framesInfoChangedEvent.iFramesInformation.iFrameId = DSATTSY_FRAMES_INFORMATION_FRAMEID; framesInfoChangedEvent.iFramesInformation.iFrameList= DSATTSY_FRAMES_INFORMATION_FRAME_LIST; sat.EventDownload(reqStatus,eventList, framesInfoChangedEventPckg); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - EventDownload - framesInformationChangedEvent- passed"),iTestCount++); /** Testing Cancel API for the Event Download envelope command @test TSAT329 */ //Cancel sat.EventDownload(reqStatus,eventList, framesInfoChangedEventPckg); sat.CancelAsyncRequest(ESatEventDownload); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); /** Testing Multimedia Messaging Service Transfer Status envelope command which has been newly added as part of the Release 6 Features of USIM Application ToolKit @test TSAT299 */ RSat::TMmsTransferStatusV6 mmsTransferStatus; RSat::TMmsTransferStatusV6Pckg mmsTransferStatusPckg(mmsTransferStatus); mmsTransferStatus.iDeviceId = DSATTSYV6_DEVICE_ID3; mmsTransferStatus.iMultimediaMessageId =DSATTSYV6_MULTIMEDIA_MESSAGE_ID1; mmsTransferStatus.iMultimediaMessageStatus =DSATTSYV6_MULTIMEDIA_MESSAGE_STATUS; sat.MmsTransferStatus(reqStatus, mmsTransferStatusPckg); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::MmsTransferStatus - Multimedia Messaging Service Transfer Status - passed"),iTestCount++); /** Testing Cancel API for the Multimedia Messaging Service Transfer Status envelope command @test TSAT300 */ //Cancel sat.MmsTransferStatus(reqStatus, mmsTransferStatusPckg); sat.CancelAsyncRequest(ESatMmsTransferStatus); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); /** Testing Multimedia Messaging Service Notificaiton Download envelope command which has been newly added as part of the Release 6 Features of USIM Application ToolKit @test TSAT301 */ RSat::TMmsNotificationDownloadV6 mmsNotificationDownload; RSat::TMmsNotificationDownloadV6Pckg mmsNotificationDownloadPckg(mmsNotificationDownload); mmsNotificationDownload.iDeviceId = DSATTSYV6_DEVICE_ID1; mmsNotificationDownload.iLastEnvelope = DSATTSYV6_LAST_ENVELOPE1; mmsNotificationDownload.iMMSNotification = DSATTSYV6_MMS_NOTIFICATION1; sat.MmsNotificationDownload(reqStatus, mmsNotificationDownloadPckg); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - RSat::MmsNotificationDownload - Multimedia Messaging Service Notificaiton Download - passed"),iTestCount++); /** Testing Cancel API for the Multimedia Messaging Notification Download envelope command @test TSAT302 */ //Cancel sat.MmsNotificationDownload(reqStatus, mmsNotificationDownloadPckg); sat.CancelAsyncRequest(ESatMmsNotificationDownload); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); /** Testing Ussd Data Download command which has been newly added as part of the Release 6 Features of USIM Application ToolKit @test TSAT303 @test TSAT313 */ RSat::TUssdDataDownloadV6 ussdDataDownload; RSat::TUssdDataDownloadV6Pckg ussdDataDownloadPckg(ussdDataDownload); ussdDataDownload.iDeviceId = DSATTSYV6_DEVICE_ID1; ussdDataDownload.iUssdString.iUssdString = DSATTSY_USSD_STRING; sat.UssdDataDownload(reqStatus, ussdDataDownloadPckg); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrNone); INFO_PRINTF2(_L("Test %d - UssdDataDownload - Ussd Data Download command- passed"),iTestCount++); /** Testing Cancel API for the Ussd Data Download command @test TSAT304 @test TSAT314 */ //Cancel sat.UssdDataDownload(reqStatus, ussdDataDownloadPckg); sat.CancelAsyncRequest(ESatUssdDataDownload); User::WaitForRequest(reqStatus); TEST(reqStatus.Int()==KErrCancel); sat.Close(); phone.Close(); return TestStepResult(); }