Bugzilla – Bug 1010
Patch to the uan model
Last modified: 2011-08-16 14:29:37 EDT
Created attachment 1002 [details] Code with the mods Hello, I'm using the UAN model to implement some underwater routing protocol. The protocol needs to have some way to tell the phy layer to go to sleep and wake up. I've merged the last code from the andrea's repository with the development version and implemented what I need: - Added a method to the phy layer to force the sleep state. It's defined on the UanPhy class as a virtual method and only implemented on the UanPhyGen. The UanPhyDual has an empty function just to make it compile. - Added a method to the UanNetDevice to force the sleep state from the above layers. - On UanPhyGen:.SendPacket and UanPhyGen:StartRxPacket, drop the packet if the state is SLEEP - On UanPhyGen:RxEndEvent drop the paquet if it's on Sleep or without energy - On UanPhyGen::TxEndEvent it takes into account the Sleep and dead states With this implementation if a node dies or goes to sleep in the middle of a tx, it will send the packet anyway. I'm attaching the patch with the modifications.
This patch looks good. Can this be checked in with Andrea's code?
I think so, I'm already using it with the Andrea's code and it seams to work OK. (In reply to comment #1) > This patch looks good. Can this be checked in with Andrea's code?
commit now?
I've take a look at the patch and it seems ok. Tests work. Committed.