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


C++ CompoundPtr::getCommandPool方法代码示例

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


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

示例1: doOnData

void DuplicateFilter::doOnData(const wns::ldk::CompoundPtr& compound)
{
    // retransmission, check sequence number
    DuplicateFilterCommand* command = getCommand(compound);

    if(not lastReceivedSN.knows(friends.manager->getTransmitterAddress(compound->getCommandPool())))
    {
        // first compound from source
        MESSAGE_SINGLE(NORMAL, logger, "Received first frame from " << friends.manager->getTransmitterAddress(compound->getCommandPool()) << " -> deliver");
        lastReceivedSN.insert(friends.manager->getTransmitterAddress(compound->getCommandPool()), command->peer.sn);
        getDeliverer()->getAcceptor(compound)->onData(compound);
    }
    else
    {
        if(lastReceivedSN.find(friends.manager->getTransmitterAddress(compound->getCommandPool())) != command->peer.sn)
        {
            // compound has different sn
            MESSAGE_SINGLE(NORMAL, logger, "Received frame from " << friends.manager->getTransmitterAddress(compound->getCommandPool()) << " with unknown sn -> deliver");
            getDeliverer()->getAcceptor(compound)->onData(compound);
            lastReceivedSN.update(friends.manager->getTransmitterAddress(compound->getCommandPool()), command->peer.sn);
        }
        else
        {
            MESSAGE_SINGLE(NORMAL, logger, "Received duplicate frame from " << friends.manager->getTransmitterAddress(compound->getCommandPool()) << " -> drop");
        }
    }
}
开发者ID:openwns,项目名称:wifimac,代码行数:27,代码来源:DuplicateFilter.cpp

示例2: getCommand

void
PhyUser::doOnData(const wns::ldk::CompoundPtr& compound)
{
	assure(compound, "doOnData called with an invalid compound.");

	PhyUserCommand* puCommand = getCommand( compound->getCommandPool() );
	LOG_INFO( getFUN()->getName(), ": doOnData source: ", puCommand->peer.source_->getName(),
			  "  C/I = ", puCommand->local.rxPower_, " / ", puCommand->local.interference_,
			  " = ", getCommand( compound->getCommandPool() )->magic.rxMeasurement->getSINR()
			  );
	if(puCommand->peer.estimatedCQI.interference.get_mW() > 0)
	{
		LOG_INFO( "estimated C/I = ",
				  puCommand->peer.estimatedCQI.carrier, " / ", puCommand->peer.estimatedCQI.interference,
				  " = " , puCommand->peer.estimatedCQI.carrier / puCommand->peer.estimatedCQI.interference,
				  "\n estimated intra-cell interference: ", puCommand->getEstimatedIintra()
			);
                       double delta_SINR = (getCommand( compound->getCommandPool() )->magic.rxMeasurement->getSINR().get_factor()) - (puCommand->peer.estimatedCQI.carrier / puCommand->peer.estimatedCQI.interference).get_factor();
                if(abs(delta_SINR) > 0.001)
                {
                    LOG_INFO( "Delta C / I: ", delta_SINR);
                }else{ LOG_INFO("abs(Delta C / I) < 0.001 "); }
        }
	else{
		LOG_INFO( "estimated C/I = ",
				  puCommand->peer.estimatedCQI.carrier, " / ", puCommand->peer.estimatedCQI.interference,
				  "\n estimated intra-cell interference: ", puCommand->getEstimatedIintra()
			);
	}
	getDeliverer()->getAcceptor(compound)->onData(compound);
}
开发者ID:openwns,项目名称:wimac,代码行数:31,代码来源:PhyUser.cpp

示例3: activateCommand

void
TxDurationSetter::processOutgoing(const wns::ldk::CompoundPtr& compound)
{
    TxDurationSetterCommand* command = activateCommand(compound->getCommandPool());
    wimemac::convergence::PhyMode phyMode = friends.manager->getPhyMode(compound->getCommandPool());

    // calculate tx duration
    wns::simulator::Time preambleTxDuration = friends.manager->getProtocolCalculator()->getDuration()->preamble(phyMode);

    if(friends.manager->isPreamble(compound->getCommandPool()))
    {
        command->local.txDuration = preambleTxDuration;

        MESSAGE_BEGIN(NORMAL, this->logger, m, "Preamble");
        m << ": duration " << command->local.txDuration;
        MESSAGE_END();
    }
    else
    {
        command->local.txDuration = friends.manager->getProtocolCalculator()->getDuration()->PSDU_PPDU(compound->getLengthInBits(), phyMode) - preambleTxDuration;
        //MESSAGE_BEGIN(VERBOSE, this->logger, m, "Outgoing Compound with size ");
        MESSAGE_BEGIN(NORMAL, this->logger, m, "Outgoing Compound with size ");
        m << compound->getLengthInBits();
        m << " with nIBP6S " << phyMode.getInfoBitsPer6Symbols();
        m << " --> duration " << friends.manager->getProtocolCalculator()->getDuration()->PSDU_PPDU(compound->getLengthInBits(), phyMode);
        m << " - " << preambleTxDuration;
        MESSAGE_END();

        MESSAGE_BEGIN(NORMAL, this->logger, m, "Command");
        m << " start " << wns::simulator::getEventScheduler()->getTime();
        m << " stop " << wns::simulator::getEventScheduler()->getTime() + command->local.txDuration;
        MESSAGE_END();

    }
}
开发者ID:openwns,项目名称:wimemac,代码行数:35,代码来源:TxDurationSetter.cpp

