Esempio n. 1
0
void RfidReaderMac::addSelectHeader(PacketPtr packet, 
	NodeId receiverId) const
{
	RfidReaderMacDataPtr macData = RfidReaderMacData::create();
	macData->setType(RfidReaderMacData::Types_Select);
	macData->setSenderId(getNode()->getNodeId());
	macData->setReceiverId(receiverId);
	packet->setDoMaxTxPower(true);
	packet->addData(Packet::DataTypes_Link, *macData);
}
Esempio n. 2
0
PacketPtr RfidReaderMac::createAckPacket(NodeId destination) const
{
	RfidReaderMacDataPtr macData = RfidReaderMacData::create();
	macData->setType(RfidReaderMacData::Types_Ack);
	macData->setSenderId(getNode()->getNodeId());
	macData->setReceiverId(destination);

	PacketPtr packet = Packet::create();
	packet->setDoMaxTxPower(true);
	packet->addData(Packet::DataTypes_Link, *macData);
	return packet;
}