diff --git a/daemon/core/emane/emanemodel.py b/daemon/core/emane/emanemodel.py index 92346676..21fcccb3 100644 --- a/daemon/core/emane/emanemodel.py +++ b/daemon/core/emane/emanemodel.py @@ -27,6 +27,7 @@ class EmaneModel(WirelessModel): """ # default platform configuration settings + platform_controlport: str = "controlportendpoint" platform_xml: str = "nemmanager.xml" platform_defaults: Dict[str, str] = { "eventservicedevice": DEFAULT_DEV, @@ -88,6 +89,14 @@ class EmaneModel(WirelessModel): cls.platform_config = emanemanifest.parse( platform_xml_path, cls.platform_defaults ) + # remove controlport configuration, since core will set this directly + controlport_index = None + for index, configuration in enumerate(cls.platform_config): + if configuration.id == cls.platform_controlport: + controlport_index = index + break + if controlport_index is not None: + cls.platform_config.pop(controlport_index) @classmethod def configurations(cls) -> List[Configuration]: diff --git a/daemon/core/xml/emanexml.py b/daemon/core/xml/emanexml.py index f8489b5b..c45259f7 100644 --- a/daemon/core/xml/emanexml.py +++ b/daemon/core/xml/emanexml.py @@ -165,9 +165,10 @@ def build_platform_xml( for configuration in emane_net.model.platform_config: name = configuration.id value = config[configuration.id] - if name == "controlportendpoint": - value = f"0.0.0.0:{nem_port}" add_param(platform_element, name, value) + add_param( + platform_element, emane_net.model.platform_controlport, f"0.0.0.0:{nem_port}" + ) # build nem xml nem_definition = nem_file_name(iface)