Bug 1282

Summary: Sleep state and CCA
Product: ns-3 Reporter: Salva Climent <jocliba>
Component: uanAssignee: Andrea Sacco <andrea.sacco85>
Status: RESOLVED FIXED    
Severity: normal CC: jocliba, ns-bugs
Priority: P5    
Version: ns-3.12   
Hardware: All   
OS: All   
Attachments: Mods to the UanPhyGen::SetSleepMode method
Test Code

Description Salva Climent 2011-10-18 11:12:19 UTC
Created attachment 1257 [details]
Mods to the UanPhyGen::SetSleepMode method

Hello,

There is a problem with the UanPhyGen::SetSleepMode (bool) method, when called in the middle of a Tx. Suppose the following:

- The Phy layer is in the middle of a Tx.
- For some reason, the upper layer calls SetSleepMode with the bool parameter set to false. This will change the m_state variable from TX to IDLE.
- When the transmission finishes, an error will be thrown at TxEndEvent line 558 since m_state has changed.

I propose checking the m_state variable before changing the state.

Another problem comes with the wakeup procedure. When the phy layer wakes up it starts at the IDLE state. Instead, I think the channel should be listened first and switch to the CCABUSY state if appropriate.

I'm attaching a patch with the modifications.
Comment 1 Andrea Sacco 2011-11-12 06:40:22 UTC
Hi Salva,
can you please give a test code to reproduce the bug?

Thanks,
Andrea
Comment 2 Salva Climent 2012-02-03 07:56:47 UTC
Created attachment 1325 [details]
Test Code
Comment 3 Salva Climent 2012-02-03 07:57:49 UTC
You can find attached the test code.
Comment 4 Andrea Sacco 2012-02-23 11:17:52 UTC
Fixed changeset 7738 fe52cb6371f2

Thanks Salva