Hello,
I've been trying to do a simulation of a wireless network, where the one of the nodes runs a UdpClient and and the other node has a UdpServer. My purpose is to do some modifications to the TxPower whenever a packet is received. So, I created a callback function and set it on the corresponding NetDevice, using SetReceiveCallback. However, when I run the script without the commands that sets the callback, the node is connected to the other one, but when I add this command, nothing happens at all. Can anyone help?
Thanks in advance,
Nikos
Code:
/*The callback function*/
bool OnReceive(Ptr<NetDevice> dev, Ptr<const Packet> packet, uint16_t protocol, const Address & receiveAddr){//
return true;
}
int main(){
...
...
...
staDevices.Get(0)-> SetReceiveCallback(MakeCallback(&OnReceive));
}