pyviz: better detect when the wifi infrastructure link is down.
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Mon, 27 Oct 2008 15:16:54 +0000
changeset 3891 9b0736c2b801
parent 3890 1ab88c860257
child 3892 dcdda2bc5b81
pyviz: better detect when the wifi infrastructure link is down.
src/contrib/visualizer/plugins/wifi_intrastructure_link.py
--- a/src/contrib/visualizer/plugins/wifi_intrastructure_link.py	Mon Oct 20 17:30:42 2008 +0100
+++ b/src/contrib/visualizer/plugins/wifi_intrastructure_link.py	Mon Oct 27 15:16:54 2008 +0000
@@ -89,6 +89,9 @@
 
     def simulation_periodic_update(self, viz):
         for (sta_netdevice, viz_node, wifi_link) in self.stations:
+            if not sta_netdevice.IsLinkUp():
+                wifi_link.set_ap(None)
+                continue
             bssid = str(sta_netdevice.GetMac().GetBssid())
             if bssid == '00:00:00:00:00:00':
                 wifi_link.set_ap(None)