Comment 2 for bug 404118

Revision history for this message
Sebastian Max (smx-comnets) wrote :

Dear Jan,

Yes, you are definitely right :-)

But, I would propose a different solution than Daniel:
The current wns::Subject<CarrierSensing> does not follow the general service/handler architecture in the openWNS - in general, this architecture is similar to a subject/observer(s) pattern that allows one observer only. I would propose to change the current wns::Subject<CarrierSensing> to this architecture, which allows to write an own registerRSSHandler() function in Station.hpp; this function then adds the station to the observers of the receiver - on demand, so to say.

Changes in libwns:
src/service/phy/ofdma/Notification.hpp: Notification is not longer derived from wns::Subject<CarrierSensing>, add virtual function registerRSSHandler
src/service/phy/ofdma/Handler.hpp: Add class RSSHandler with virtual function onRSSChange

Changes in OFDMAPhy:
src/Station.hpp: Add function registerRSSHandler & variable rssHandler
src/Station.cpp:
* Remove startObserving(receiver), save rssHandler when registerRSSHandler is called and startObserving!
* onNewRSS calls rssHandler->onRSSChange instead of forEachObserver

In my WiFiMAC, the appropriate FU will register itself as the RSSHandler. If no FU registers itself, station does not call startObserving and the RSS value is not calculated. No additional (python) configuration is required.

I am currently testing this changes and will commit them soon for review.