Bug 2475 - SpectrumAnalyzer does not cancel event when stopped
SpectrumAnalyzer does not cancel event when stopped
Status: NEW
Product: ns-3
Classification: Unclassified
Component: spectrum
ns-3-dev
All All
: P5 minor
Assigned To: Nicola Baldo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-08-14 11:43 EDT by Alexander Krotov
Modified: 2016-08-14 11:52 EDT (History)
1 user (show)

See Also:


Attachments
Test scenario (put it in scratch) (1.31 KB, text/x-c++src)
2016-08-14 11:43 EDT, Alexander Krotov
Details
Proposed patch (2.62 KB, patch)
2016-08-14 11:50 EDT, Alexander Krotov
Details | Diff
Proposed patch (2.57 KB, patch)
2016-08-14 11:52 EDT, Alexander Krotov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Krotov 2016-08-14 11:43:21 EDT
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 EDT
Created attachment 2539 [details]
Proposed patch
Comment 2 Alexander Krotov 2016-08-14 11:52:17 EDT
Created attachment 2540 [details]
Proposed patch

Removed unnecessary IsRunning check before event cancel