Hi All,
I want to know what is the role of "handler * h" and "callback_" in the
Mac802-11,specially in the recv() method of this class. I want to know what
will be happend if I dont let the outgoing packets to be sent by send(p, h)
method in a short duration in simulation. I did so as follows:
void Mac802_11::recv(Packet *p, Handler *h) {
if ( node_state_ == false ) { hdr->error() = 1; Packet::free(p); }
if ( node_state_ == true ) {
if(hdr->direction() == hdr_cmn::DOWN) { send(p, h); return; }
}
In fact by using the "node_state_" , when it is true by send() method the
packet can be sent to the destination , after chaneged to false, the recv()
method cant enters the send(p,h) , consequensely it cant send the packet to
destination as it is expected , but when it changes to true value again
after a short duration, it will not send a packet to the destination any
more. I cant understand where the problem is. I expect that when the
node_state is true it send the packet properly. but it seems something is
wrong with "handler * h" or "callback_" in the send() method , I guess so!
I would appreciate any help to solve my problem or any lesson about "handler
* h" and "callback_"
thanks a lot in advance
Amir