got tdma working, leveraging an example tdma schedule that will be included with packaging
This commit is contained in:
parent
162cb20e14
commit
1f2c78d54a
4 changed files with 24 additions and 6 deletions
|
@ -341,10 +341,11 @@ class EmaneManager(ConfigurableManager):
|
|||
with self._emane_node_lock:
|
||||
for key in sorted(self._emane_nodes.keys()):
|
||||
emane_node = self._emane_nodes[key]
|
||||
logger.debug("post startup for emane node: %s - %s", emane_node.objid, emane_node.name)
|
||||
emane_node.model.post_startup(self)
|
||||
for netif in emane_node.netifs():
|
||||
x, y, z = netif.node.position.get()
|
||||
emane_node.setnemposition(netif, x, y, z)
|
||||
emane_node.model.post_startup(self, netif)
|
||||
|
||||
def reset(self):
|
||||
"""
|
||||
|
|
|
@ -46,12 +46,11 @@ class EmaneModel(WirelessModel):
|
|||
"""
|
||||
return cls.configure(session.emane, config_data)
|
||||
|
||||
def post_startup(self, emane_manager, ifc):
|
||||
def post_startup(self, emane_manager):
|
||||
"""
|
||||
Logic to execute after the emane manager is finished with startup.
|
||||
|
||||
:param core.emane.emanemanager.EmaneManager emane_manager: emane manager for the session
|
||||
:param ifc: an interface for the emane node this model is tied to
|
||||
:return: nothing
|
||||
"""
|
||||
logger.info("%s has no post setup tasks: interface(%s)", ifc)
|
||||
|
|
|
@ -57,16 +57,17 @@ class EmaneTdmaModel(EmaneModel):
|
|||
def __init__(self, session, object_id=None):
|
||||
EmaneModel.__init__(self, session, object_id)
|
||||
|
||||
def post_startup(self, emane_manager, ifc):
|
||||
def post_startup(self, emane_manager):
|
||||
"""
|
||||
Logic to execute after the emane manager is finished with startup.
|
||||
|
||||
:param core.emane.emanemanager.EmaneManager emane_manager: emane manager for the session
|
||||
:param ifc: an interface for the emane node this model is tied to
|
||||
:return: nothing
|
||||
"""
|
||||
# get configured schedule
|
||||
values = emane_manager.getifcconfig(self.object_id, self.name, self.getdefaultvalues(), ifc)
|
||||
values = emane_manager.getconfig(self.object_id, self.name, self.getdefaultvalues())[1]
|
||||
if values is None:
|
||||
return
|
||||
schedule = self.valueof(EmaneTdmaModel.schedule_name, values)
|
||||
|
||||
event_device = emane_manager.event_device
|
||||
|
|
17
daemon/examples/tdma/schedule.xml
Normal file
17
daemon/examples/tdma/schedule.xml
Normal file
|
@ -0,0 +1,17 @@
|
|||
<emane-tdma-schedule >
|
||||
<structure frames="1" slots="10" slotoverhead="0" slotduration="1500" bandwidth="1M"/>
|
||||
<multiframe frequency="2.4G" power="0" class="0" datarate="100M">
|
||||
<frame index="0">
|
||||
<slot index="0" nodes="1"/>
|
||||
<slot index="1" nodes="2"/>
|
||||
<slot index="2" nodes="3"/>
|
||||
<slot index="3" nodes="4"/>
|
||||
<slot index="4" nodes="5"/>
|
||||
<slot index="5" nodes="6"/>
|
||||
<slot index="6" nodes="7"/>
|
||||
<slot index="7" nodes="8"/>
|
||||
<slot index="8" nodes="9"/>
|
||||
<slot index="9" nodes="10"/>
|
||||
</frame>
|
||||
</multiframe>
|
||||
</emane-tdma-schedule>
|
Loading…
Reference in a new issue