TInt CTS_MultiHomingStep::GetResolverConfig(const TInt aIndex, TName &aHostName, TInt& aProtocol, TBool& aExpectSuccess, TBool& aExpectTimeout, TBool& aExpectNotReady, TBool& aExplicitResolve, TConnDetails **aConnDetails) /** * Gets resolver configuration from file, using defaults if necessary * @param aIndex The index for the socket configkey * @param aHostName The host to be resolved * @param aProtocol The protocol to be used * @param aExpectSuccess Flag indicating if name should be resolved ok * @param aExpectTimeout Flag indicating if name resolution should timeout * @param aConnDetails The connection for an explicit resolver * @return System wide error code */ { TInt err=KErrNone; TName resolverName; // Create the Key for the config lookup resolverName = KResolver; resolverName.AppendNum(aIndex); TPtrC ptrBuf; err = GetStringFromConfig(resolverName, KDestName, ptrBuf); if (!err) { LogExtra((TText8*)__FILE__, __LINE__, ESevrWarn, KEConfigFile); iTestStepResult= EInconclusive; return KErrNotFound; } aHostName.Copy(ptrBuf.Ptr(), ptrBuf.Length()); aExpectSuccess = ETrue; GetBoolFromConfig(resolverName, KExpectSuccess, aExpectSuccess); aExpectTimeout = EFalse; GetBoolFromConfig(resolverName, KExpectTimeout, aExpectTimeout); aExpectNotReady = EFalse; GetBoolFromConfig(resolverName, KExpectNoDnsServer, aExpectNotReady); aExplicitResolve = EFalse; GetBoolFromConfig(resolverName, KExplicitResolve, aExplicitResolve); err = GetStringFromConfig(resolverName, KProtocol, ptrBuf); if (err && (ptrBuf.Compare(KTcp)==0)) aProtocol = KProtocolInetTcp; else aProtocol = KProtocolInetUdp; err = GetStringFromConfig(resolverName, KConnName, ptrBuf); if (!err) { return KErrNotFound; } *aConnDetails = iOwnerSuite->GetTConnection(ptrBuf); return KErrNone; }
// ----------------------------------------------------------------------------- // TMSCallServer::StartThreadL // // ----------------------------------------------------------------------------- // void TMSCallServer::StartThreadL(TMSCallServerStartParam& aStart) { TRACE_PRN_FN_ENT; CActiveScheduler* sched = new (ELeave) CActiveScheduler; CleanupStack::PushL(sched); CActiveScheduler::Install(sched); TMSCallServer* server = TMSCallServer::NewL(aStart.iTMSServer); CleanupStack::PushL(server); //Rename tmscall server name RThread tmscallServerThread; TThreadId threadId; TName name; name.Append(KTMSCallServerName); threadId = tmscallServerThread.Id(); name.AppendNum(threadId.Id(), EHex); //We are ignoring the error code returned from User::RenameThread //as it is not important here, may be for profiling User::RenameThread(name); aStart.iTMSCallServerHandle = server->Server(); // Sync with the client and enter the active scheduler RThread::Rendezvous(KErrNone); sched->Start(); CleanupStack::PopAndDestroy(server); // server CleanupStack::PopAndDestroy(sched); // sched TRACE_PRN_FN_EXT; }
// ----------------------------------------------------------------------------- // MceServerStarter::CreateServerProcess // ----------------------------------------------------------------------------- // TInt MceServerStarter::CreateServerProcess (RSemaphore& aSemaphore) { const TUidType serverUid (KNullUid, KNullUid, KServerUid3); #if ((defined (__WINS__) || defined(__WINSCW__)) && !defined (EKA2)) RLibrary lib; RETURN_IF_ERROR (lib.Load(KMceServerFilename,serverUid)) // Get the WinsMain function TLibraryFunction functionWinsMain = lib.Lookup (1); // Call it and cast the result to a thread function TThreadFunction serverThreadFunction = reinterpret_cast<TThreadFunction> (functionWinsMain()); TName threadName (KSipServerName); // Append a random number to make it unique threadName.AppendNum (Math::Random(), EHex); RThread server; TInt err = server.Create (threadName, serverThreadFunction, // thread's main function KDefaultStackSize, NULL, &lib, NULL, KServerMinHeapSize, KServerMaxHeapSize, EOwnerProcess ); lib.Close (); // if successful, server thread has handle to library now RETURN_IF_ERROR (err) server.SetPriority (EPriorityMore); #else // HW build RProcess server; RETURN_IF_ERROR (server.Create( KMceServerName, KNullDesC, serverUid ) ) #endif server.Resume (); aSemaphore.Wait(); TInt exitReason = server.ExitReason(); server.Close (); return exitReason; }
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); User::WaitForRequest(modifyStatus); TESTL(modifyStatus.Int()==KErrNotReady); iGPRSPacketqos.SetProfileParameters(reqStatus, aGPRSQoSReqPckg); User::WaitForRequest(reqStatus); TESTL(reqStatus.Int()==KErrNone); iFirstPrimaryPacketContext.ModifyActiveContext(modifyStatus); User::WaitForRequest(modifyStatus); TESTL(modifyStatus.Int()==KErrNone); INFO_PRINTF1(_L("ModifyActiveContext Test Passed")); INFO_PRINTF1(_L("Notify GPRS QoS Profile Test passed")); // Get QoS GPRS Capabilities RPacketQoS::TQoSCapsGPRS aQoSCaps; TPckg<RPacketQoS::TQoSCapsGPRS> aQoSCapsPckg(aQoSCaps); iGPRSPacketqos.GetProfileCapabilities(reqStatus, aQoSCapsPckg); User::WaitForRequest(reqStatus); TESTL(reqStatus.Int()==KErrNone); TESTL(aQoSCaps.ExtensionId()==TPacketDataConfigBase::KConfigGPRS); TESTL(aQoSCaps.iDelay == RPacketQoS::EDelayClass2); TESTL(aQoSCaps.iMean == RPacketQoS::EMeanThroughput100); TESTL(aQoSCaps.iPeak == RPacketQoS::EPeakThroughput64000); TESTL(aQoSCaps.iPrecedence == RPacketQoS::EPriorityMediumPrecedence); TESTL(aQoSCaps.iReliability == RPacketQoS::EReliabilityClass2); INFO_PRINTF1(_L("Get QoS Profile Capabilities Test passed")); //Get QoS Profile Params RPacketQoS::TQoSGPRSNegotiated aGPRSQoSNegConfig; TPckg<RPacketQoS::TQoSGPRSNegotiated> aGPRSQoSNegPckg(aGPRSQoSNegConfig); iGPRSPacketqos.GetProfileParameters(cancelStatus, aGPRSQoSNegPckg); iGPRSPacketqos.CancelAsyncRequest(EPacketQoSGetProfileParams);//no implementation-does nothing User::WaitForRequest(cancelStatus); TESTL(cancelStatus.Int()==KErrNone); TESTL(aGPRSQoSNegConfig.ExtensionId()==TPacketDataConfigBase::KConfigGPRS); TESTL(aGPRSQoSNegConfig.iDelay==RPacketQoS::EDelayClass2); TESTL(aGPRSQoSNegConfig.iMeanThroughput==RPacketQoS::EMeanThroughput100); TESTL(aGPRSQoSNegConfig.iPeakThroughput==RPacketQoS::EPeakThroughput64000); TESTL(aGPRSQoSNegConfig.iPrecedence==RPacketQoS::EPriorityMediumPrecedence); TESTL(aGPRSQoSNegConfig.iReliability==RPacketQoS::EReliabilityClass2); INFO_PRINTF1(_L("Get QoS Profile Test passed")); // End of RPacketQos tests iGPRSPacketqos.Close(); iFirstPrimaryPacketContext.Close(); iPacketService.Close(); iPhone.Close(); ASSERT(RThread().RequestCount()==0); return 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; aR99QoSReqConfig.iMinAcceptableMaxRate.iDownlinkRate = min-1; // between 0 - 1840 aR99QoSReqConfig.iMinAcceptableMaxRate.iUplinkRate = req; aR99QoSReqConfig.iReqBER = RPacketQoS::EBEROnePerHundred; // 0x04 aR99QoSReqConfig.iMaxBER = RPacketQoS::EBERFivePerHundred; // 0x02 aR99QoSReqConfig.iReqSDUErrorRatio = RPacketQoS::ESDUErrorRatioSevenPerThousand; // 0x08 aR99QoSReqConfig.iMaxSDUErrorRatio = RPacketQoS::ESDUErrorRatioOnePerHundred; // 0x04 aR99QoSReqConfig.iReqTrafficHandlingPriority = RPacketQoS::ETrafficPriority2; // 0x04 aR99QoSReqConfig.iMinTrafficHandlingPriority = RPacketQoS::ETrafficPriority1; // 0x02 aR99QoSReqConfig.iReqTransferDelay = req; aR99QoSReqConfig.iMaxTransferDelay = min; aR99QoSReqConfig.iReqGuaranteedRate.iDownlinkRate = min; aR99QoSReqConfig.iReqGuaranteedRate.iUplinkRate = req; aR99QoSReqConfig.iMinGuaranteedRate.iDownlinkRate = min; aR99QoSReqConfig.iMinGuaranteedRate.iUplinkRate = req; // // //post the notifications iRel99Packetqos.NotifyProfileChanged(rel99NotifyStatus, aR99NotifyQoSPckg); iGPRSPacketqos.NotifyProfileChanged(gprsNotifyStatus, aGPRSNotifyQoSPckg); //Set the profile iRel99Packetqos.SetProfileParameters(rel99ReqStatus, aR99QoSReqPckg); iGPRSPacketqos.SetProfileParameters(gprsReqStatus, aGPRSQoSReqPckg); User::WaitForRequest(rel99NotifyStatus); User::WaitForRequest(gprsNotifyStatus); //User::WaitForRequest(rel99ReqStatus); User::WaitForRequest(rel99ReqStatus); User::WaitForRequest(gprsReqStatus); //Test the notification packages are correct //Rel99 TESTL(aR99NotifyQoS.ExtensionId()==TPacketDataConfigBase::KConfigRel99Rel4); TESTL(aR99NotifyQoS.iTrafficClass==RPacketQoS::ETrafficClassConversational); TESTL(aR99NotifyQoS.iDeliveryOrderReqd==RPacketQoS::EDeliveryOrderNotRequired); TESTL(aR99NotifyQoS.iDeliverErroneousSDU==RPacketQoS::EErroneousSDUNoDetection); TESTL(aR99NotifyQoS.iMaxSDUSize==min); TESTL(aR99NotifyQoS.iMaxRate.iUplinkRate==min); TESTL(aR99NotifyQoS.iMaxRate.iDownlinkRate==req); TESTL(aR99NotifyQoS.iBER==RPacketQoS::EBEROnePerHundred); TESTL(aR99NotifyQoS.iSDUErrorRatio==RPacketQoS::ESDUErrorRatioOnePerTen); TESTL(aR99NotifyQoS.iTrafficHandlingPriority==RPacketQoS::ETrafficPriority2); TESTL(aR99NotifyQoS.iTransferDelay==min); TESTL(aR99NotifyQoS.iGuaranteedRate.iUplinkRate==min); TESTL(aR99NotifyQoS.iGuaranteedRate.iDownlinkRate==req); //Gprs 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); // Close iGPRSPacketqos.Close(); iGPRSPacketContext.Close(); iGPRSPacketService.Close(); iRel99Packetqos.Close(); iRel99PacketContext.Close(); iRel99PacketService.Close(); iPhone.Close(); ASSERT(RThread().RequestCount()==0); return TestStepResult(); }