示例4: getCommand

void
PhyUser::traceIncoming(wns::ldk::CompoundPtr compound, wns::service::phy::power::PowerMeasurementPtr rxPowerMeasurement)
{
    wns::probe::bus::json::Object objdoc;

    PhyCommand* myCommand = getCommand(compound->getCommandPool());

    objdoc["Transmission"]["ReceiverID"] = wns::probe::bus::json::String(getFUN()->getLayer()->getNodeName());
    objdoc["Transmission"]["SenderID"] = wns::probe::bus::json::String(myCommand->magic.source->getName());
    objdoc["Transmission"]["SourceID"] = wns::probe::bus::json::String(myCommand->magic.source->getName());

    if(myCommand->magic.destination == NULL)
    {
        objdoc["Transmission"]["DestinationID"] = wns::probe::bus::json::String("Broadcast");
    }
    else
    {
        objdoc["Transmission"]["DestinationID"] = wns::probe::bus::json::String(myCommand->magic.destination->getName());
    }

    objdoc["Transmission"]["Start"] = wns::probe::bus::json::Number(myCommand->local.start);
    objdoc["Transmission"]["Stop"] = wns::probe::bus::json::Number(myCommand->local.stop);
    objdoc["Transmission"]["Subchannel"] = wns::probe::bus::json::Number(myCommand->local.subBand);
    objdoc["Transmission"]["TxPower"] = wns::probe::bus::json::Number(myCommand->magic.txp.get_dBm());
    objdoc["Transmission"]["RxPower"] = wns::probe::bus::json::Number(rxPowerMeasurement->getRxPower().get_dBm());
    objdoc["Transmission"]["InterferencePower"] = wns::probe::bus::json::Number(rxPowerMeasurement->getInterferencePower().get_dBm());

    if (myCommand->magic.estimatedSINR.carrier != wns::Power() &&
        myCommand->magic.estimatedSINR.interference != wns::Power())
    {
        objdoc["SINREst"]["C"] = wns::probe::bus::json::Number(myCommand->magic.estimatedSINR.carrier.get_dBm());
        objdoc["SINREst"]["I"] = wns::probe::bus::json::Number(myCommand->magic.estimatedSINR.interference.get_dBm());
    }

    if (schedulerCommandReader_->commandIsActivated(compound->getCommandPool()))
    {

        // Now we have a look at the scheduling time slot
        lte::timing::SchedulerCommand* schedCommand = schedulerCommandReader_->readCommand<lte::timing::SchedulerCommand>(compound->getCommandPool());

        wns::scheduler::SchedulingTimeSlotPtr ts = schedCommand->magic.schedulingTimeSlotPtr;

        wns::probe::bus::json::Array a;
        for (wns::scheduler::PhysicalResourceBlockVector::iterator it= ts->physicalResources.begin(); it != ts->physicalResources.end(); ++it)
        {
            wns::probe::bus::json::Object pr;
            pr["NetBits"] = wns::probe::bus::json::Number(it->getNetBlockSizeInBits());
            a.Insert(pr);
        }
        objdoc["SchedulingTimeSlot"]["PhysicalResources"] = a;
        objdoc["SchedulingTimeSlot"]["HARQ"]["enabled"] = wns::probe::bus::json::Boolean(ts->isHARQEnabled());
        objdoc["SchedulingTimeSlot"]["HARQ"]["ProcessID"] = wns::probe::bus::json::Number(ts->harq.processID);
        objdoc["SchedulingTimeSlot"]["HARQ"]["NDI"] = wns::probe::bus::json::Boolean(ts->harq.NDI);
        objdoc["SchedulingTimeSlot"]["HARQ"]["TransportBlockID"] = wns::probe::bus::json::Number(ts->harq.transportBlockID);
        objdoc["SchedulingTimeSlot"]["HARQ"]["RetryCounter"] = wns::probe::bus::json::Number(ts->harq.retryCounter);
    }
    wns::probe::bus::json::probeJSON(jsonTracingCC_, objdoc);
}
开发者ID:openwns,项目名称:lte,代码行数:58,代码来源:PhyUser.cpp

