inet-3.6.4/src/inet/linklayer/xmac/XMacLayer.cc
/**
 * Check whether the queue is not full: if yes, print a warning and drop the
 * packet. Then initiate sending of the packet, if the node is sleeping. Do
 * nothing, if node is working.
 */
Check whether the queue is not full: if yes, print a warning and drop the
packet. Then initiate sending of the packet, if the node is sleeping. Do
nothing, if node is working.
Check whether the queue is not full : if yes print a warning and drop the packet . Then initiate sending of the packet if the node is sleeping . Do nothing if node is working .
void XMacLayer::handleUpperPacket(cPacket *msg)
{
	bool pktAdded = addToQueue(msg);
	if (!pktAdded)
		return;
	if (wakeup->isScheduled() && (macState == SLEEP))
	{
		cancelEvent(wakeup);
		scheduleAt(simTime() + dblrand()*0.01f, wakeup);
	}else if(macState == SLEEP){
	}
}
void XMacLayer :: handleUpperPacket ( cPacket * msg ) { bool pktAdded = addToQueue ( msg ) ; if ( ! pktAdded ) return ; if ( wakeup -> isScheduled ( ) && ( macState == SLEEP ) ) { cancelEvent ( wakeup ) ; scheduleAt ( simTime ( ) + dblrand ( ) * 0.01f , wakeup ) ; } else if ( macState == SLEEP ) { } }
Check whether the queue is not full: if yes, print a warning and drop the
 packet.
Check whether the queue is not full : if yes print a warning and drop the packet .
// force wakeup now
