Bug 1010 - Patch to the uan model
Patch to the uan model
Product: ns-3
Classification: Unclassified
Component: devices
All All
: P5 enhancement
Assigned To: Andrea Sacco
Depends on:
  Show dependency treegraph
Reported: 2010-10-18 13:42 EDT by Salva Climent
Modified: 2011-08-16 14:29 EDT (History)
2 users (show)

See Also:

Code with the mods (3.82 KB, patch)
2010-10-18 13:42 EDT, Salva Climent
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Salva Climent 2010-10-18 13:42:41 EDT
Created attachment 1002 [details]
Code with the mods


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
- 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.