示例5: assure

	virtual void
	doVisit(wns::probe::bus::IContext& c, const wns::ldk::CompoundPtr& compound) const
	{
	  assure(compound, "Received NULL CompoundPtr");

	  if (macgCommandReader->commandIsActivated(compound->getCommandPool()) == true)
	    {
	      int hopCount = macgCommandReader->readCommand<lte::macg::MACgCommand>(compound->getCommandPool())->magic.hopCount;

	      assure(hopCount >= 1, "number of hops must be >=1, but it is " << hopCount);
	      assure(hopCount <= 2, "number of hops must be <=2, but it is " << hopCount);
	      c.insertInt(this->key, hopCount);
	    }
	}
开发者ID:openwns,项目名称:lte,代码行数:14,代码来源:HopCount.hpp

示例6: getFUN

void
RACHUT::doSendData(const wns::ldk::CompoundPtr& compound)
{
	// set PhyUser Command
	lte::macr::PhyCommand* phyCommand =
		dynamic_cast<lte::macr::PhyCommand*>(
			getFUN()->getProxy()->activateCommand( compound->getCommandPool(),
							       friends.phyUser ));

	simTimeType startTime = wns::simulator::getEventScheduler()->getTime(); // now

	phyCommand->local.beamforming = false;
	phyCommand->local.pattern = wns::service::phy::ofdma::PatternPtr(); // NULL Pointer
	phyCommand->local.start = startTime;
	phyCommand->local.stop = stopTime;
	phyCommand->local.subBand = subBandCounter++;
	phyCommand->local.modeRxTx = lte::macr::PhyCommand::Tx;
	phyCommand->local.phyModePtr = phyModePtr;
	phyCommand->magic.destination = NULL;
	phyCommand->magic.source = getFUN()->getLayer<dll::ILayer2*>()->getNode();
	phyCommand->magic.txp = txPower;


	if (getConnector()->hasAcceptor(compound)){
		assure(phyModePtr->dataRateIsValid(),"invalid PhyMode dataRate");
		MESSAGE_SINGLE(NORMAL, logger, "sent RACH compound ("<< *phyModePtr <<")");
		getConnector()->getAcceptor(compound)->sendData(compound);
	}
	else
	    assure(false, "Lower FU is not accepting scheduled PDU but is supposed to do so");

}
开发者ID:openwns,项目名称:lte,代码行数:32,代码来源:RACH.cpp

示例7: return

wns::ldk::CompoundPtr
RTSCTS::prepareCTS(const wns::ldk::CompoundPtr& rts)
{
    wns::ldk::CommandPool* rtsCP = rts->getCommandPool();

    // calculate nav from rts
    wns::simulator::Time nav = friends.manager->getFrameExchangeDuration(rtsCP) - sifsDuration - maximumCTSDuration;
    wns::ldk::CompoundPtr cts = friends.manager->createCompound(friends.manager->getReceiverAddress(rtsCP),
                                                                friends.manager->getTransmitterAddress(rtsCP),
                                                                ACK,
                                                                nav,
                                                                sifsDuration + preambleProcessingDelay);
    friends.manager->setPhyMode(cts->getCommandPool(), rtsctsPhyMode);
    RTSCTSCommand* rtsctsC = this->activateCommand(cts->getCommandPool());
    rtsctsC->peer.isRTS = false;

    MESSAGE_BEGIN(NORMAL, this->logger, m, "Prepare CTS frame");
    m << " to " << friends.manager->getTransmitterAddress(rtsCP);
    m << " with NAV " << nav;
    MESSAGE_END();

    this->ctsPrepared = wns::simulator::getEventScheduler()->getTime();

    return(cts);
}
开发者ID:openwns,项目名称:wifimac,代码行数:25,代码来源:RTSCTS.cpp

示例8: doOnData

