本文整理汇总了C++中PacketPtr::setTxPower方法的典型用法代码示例。如果您正苦于以下问题:C++ PacketPtr::setTxPower方法的具体用法?C++ PacketPtr::setTxPower怎么用?C++ PacketPtr::setTxPower使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PacketPtr
的用法示例。
在下文中一共展示了PacketPtr::setTxPower方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createRequestPacket
PacketPtr RfidReaderMac::createRequestPacket() const
{
RfidReaderMacDataPtr macData = RfidReaderMacData::create();
macData->setType(RfidReaderMacData::Types_Request);
macData->setSenderId(getNode()->getNodeId());
macData->setReceiverId(NodeId::broadcastDestination());
// We must have at least: (1) a contention slot,
// (2) a slot for the SELECT to be sent by the ready,
// (3) a slot for the tag to reply with an app packet,
// (4) a slot for the reader to reply with an ACK.
assert(m_nextCycleNumberOfSlots >= 4);
macData->setNumberOfSlots(m_nextCycleNumberOfSlots);
PacketPtr packet = Packet::create();
assert(m_currentAppReadPacket.get() != 0);
packet->setTxPower(m_currentAppReadPacket->getTxPower());
packet->addData(Packet::DataTypes_Link, *macData);
return packet;
}