Bug 2475

Summary: SpectrumAnalyzer does not cancel event when stopped
Product: ns-3 Reporter: Alexander Krotov <krotov>
Component: spectrumAssignee: Nicola Baldo <nicola>
Status: NEW ---    
Severity: minor CC: ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
Attachments: Test scenario (put it in scratch)
Proposed patch
Proposed patch

Description Alexander Krotov 2016-08-14 11:43:21 UTC
Created attachment 2538 [details]
Test scenario (put it in scratch)

SpectrumAnalyzer does not save EventId of scheduled events. It just sets m_active to false and does not schedule *next* event.

The main problem is that if SpectrumAnalyzer is restarted (stopped and started before scheduled event fires), two SpectrumAnalyzer::GenerateReport are scheduled in parallel and SpectrumAnalyzer generates twice as much output with only half of the points valid (others are just noise power level).

Testcase is attached, bugfix follows.
Comment 1 Alexander Krotov 2016-08-14 11:50:08 UTC
Created attachment 2539 [details]
Proposed patch
Comment 2 Alexander Krotov 2016-08-14 11:52:17 UTC
Created attachment 2540 [details]
Proposed patch

Removed unnecessary IsRunning check before event cancel