void FrameHeadCollector::doOnData( const wns::ldk::CompoundPtr& compound )
{
    FrameHeadCommand* command =
        getCommand( compound->getCommandPool() );

    LOG_INFO( getFUN()->getLayer()->getName(), ": received FCH from station:",command->peer.baseStationID);

    if(channelQualityObserver_)
    {
        PhyUserCommand* phyCommand = phyUser_->getCommand(compound->getCommandPool());
        channelQualityObserver_->storeMeasurement(command->peer.baseStationID, 
            phyCommand->magic.rxMeasurement);
    }

    getFrameBuilder()->getTimingControl()->finishedPhase( this );
}
开发者ID:openwns,项目名称:wimac,代码行数:16,代码来源:FrameHeadCollector.cpp

示例9: setNewTimeout

void
RTSCTS::onTxEnd(const wns::ldk::CompoundPtr& compound)
{
    if(this->pendingMPDU and
       (getFUN()->getProxy()->commandIsActivated(compound->getCommandPool(), this)) and
       (getCommand(compound->getCommandPool())->peer.isRTS) and
       (state == transmitRTS))
    {
        state = waitForCTS;
        setNewTimeout(ctsTimeout);
        MESSAGE_BEGIN(NORMAL, logger, m, "RTS to ");
        m << friends.manager->getReceiverAddress(compound->getCommandPool());
        m << " is sent, waiting for CTS for ";
        m << ctsTimeout;
        MESSAGE_END();
    }
}
开发者ID:openwns,项目名称:wifimac,代码行数:17,代码来源:RTSCTS.cpp

示例10: processOutgoing

void BSRelayMapper::processOutgoing( const wns::ldk::CompoundPtr& compound )
{
    RelayMapperCommand* command = dynamic_cast<RelayMapperCommand*>
        (getFUN()->getProxy()->activateCommand( compound->getCommandPool(), this ));

    command->peer.direction_ =
        RelayMapperCommand::Down;
}
开发者ID:openwns,项目名称:wimac,代码行数:8,代码来源:RelayMapper.cpp

示例11: Exception

void
RTSCTS::doSendData(const wns::ldk::CompoundPtr& compound)
{
    assure(this->pendingMPDU == wns::ldk::CompoundPtr(),
           "Cannot have two MPDUs");
    assure(this->pendingRTS == wns::ldk::CompoundPtr(),
           "Cannot have two RTSs");

    switch(friends.manager->getFrameType(compound->getCommandPool()))
    {
    case DATA_TXOP:
        if(not this->rtsctsOnTxopData)
        {
            break;
        }
        // fall through to DATA if RTS/CTS during TXOP is activ
    case DATA:
        if(compound->getLengthInBits() < this->rtsctsThreshold)
        {
            MESSAGE_SINGLE(NORMAL, this->logger,
                           "Outgoing DATA with size " << compound->getLengthInBits() << ", below threshold");
        }
        else
        {
            MESSAGE_SINGLE(NORMAL, this->logger,
                           "Outgoing DATA with size " << compound->getLengthInBits() << "-> Save and send RTS");
            this->pendingMPDU = compound;
            this->pendingRTS = this->prepareRTS(this->pendingMPDU);

            // RTS/CTS initializes mini-TXOP for compound, it can be send
            // directly after SIFS
            friends.manager->setFrameType(this->pendingMPDU->getCommandPool(), DATA_TXOP);

            // try to send RTS
            if(getConnector()->hasAcceptor(this->pendingRTS))
            {
                state = transmitRTS;
                getConnector()->getAcceptor(compound)->sendData(this->pendingRTS);
                this->pendingRTS = wns::ldk::CompoundPtr();
            }
            return;
        }
        break;
    default:
        throw wns::Exception("Unknown frame type");
        break;
    }

    // try to send data
    if(getConnector()->hasAcceptor(compound))
    {
        getConnector()->getAcceptor(compound)->sendData(compound);
    }
    else
    {
        this->pendingMPDU = compound;
    }
}
开发者ID:openwns,项目名称:wifimac,代码行数:58,代码来源:RTSCTS.cpp

示例12: doSendData

void DuplicateFilter::doSendData(const wns::ldk::CompoundPtr& compound)
{
	// add duplicate filter command
    DuplicateFilterCommand* command = activateCommand(compound->getCommandPool());
    command->peer.sn = nextSN;
    ++nextSN;

	getConnector()->getAcceptor(compound)->sendData(compound);
}
开发者ID:openwns,项目名称:wifimac,代码行数:9,代码来源:DuplicateFilter.cpp

示例13: assure

