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


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

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


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

示例1: StartThreadL

// -----------------------------------------------------------------------------
// 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;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:37,代码来源:tmscallsrvrstart.cpp

示例2: WaitForMsgComplete

/**
Wait for message completion by the helper process

@param  aProcessLog if ETrue, log messages from the helper process will be logged by TEF
@return             error code, result of the message processing.
*/
TInt CSyncMessageSender::WaitForMsgComplete(TBool aProcessLog/*=ETrue*/)
{
    if( !aProcessLog )
    {   //-- don't need to process messages from the helper process
        User::WaitForRequest(iMsgRqStat);
        return iMsgRqStat.Int();
    }

    //-- wait for message completion processing logs from the helper process
    TName logBuf;

    for(;;)
    {
        iLogMsgQueue.NotifyDataAvailable(iLogRqStat);
        User::WaitForRequest(iMsgRqStat, iLogRqStat);

        if(iLogRqStat.Int() == KRequestPending)
        {   //-- iMsgRqStat has been completed, the pessage has been processed
            //-- cancel waiting for the log messages.
            iLogMsgQueue.CancelDataAvailable();
            User::WaitForRequest(iLogRqStat);
            break;
        }
        else
        {   //-- log message has been posted to the queue, pull all log messages up and process them
            TIPLogMsg   logMsg;
            TInt        nRes;

            for(;;)
            {
                nRes = iLogMsgQueue.Receive(logMsg);
                if(nRes != KErrNone)
                    break;

                if(ipLogger)
                {   //-- logger is available, log the message.
                    logBuf.Copy(_L("\t~helper: "));
                    logBuf.Append(logMsg.iLogMsg);
                    ipLogger->Write(logBuf);
                }
            }//for(;;)
        }
    }//for(;;)


    return iMsgRqStat.Int();
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:53,代码来源:EsockPlatSecTest.cpp

示例3: StartThreadL

void CMMFAudioPolicyServer::StartThreadL(TServerStart& aStart)
{
    CActiveScheduler* sched = new(ELeave) CActiveScheduler;
    CleanupStack::PushL(sched);

    CActiveScheduler::Install(sched);
    //Rename Audio Policy server name
    RThread audioPolicyThread;
    TName name;
    name.Append(KMMFAudioPolicyServerName);
    //We are ignoring the error code returned from User::RenameThread
    //as it is not important here, may be for profiling
    User::RenameThread(name);
    CMMFAudioPolicyServer* server = CMMFAudioPolicyServer::NewL();
    CleanupStack::PushL(server);

    aStart.iPolicyServerHandle = server->Server();
    // Sync with the client and enter the active scheduler
    RThread::Rendezvous(KErrNone);
    sched->Start();

    CleanupStack::PopAndDestroy(2, sched); // sched, server
}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:23,代码来源:MmfAudioPolicyStart.cpp

示例4: err

static QList<QNetworkInterfacePrivate *> interfaceListing()
{
    TInt err(KErrNone);
    QList<QNetworkInterfacePrivate *> interfaces;
    QList<QHostAddress> addressesWithEstimatedNetmasks;

    // Open dummy socket for interface queries
    RSocket socket;
    err = socket.Open(qt_symbianGetSocketServer(), _L("udp"));
    if (err) {
        return interfaces;
    }

    // Ask socket to start enumerating interfaces
    err =  socket.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl);
    if (err) {
        socket.Close();
        return interfaces;
    }

    int ifindex = 0;
    TPckgBuf<TSoInetInterfaceInfo> infoPckg;
    TSoInetInterfaceInfo &info = infoPckg();
    while (socket.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, infoPckg) == KErrNone) {
        if (info.iName != KNullDesC) {
            TName address;
            QNetworkAddressEntry entry;
            QNetworkInterfacePrivate *iface = 0;

            iface = new QNetworkInterfacePrivate;
            iface->index = ifindex++;
            interfaces << iface;
            iface->name = qt_TDesC2QString(info.iName);
            iface->flags = convertFlags(info);

            if (/*info.iFeatures&KIfHasHardwareAddr &&*/ info.iHwAddr.Family() != KAFUnspec) {
                for (TInt i = sizeof(SSockAddr); i < sizeof(SSockAddr) + info.iHwAddr.GetUserLen(); i++) {
                    address.AppendNumFixedWidth(info.iHwAddr[i], EHex, 2);
                    if ((i + 1) < sizeof(SSockAddr) + info.iHwAddr.GetUserLen())
                        address.Append(_L(":"));
                }
                address.UpperCase();
                iface->hardwareAddress = qt_TDesC2QString(address);
            }

            // Get the address of the interface
            entry.setIp(qt_QHostAddressFromTInetAddr(info.iAddress));

#if defined(QNETWORKINTERFACE_DEBUG)
            qDebug() << "address is" << info.iAddress.Family() << entry.ip();
            qDebug() << "netmask is" << info.iNetMask.Family() << qt_QHostAddressFromTInetAddr( info.iNetMask );
#endif

            // Get the interface netmask
            if (info.iNetMask.IsUnspecified()) {
                // For some reason netmask is always 0.0.0.0 for IPv4 interfaces
                // and loopback interfaces (which we statically know)
                if (info.iAddress.IsV4Mapped()) {
                    if (info.iFeatures & KIfIsLoopback) {
                        entry.setPrefixLength(32);
                    } else {
                        // Workaround: Let Symbian determine netmask based on IP address class (IPv4 only API)
                        TInetAddr netmask;
                        netmask.NetMask(info.iAddress);
                        entry.setNetmask(QHostAddress(netmask.Address())); //binary convert v4 address
                        addressesWithEstimatedNetmasks << entry.ip();
#if defined(QNETWORKINTERFACE_DEBUG)
                        qDebug() << "address class determined netmask" << entry.netmask();
#endif
                    }
                } else {
                    // For IPv6 interfaces
                    if (info.iFeatures & KIfIsLoopback) {
                        entry.setPrefixLength(128);
                    } else if (info.iNetMask.IsUnspecified()) {
                        //Don't see this error for IPv6, but try to handle it if it happens
                        entry.setPrefixLength(64); //most common
#if defined(QNETWORKINTERFACE_DEBUG)
                        qDebug() << "total guess netmask" << entry.netmask();
#endif
                        addressesWithEstimatedNetmasks << entry.ip();
                    }
                }
            } else {
                //Expected code path for IPv6 non loopback interfaces (IPv4 could come here if symbian is fixed)
                entry.setNetmask(qt_QHostAddressFromTInetAddr(info.iNetMask));
#if defined(QNETWORKINTERFACE_DEBUG)
                qDebug() << "reported netmask" << entry.netmask();
#endif
            }

            // broadcast address is determined from the netmask in postProcess()

            // Add new entry to interface address entries
            iface->addressEntries << entry;

#if defined(QNETWORKINTERFACE_DEBUG)
            qDebug("\n       Found network interface %s, interface flags:\n\
                IsUp = %d, IsRunning = %d, CanBroadcast = %d,\n\
                IsLoopBack = %d, IsPointToPoint = %d, CanMulticast = %d, \n\
//.........这里部分代码省略.........
开发者ID:Blizzard,项目名称:qt4,代码行数:101,代码来源:qnetworkinterface_symbian.cpp

示例5: doTestStepL

TVerdict CTestStepLLMNR_Init::doTestStepL()
    {
    
    TInt        cntNode, nRes;
    TName       tmpBuf;
    TName       tmpBuf1;
    
    SetTestStepResult(EPass);
    
    TESTL(GetIntFromConfig(KNodesSection, _L("StartUpDelay"), nRes) && nRes > 0);
    const TInt startUpDelay = nRes*KOneSecond;  
    
    INFO_PRINTF1(KNewLine);
    INFO_PRINTF1(_L("Initializing LLMNR test engine..."));
    
    //-- wait some time for settling name conflict resolution within LLMNR mechanism 
    User::After(ipTestServer->RandomizeNum(startUpDelay, startUpDelay));
    
    RIPAddrArray&   localAddrs  = ipTestServer->iLocalAddrs;
    TNetworkInfo&   networkInfo = ipTestServer->iNetworkInfo;
    
    //-- reset network information and local IP addresses table
    networkInfo.Reset();
    localAddrs.Reset();
    
    //--------------------------------------------
    
    //-- load network configuration from ini file
    LoadNetworkConfigFromIniL(networkInfo);
    
    //-- start up network layer and LLMNR engine
    TESTL(StartUpLLMNR());
    
    //-- wait some time for settling name conflict resolution within LLMNR mechanism
    User::After(ipTestServer->RandomizeNum(startUpDelay));
    
    //-- list available network interfaces and their IP addresses
    ListInterfacesL();
    
    //-- try to resolve every host name and obtain its IP address
    ProbeNodes(networkInfo);
    
    //-----------------------------------------------------------
    
    //-- print out alive hosts names, IP addresses, etc and check the number of hosts
    INFO_PRINTF1(_L("--- available hosts list:\n"));
    
    
    TInt foreignNodeCnt = 0; //-- number of foreign hosts (IP addresses that not ours)
    TInt localNodeCnt = 0;   //-- number of local IP addresses
    
    for(cntNode=0; cntNode < networkInfo.NodesCount(); ++cntNode)
        {
        TNodeInfo& currNode = networkInfo[cntNode]; //-- current node info
        
        if(currNode.iAlive)
            {
            
            //-- print host name and its IP address
            tmpBuf.Copy(currNode.iHostName);
            tmpBuf.Append(_L(" "));
            
            currNode.iAddr.Output(tmpBuf1);
            tmpBuf.Append(tmpBuf1);
            
            //-- search IP address in the array of local host addresses.
            //-- if found, mark the appropriate hostInfo element as having local address.
            currNode.iLocal = (ipTestServer->iLocalAddrs.Find(currNode.iAddr, TIdentityRelation<TInetAddr>(IPAddrIsEqual)) != KErrNotFound);
            
            if(currNode.iLocal)
                {   
                tmpBuf.Append(_L(" [local address]"));
                localNodeCnt++;
                }
            
            if(currNode.iIpUnique)
                tmpBuf.Append(_L(" [U]"));
            
            if(! currNode.iLocal && currNode.iIpUnique)
                foreignNodeCnt++;
            
            INFO_PRINTF1(tmpBuf);
            }
        }
    
    INFO_PRINTF1(KNewLine);
    
    //-- check the number of nodes with local IP addresses to ensure that test config are correct
    if(localNodeCnt <1) 
        {
        INFO_PRINTF1(_L("??? Error! No nodes found with local IP. Check the test configuration.\n"));
        SetTestStepResult(EInconclusive);
        return TestStepResult();
        }
    
    //-- we need at least 1 other external host
    if(foreignNodeCnt < 1)
        {
        INFO_PRINTF1(_L("Error! For successfull testing you should have at least 1 external hosts available!\n"));
        SetTestStepResult(EInconclusive);
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:101,代码来源:LlmnrInit.cpp

示例6: ListInterfacesL

/**
*   List existing network interfaces, IP addresses bound to them 
*   and fill up array of IP addresses for all interfaces.
*/
void CTestStepLLMNR_Init::ListInterfacesL()
    {
    
    RSocket socket;
    TInt    nRes;
    TInt    exceed;
    TInt    idx;
    TName   tmpBuf;
    TName   tmpBuf1;
    
    nRes = socket.Open(ipTestServer->iSocketServer, KAfInet, KSockStream, KProtocolInetTcp);
    TESTL(nRes == KErrNone);
    
    TUint   bufsize = 2048;
    
    HBufC8 *buffer =NULL;
    buffer = GetBuffer(buffer, bufsize);
    TESTL(buffer != NULL);
    
    TPtr8 bufdes = buffer->Des();
    
    //-- reset array of local addresses
    ipTestServer->iLocalAddrs.Reset();
    
    //-- list all available network interfaces
    INFO_PRINTF1(KNewLine);
    INFO_PRINTF1(_L("--- available network interfaces:"));
    
    do
        {//-- get list of network interfaces
        // if exceed>0, all interface could not fit into the buffer.
        // In that case allocate a bigger buffer and retry.
        // There should be no reason for this while loop to take more than 2 rounds.
        bufdes.Set(buffer->Des());
        exceed = socket.GetOpt(KSoInetInterfaceInfo, KSolInetIfQuery, bufdes);
        if(exceed > 0)
            {
            bufsize += exceed * sizeof(TInetInterfaceInfo);
            buffer = GetBuffer(buffer, bufsize);
            TESTL(buffer != NULL);
            }
        } while (exceed > 0);
        
        if (exceed < 0)
            {
            INFO_PRINTF1(_L("socket.GetOpt() error!"));
            TESTL(EFalse);
            }
        
        TOverlayArray<TInetInterfaceInfo> infoIface(bufdes);
        
        for(idx=0; idx < infoIface.Length(); ++idx)
            {
            TInetInterfaceInfo& iface = infoIface[idx];
            
            tmpBuf.Format(_L("index:%d, name: "),iface.iIndex);
            tmpBuf.Append(iface.iName );
            tmpBuf.AppendFormat(_L(" state:%d"), iface.iState);
            INFO_PRINTF1(tmpBuf);
            }
        
        //-- list all IP addresses, bound to the interfaces
        //-- and append this address to the array of host-local addresses
        INFO_PRINTF1(KNewLine);
        INFO_PRINTF1(_L("--- IP addresses bound to the interfaces:"));
        
        do
            {
            // if exceed>0, all interface could not fit into the buffer.
            // In that case allocate a bigger buffer and retry.
            // There should be no reason for this while loop to take more than 2 rounds.
	        bufdes.Set(buffer->Des());
            exceed = socket.GetOpt(KSoInetAddressInfo, KSolInetIfQuery, bufdes);
            if(exceed > 0)
                {
                bufsize += exceed * sizeof(TInetAddressInfo);
                buffer = GetBuffer(buffer, bufsize);
                }
            } while (exceed > 0);
            
            if (exceed < 0)
                {
                INFO_PRINTF1(_L("socket.GetOpt() error!"));
                TESTL(EFalse);
                }
            
            
            //-- print out IP addresses
            TOverlayArray<TInetAddressInfo> infoAddr(bufdes);
            TInetAddr inetAddr;
            
            for(idx=0; idx < infoAddr.Length(); ++idx)
                {
                TInetAddressInfo& addr = infoAddr[idx];
                
                tmpBuf.Format(_L("iface index: %d, scopeID: %d, state: %d, IP addr: "), addr.iInterface, addr.iScopeId, addr.iState);
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:101,代码来源:LlmnrInit.cpp

示例7: ProbeNodes

/**
*   Tries to resolve each host name from the table loaded from ini file.
*   @param aNetworkInfo ref. to the TNetworkInfo structure, which will be populated
*/
void CTestStepLLMNR_Init::ProbeNodes(TNetworkInfo&  aNetworkInfo)
    {
    TName       tmpBuf;
    TInt        nRes;
    TNameEntry  nameEntry;
    
    //-- start name resolution for every entry in HostInfo
    GetIntFromConfig(KNodesSection, _L("ScanMaxDelay"), nRes);
    const TInt scanMaxDelay = nRes*KOneSecond;
    
    for(;;)
        {
        TInt cntFinishedHosts = 0;
        
        for(TInt cntNode=0; cntNode< aNetworkInfo.NodesCount(); ++cntNode)
            {
            
            TNodeInfo& currNode = aNetworkInfo[cntNode]; //-- current node info
            
            if( ! currNode.iAlive && currNode.iCntTrials >0) 
                {//-- the host is worth asking its IP address
                
                //-- a small random delay between sending queries
                User::After(ipTestServer->RandomizeNum(scanMaxDelay));
                
                INFO_PRINTF1(KNewLine);
                tmpBuf.Copy(_L("- Probing host: "));
                tmpBuf.Append(currNode.iHostName);
                INFO_PRINTF1(tmpBuf);
                
                nRes = ipTestServer->iHostResolver.GetByName(currNode.iHostName, nameEntry);
                
                if(nRes == KErrNone)
                    {//-- current host name has been resolver successfully, mark it alive and store its IP address
                    
                    //-- check if the obtained IP address is unique in TNetworkInfo
                    currNode.iIpUnique = (aNetworkInfo.FindIP(nameEntry().iAddr) < 0);
                    
                    currNode.iAddr = nameEntry().iAddr;   
                    currNode.iAlive = ETrue;
                    
                    currNode.iAddr.Output(nameEntry().iName);
                    tmpBuf.Copy(_L("name resolved: "));
                    tmpBuf.Append(nameEntry().iName);
                    INFO_PRINTF1(tmpBuf);
                    }
                else 
                    {//-- no response    
                    currNode.iCntTrials --; //-- decrease trials counter for this hostname
                    INFO_PRINTF2(_L("name resolution error: %d"), nRes);
                    }
                }
            else
                cntFinishedHosts++;
            
            }
        
        //-- check, whether we need to continue nodes scanning
        //-- if either host is alive or has trials counted down to 0, exit
        if(cntFinishedHosts == aNetworkInfo.NodesCount())
            break;
        } //for(;;)
    
    INFO_PRINTF1(KNewLine);
    
    }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:70,代码来源:LlmnrInit.cpp

示例8: StartL

void CAppStarter::StartL()
	{
	TFileName newname = iExeFileName;

	TThreadId threadId = 0;

	switch(iAppType)
		{
		case EApplicationType:
			{
			TApaAppInfo info;
			if(iSession.GetAppInfo(info,TUid::Uid(iAppUid)) != KErrNone)
				{
				After(KRetryWait);
				return;
				}
			
			if(iViewless)
				{
				TRAPD(err, TryStartViewlessAppL(info, threadId));
				if (err != KErrNone)
					{
					After(KRetryWait);
					return; //ignore error
					}
				}
			else if (info.iUid!=KNullUid)
				{
				if(iSession.StartDocument(newname, TUid::Uid(iAppUid), threadId) != KErrNone)
					{
					After(KRetryWait);
					return;
					}
				}
			else
				{
				iState = EAppFailed;
				Next();
				}
			}
			break;
		case EExecutableType:
			{
			newname.Append(KExtension);
			if(iSession.StartDocument(newname, TUid::Uid(0), threadId) != KErrNone)
				{
				After(KRetryWait);
				return;
				}
			}
			break;
		case ECmdLnArgExecutableType:
			{
			ASSERT( !iMonitoring); // Not imlpemented yet
#if defined(__WINS__) || defined(__WINSCW__)
			TName libName = iDllFileName;
			libName.Append(KExtension);
			RLibrary lib;
			TInt error = lib.Load(libName);
			if (error!=KErrNone)
				{
				After(KRetryWait);
				return;
				}
			TThreadFunction serverFunc=reinterpret_cast<TThreadFunction>(lib.Lookup(1));
			RThread server;
			error=server.Create(libName,serverFunc, iStackSize, iCmdLineArgs, &lib,NULL,
								iMinHeapSize,iMaxHeapSize,EOwnerProcess);
			lib.Close();	// if successful, server thread has handle to library now
#else
			RProcess server;
			TInt error = server.Create(newname, *iCmdLineArgs);
#endif
			if( error != KErrNone)
				{
				After(KRetryWait);
				return;
				}
			server.Resume();
			server.Close();
			}
			break;
		default:
			iState = EAppFailed;
			Next();
		}
	
	if (iMonitoring)
		{
		CThreadWatcher *threadWatcher=NULL;
		TRAPD(err, threadWatcher = CThreadWatcher::NewL(iAppType, threadId, newname, iStarter, iAppUid, iViewless));
		if (err == KErrNone) //ignore errors
			iQue->AddLast(*threadWatcher);
		}
	iState = EAppStarted;
	Next();
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:97,代码来源:AppStarter.cpp

示例9: 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

示例10: 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

示例11: lineName

void CCTsySessionManagementFU::AuxOpenExisting3L(const TDesC &aName)
	{
	OpenEtelServerL(EUseExtendedError);
	CleanupStack::PushL(TCleanupItem(Cleanup,this));
	OpenPhoneL();

    TName lineName(aName);    
    RLine line;
    
    TInt ret  = line.Open(iPhone, lineName);
    ASSERT_EQUALS(KErrNone, ret);
    CleanupClosePushL(line);  
    
    TName callname;
	RCall call;
	
    ret = OpenNewCall(line, call, lineName, callname);
    ASSERT_EQUALS(KErrNone, ret);
    CleanupClosePushL(call);    


	// test on bad call name

	_LIT(KBadCallName, "BadCallName");

	RCall call2;
	
	ret = call2.OpenExistingCall(line, KBadCallName);
    ASSERT_EQUALS(KErrNotFound, ret);
	
	AssertMockLtsyStatusL();


	// test on bad line name

	_LIT(KBadLineName, "BadLineName");

    TName name;
    name = KBadLineName;
    name.Append(KDoubleColon);
    name.Append(callname);

	ret = call2.OpenExistingCall(iPhone, name);
    ASSERT_EQUALS(KErrNotSupported, ret);
	
	AssertMockLtsyStatusL();


	// test on bad call name and correct line

    name = lineName;
    name.Append(KDoubleColon);
    name.Append(KBadCallName);

	ret = call2.OpenExistingCall(iPhone, name);
    ASSERT_EQUALS(KErrNotFound, ret);
	
	AssertMockLtsyStatusL();


	// test on bad phone name

	_LIT(KBadPhoneName, "BadPhoneName");

    name = KBadPhoneName;
    name.Append(KDoubleColon);
    name.Append(lineName);
    name.Append(KDoubleColon);
    name.Append(callname);
	
	ret = call2.OpenExistingCall(iTelServer, name);
    ASSERT_EQUALS(KErrNotFound, ret);

	AssertMockLtsyStatusL();


	// test on bad line name and correct phone

    name = KMmTsyPhoneName;
    name.Append(KDoubleColon);
    name.Append(KBadLineName);
    name.Append(KDoubleColon);
    name.Append(callname);
	
	ret = call2.OpenExistingCall(iTelServer, name);
    ASSERT_EQUALS(KErrNotSupported, ret);

	AssertMockLtsyStatusL();


	// test on bad call name with correct phone and line

    name = KMmTsyPhoneName;
    name.Append(KDoubleColon);
    name.Append(lineName);
    name.Append(KDoubleColon);
    name.Append(KBadCallName);
	
	ret = call2.OpenExistingCall(iTelServer, name);
    ASSERT_EQUALS(KErrNotFound, ret);
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:101,代码来源:cctsysessionmanagementfu.cpp

示例12: RunL

/*
-------------------------------------------------------------------------------

    Class: CUnderTaker

    Method: RunL

    Description: Handles thread death.
    Function does:
    1 ) Stops monitoring thread
    1 ) Marks thread death
    2 ) Completes ongoing requests
    3 ) Cleans the memory

    Parameters: None

    Return Values: None

    Errors/Exceptions: None

    Status: Proposal

-------------------------------------------------------------------------------
*/
void CUnderTaker::RunL()
    {

    // Make sure that any of the test interference thread's won't stay to run.
    iModuleContainer->KillTestinterferenceThread();

    // Make sure that any of the test measurement's process won't stay to run.
    iModuleContainer->KillTestMeasurement();

    // Get the exit category
    TName exitCategory = _L( "Crash reason:" );
    exitCategory.Append( iModuleContainer->iThread.ExitCategory() );
    TInt exitReason = iModuleContainer->iThread.ExitReason();
    TFullTestResult::TCaseExecutionResult exitType = TFullTestResult::ECaseException;
    if( iModuleContainer->iThread.ExitType() == EExitPanic )
        {
        exitType = TFullTestResult::ECasePanic;
        }    

    // it is not running anymore..
    iModuleContainer->iUpAndRunning = EFalse;

    // Do not monitor anymore.
    iModuleContainer->iThread.LogonCancel( iStatus );
    iCancelNeeded = EFalse;

    __TRACE( KError,( CStifLogger::ERed, _L( "Execution thread crashed, exitReason = %d" ), exitReason ) );
    __TRACE( KError,( CStifLogger::ERed, exitCategory ) );    

    if ( iSynchronousMode )
        {        

        // Synchronous request was running. Complete that 
          // operation.
        __TRACE( KVerbose,( _L( "CUnderTaker::RunL Crash during synchronous operation" ) ) );
        iModuleContainer->iErrorResult = KErrDied;
        iModuleContainer->Cancel();
        iModuleContainer->iUpAndRunning = EFalse;

        // Print notification
        TName operationText = _L("Test module died when calling:");
        operationText.Append( iModuleContainer->iOperationText );

        // Print to log file        
        __TRACE( KError,( CStifLogger::ERed, operationText ) );
        // Print to UI
        iModuleContainer->iCTestModule->ErrorPrint ( 1, operationText );        

        // Stop active scheduler.
        CActiveScheduler::Stop();

        // Execution continues from CTestModuleContainer::StartAndWaitOperation.

        }
    else
        {// Test case was running, 

        __TRACE( KError,( _L( "Test case execution aborted" ) ) );
        __TRACE( KVerbose,( _L( "CUnderTaker::Run crash during test execution" ) ) );      

        TInt caseResult = KErrGeneral;
        
        // Check if case have any special panic or exception codes that are "passed"
        if ( iModuleContainer->iAllowedExitReason != 
             CTestModuleIf::ENormal )            
            {
                
            if ( iModuleContainer->iAllowedExitReason == 
                 CTestModuleIf::EPanic &&
                 exitType == TFullTestResult::ECasePanic &&
                 iModuleContainer->iAllowedExitCode == exitReason )
                {
                exitType = TFullTestResult::ECaseExecuted;
                caseResult = KErrNone;
                exitCategory = _L("Allowed case panic");
                
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:101,代码来源:Testundertaker.cpp

示例13: err

static QList<QNetworkInterfacePrivate *> interfaceListing()
{
    TInt err(KErrNone);
    QList<QNetworkInterfacePrivate *> interfaces;

    // Connect to Native socket server
    RSocketServ socketServ;
    err = socketServ.Connect();
    if (err)
        return interfaces;

    // Open dummy socket for interface queries
    RSocket socket;
    err = socket.Open(socketServ, _L("udp"));
    if (err) {
        socketServ.Close();
        return interfaces;
    }

    // Ask socket to start enumerating interfaces
    err =  socket.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl);
    if (err) {
        socket.Close();
        socketServ.Close();
        return interfaces;
    }

    int ifindex = 0;
    TPckgBuf<TSoInetInterfaceInfo> infoPckg;
    TSoInetInterfaceInfo &info = infoPckg();
    while (socket.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, infoPckg) == KErrNone) {
        // Do not include IPv6 addresses because netmask and broadcast address cannot be determined correctly
        if (info.iName != KNullDesC && info.iAddress.IsV4Mapped()) {
            TName address;
            QNetworkAddressEntry entry;
            QNetworkInterfacePrivate *iface = 0;

            iface = new QNetworkInterfacePrivate;
            iface->index = ifindex++;
            interfaces << iface;
            iface->name = qt_TDesC2QString(info.iName);
            iface->flags = convertFlags(info);

            if (/*info.iFeatures&KIfHasHardwareAddr &&*/ info.iHwAddr.Family() != KAFUnspec) {
                for (TInt i = sizeof(SSockAddr); i < sizeof(SSockAddr) + info.iHwAddr.GetUserLen(); i++) {
                    address.AppendNumFixedWidth(info.iHwAddr[i], EHex, 2);
                    if ((i + 1) < sizeof(SSockAddr) + info.iHwAddr.GetUserLen())
                        address.Append(_L(":"));
                }
                address.UpperCase();
                iface->hardwareAddress = qt_TDesC2QString(address);
            }

            // Get the address of the interface
            info.iAddress.Output(address);
            entry.setIp(QHostAddress(qt_TDesC2QString(address)));

            // Get the interface netmask
            // For some reason netmask is always 0.0.0.0
            // info.iNetMask.Output(address);
            // entry.setNetmask( QHostAddress( qt_TDesC2QString( address ) ) );

            // Workaround: Let Symbian determine netmask based on IP address class
            // TODO: Works only for IPv4 - Task: 259128 Implement IPv6 support
            TInetAddr netmask;
            netmask.NetMask(info.iAddress);
            netmask.Output(address);
            entry.setNetmask(QHostAddress(qt_TDesC2QString(address)));

            // Get the interface broadcast address
            if (iface->flags & QNetworkInterface::CanBroadcast) {
                // For some reason broadcast address is always 0.0.0.0
                // info.iBrdAddr.Output(address);
                // entry.setBroadcast( QHostAddress( qt_TDesC2QString( address ) ) );

                // Workaround: Let Symbian determine broadcast address based on IP address
                // TODO: Works only for IPv4 - Task: 259128 Implement IPv6 support
                TInetAddr broadcast;
                broadcast.NetBroadcast(info.iAddress);
                broadcast.Output(address);
                entry.setBroadcast(QHostAddress(qt_TDesC2QString(address)));
            }

            // Add new entry to interface address entries
            iface->addressEntries << entry;

#if defined(QNETWORKINTERFACE_DEBUG)
            printf("\n       Found network interface %s, interface flags:\n\
                IsUp = %d, IsRunning = %d, CanBroadcast = %d,\n\
                IsLoopBack = %d, IsPointToPoint = %d, CanMulticast = %d, \n\
                ip = %s, netmask = %s, broadcast = %s,\n\
                hwaddress = %s",
                   iface->name.toLatin1().constData(),
                   iface->flags & QNetworkInterface::IsUp, iface->flags & QNetworkInterface::IsRunning, iface->flags & QNetworkInterface::CanBroadcast,
                   iface->flags & QNetworkInterface::IsLoopBack, iface->flags & QNetworkInterface::IsPointToPoint, iface->flags & QNetworkInterface::CanMulticast,
                   entry.ip().toString().toLatin1().constData(), entry.netmask().toString().toLatin1().constData(), entry.broadcast().toString().toLatin1().constData(),
                   iface->hardwareAddress.toLatin1().constData());
#endif
        }
    }
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:100,代码来源:qnetworkinterface_symbian.cpp

示例14: OpenNewCallL

void CTelServerProcessor::OpenNewCallL()
/**
Load the TSY and open a new call from the ETEL server
*/
	{
	__ASSERT_ALWAYS(!iCallOpen, NetDialPanic(EEtelCallAlreadyOpen));
	__ASSERT_ALWAYS(iCallType==EUnknown, NetDialPanic(EEtelCallAlreadyOpen));

	TBuf<KCommsDbSvrMaxFieldLength> newTsyName;
	iDb->GetTsyNameL(newTsyName);
	// Remove unnecessary .TSY extension, if found
	if (newTsyName.Right(4).CompareF(KTsyNameExtension) == 0)
		newTsyName = newTsyName.Left(newTsyName.Length() - 4);

	TBool loaded=EFalse;
	if (iTsyName.Length()!=0)
		{
		if (iTsyName.CompareF(newTsyName)==KErrNone)	// the one we want is already loaded
			loaded=ETrue;
		else											// unload the one we were using
			{
			User::LeaveIfError(iTelServer.UnloadPhoneModule(iTsyName));
			iTsyLoaded=EFalse;
			}
		}

	if (!loaded)
		{
		User::LeaveIfError(iTelServer.LoadPhoneModule(newTsyName));
		iTsyName=newTsyName;
		iTsyLoaded=ETrue;
		}
	
	if (iTelServer.SetExtendedErrorGranularity(RTelServer::EErrorExtended)!=KErrNone)
		{
		User::LeaveIfError(iTelServer.SetExtendedErrorGranularity(RTelServer::EErrorBasic));
		}

	RTelServer::TPhoneInfo info;
	GetPhoneInfoL(info);
	
	TName callName;
	callName.Zero();
	callName.Copy(info.iName);		// phone name
	callName.Append(KDoubleColon);

	RPhone::TLineInfo lineInfo;
	GetLineInfoL(lineInfo,info.iName,RLine::KCapsData);
	callName.Append(lineInfo.iName);
	
	callName.Append(KDoubleColon);
	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CTELSERVERPROCESSOR_OPENNEWCALLL_1, "NetDial:\tOpening Call");

	iDb->CopyIspInitStringToModemL();	// will not leave if the field is blank
	// Only MultimodeV1 and greater supported!
	if (info.iExtensions>=(TUint)KETelExtMultimodeV1)
		{
		User::LeaveIfError(iMmCall.OpenNewCall(iTelServer,callName));
		iCallOpen=ETrue;
		iCallType=EMmDataCall;
		SetMmParametersL();	// may change call type to EMmHscsdCall
		}
	else
		{
		User::LeaveIfError(iCall.OpenNewCall(iTelServer,callName));
		iCallOpen=ETrue;
		iCallType=ECoreCallOnly;
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:69,代码来源:ND_ETEL.CPP


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