Bug 1010

Summary: Patch to the uan model
Product: ns-3 Reporter: Salva Climent <jocliba>
Component: devicesAssignee: Andrea Sacco <andrea.sacco85>
Status: RESOLVED FIXED    
Severity: enhancement CC: ns-bugs, tomh
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Code with the mods

Description Salva Climent 2010-10-18 13:42:41 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.
Comment 1 Leonard Tracy 2010-10-22 12:03:43 EDT
This patch looks good.  Can this be checked in with Andrea's code?
Comment 2 Salva Climent 2010-10-22 12:39:10 EDT
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?
Comment 3 Tom Henderson 2011-08-09 14:42:40 EDT
commit now?
Comment 4 Andrea Sacco 2011-08-16 14:29:37 EDT
I've take a look at the patch and it seems ok. Tests work. Committed.