void
PhyUser::doSendData(const wns::ldk::CompoundPtr& compound)
{
    assure(compound, "sendData called with an invalid compound.");
    assure(getFUN()->getProxy()->commandIsActivated( compound->getCommandPool(), this),
           "PhyCommand not specified. PhyUser can not handle this compound!");

    // finally commit CommandPool Size
    this->commitSizes(compound->getCommandPool());

    PhyCommand* myCommand = getCommand(compound->getCommandPool());
    if (myCommand->local.modeRxTx == lte::macr::PhyCommand::Tx)
    {
        MESSAGE_SINGLE(NORMAL, logger,"doSendData(Tx): start="
            << myCommand->local.start <<"s..stop=" 
            << myCommand->local.stop <<"s => d="
            << (myCommand->local.stop-myCommand->local.start) * 1e6
            << "us, subBand=" << myCommand->local.subBand 
            << ", len="<<compound->getLengthInBits() << "bits");

        simTimeType startTime = myCommand->local.start;

        // Will call this->startTransmission at startTime
        es->schedule(StartTxEvent(compound, this), startTime);
        // Inform FUs that have added a callback that the compound is on air now
	    if (!myCommand->local.onAirCallback.empty())
	    {
		    myCommand->local.onAirCallback();
	    }
    }
    else
    { // reception (Rx)
        MESSAGE_SINGLE(NORMAL, logger,"doSendData(Rx): startTime="
            << myCommand->local.start <<", stopTime=" 
            << myCommand->local.stop << ", subBand=" 
            << myCommand->local.subBand << ", len="
            << compound->getLengthInBits() << "bits" 
            << " SHALL NOT OCCUR");

        assure(false,"Tryed to transmit while in RX mode");
    }
    // stamp link to my InterferenceCache into the Command
    myCommand->magic.remoteCache = iCache;
} // doSendData
开发者ID:openwns,项目名称:lte,代码行数:44,代码来源:PhyUser.cpp

示例14: getFUN

void
BeaconBuilder::doOnData( const wns::ldk::CompoundPtr& compound )
{

    wns::ldk::CommandPool* commandPool = compound->getCommandPool();

    wns::service::dll::UnicastAddress iam
    = getFUN()->findFriend<dll::UpperConvergence*>("upperConvergence")->getMACAddress();

    dll::UpperCommand* uc =
        friends.keyReader->readCommand<dll::UpperCommand>(commandPool);
    wns::service::dll::UnicastAddress tx = uc->peer.sourceMACAddress;

    //evaluate beacon, only Beacon Command is necessary
    if(tx != iam)
    {
        BeaconEvaluator::BeaconExamination(tx, iam, getCommand(compound->getCommandPool()),logger);
    }
}
开发者ID:openwns,项目名称:wimemac,代码行数:19,代码来源:BeaconBuilder.cpp

示例15: exit

bool
HARQReceiverProcess::decodeReceivedTransportBlock(wns::ldk::CompoundPtr transportBlockRedundancyVersion, imtaphy::interface::TransmissionStatusPtr status)
{
    ltea::mac::DownlinkControlInformation* dci =
        entity_->getDCIReader()->readCommand<ltea::mac::DownlinkControlInformation>(transportBlockRedundancyVersion->getCommandPool());
    
    
    MESSAGE_BEGIN(NORMAL, logger_, m, "HarqReceiverProcess::receive processID = " << processID_);
        m << ", RV = " << dci->peer.rv << ", TransmissionAttempt=" << dci->magic.transmissionAttempts
        << " NDI= " << dci->peer.NDI;
    MESSAGE_END();

    if (dci->peer.NDI)
    {
        receptionBuffer_.clear();
    }

    if (dci->magic.ackCallback.empty())
    {
        std::cout << "Tried to decode resource block with empty ack callback" << std::endl;
        exit(1);
    }

    if (dci->magic.nackCallback.empty())
    {
        std::cout << "Tried to decode resource block with empty nack callback" << std::endl;
        exit(1);
    }

    receptionBuffer_.push_back(std::make_pair<wns::ldk::CompoundPtr, imtaphy::interface::TransmissionStatusPtr>(transportBlockRedundancyVersion, status));
    
    
    if(entity_->getDecoder()->canDecode(receptionBuffer_))
    {
        MESSAGE_SINGLE(NORMAL, logger_, "HARQReceiver processID=" << processID_ << " sucessful decoded");
        
        receptionBuffer_.clear();

        // send magic ACK feedback to sending process        
        dci->magic.ackCallback();
        
        return true;
    }
    else
    {
            
        MESSAGE_SINGLE(NORMAL, logger_, "HARQReceiver processID=" << processID_ << " failed to decode"
        << " Transmission attempt: " << dci->magic.transmissionAttempts);

        // send magic NACK feedback to sending process        
        dci->magic.nackCallback();

        return false;
    }
}
开发者ID:lshmenor,项目名称:IMTAphy,代码行数:55,代码来源:HARQReceiverProcess.cpp


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