X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Fresources%2Fns3%2Fns3channel.py;h=b218e510d3ae3cfcf51650289fae3c3a6c52a132;hb=6285ca51026efb69642eea9dfc7c480e722d84a9;hp=063e31b3a6609d59c4409c236ef52bb825d4b2a2;hpb=fbc7c758e1464d3af686062505fde706fc92b47c;p=nepi.git diff --git a/src/nepi/resources/ns3/ns3channel.py b/src/nepi/resources/ns3/ns3channel.py index 063e31b3..b218e510 100644 --- a/src/nepi/resources/ns3/ns3channel.py +++ b/src/nepi/resources/ns3/ns3channel.py @@ -3,9 +3,8 @@ # Copyright (C) 2014 INRIA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -24,14 +23,28 @@ from nepi.resources.ns3.ns3base import NS3Base class NS3BaseChannel(NS3Base): _rtype = "abstract::ns3::Channel" + @property + def simulation(self): + return self.devices[0].node.simulation + @property def devices(self): from nepi.resources.ns3.ns3netdevice import NS3BaseNetDevice - return self.get_connected(NS3BaseNetDevice.get_rtype()) + devices = self.get_connected(NS3BaseNetDevice.get_rtype()) + + if not devices: + msg = "Channel not connected to devices" + self.error(msg) + raise RuntimeError(msg) + + return devices @property - def simulator(self): - devices = self.devices - if devices: return device[0].node.simulator - return None - + def _rms_to_wait(self): + rms = set() + rms.add(self.simulation) + return rms + + def _connect_object(self): + pass +