Commit bfa8746e authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

software/js-drone: add subscriber's netif param

Allow subscribers' network interface to be different from the drones' one
parent 3766503c
...@@ -18,11 +18,11 @@ md5sum = ed0356dab0213a99fcd56e8a48e1c4d2 ...@@ -18,11 +18,11 @@ md5sum = ed0356dab0213a99fcd56e8a48e1c4d2
[instance-profile] [instance-profile]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 43e19ec3145928d79803528796eee8e0 md5sum = 578ec4c7194a64b1361de4a41200bced
[instance-default] [instance-default]
filename = instance-default.cfg.jinja filename = instance-default.cfg.jinja
md5sum = 0ed9aac3b3a61c41b8a7b61ab8067c77 md5sum = 90b231a90227c86cf56c0a391a1a328d
[instance-peer] [instance-peer]
filename = instance-peer.cfg.jinja.in filename = instance-peer.cfg.jinja.in
......
...@@ -25,13 +25,14 @@ config-isASimulation = {{ dumps(parameter_dict['isASimulation']) }} ...@@ -25,13 +25,14 @@ config-isASimulation = {{ dumps(parameter_dict['isASimulation']) }}
{% do drone_id_list.append(id) %} {% do drone_id_list.append(id) %}
config-isADrone = {{ dumps(True) }} config-isADrone = {{ dumps(True) }}
config-flightScript = {{ parameter_dict['flightScript'] }} config-flightScript = {{ parameter_dict['flightScript'] }}
config-netIf = {{ parameter_dict['droneNetIf'] }}
{% else -%} {% else -%}
{% do subscriber_id_list.append(id) %} {% do subscriber_id_list.append(id) %}
config-isADrone = {{ dumps(False) }} config-isADrone = {{ dumps(False) }}
config-flightScript = https://lab.nexedi.com/nexedi/flight-scripts/raw/api_update/subscribe.js config-flightScript = https://lab.nexedi.com/nexedi/flight-scripts/raw/api_update/subscribe.js
config-netIf = {{ parameter_dict['subscriberNetIf'] }}
{% endif -%} {% endif -%}
config-multicastIp = {{ parameter_dict['multicastIp'] }} config-multicastIp = {{ parameter_dict['multicastIp'] }}
config-netIf = {{ parameter_dict['netIf'] }}
{% endfor %} {% endfor %}
[publish-connection-information] [publish-connection-information]
......
...@@ -22,6 +22,12 @@ ...@@ -22,6 +22,12 @@
"type": "array", "type": "array",
"default": [] "default": []
}, },
"droneNetIf": {
"title": "Drones Network interface",
"description": "Interface used for multicast traffic.",
"type": "string",
"default": "eth0"
},
"isASimulation": { "isASimulation": {
"title": "Set the flight as a simulation", "title": "Set the flight as a simulation",
"description": "The option used to determine if the flight is real or if it is a simulation. This affects the context of the flight (e.g. if the take off is manual or automatic).", "description": "The option used to determine if the flight is real or if it is a simulation. This affects the context of the flight (e.g. if the take off is manual or automatic).",
...@@ -34,12 +40,6 @@ ...@@ -34,12 +40,6 @@
"type": "string", "type": "string",
"default": "ff15::1111" "default": "ff15::1111"
}, },
"netIf": {
"title": "Network interface",
"description": "Interface used for multicast traffic.",
"type": "string",
"default": "eth0"
},
"flightScript": { "flightScript": {
"title": "Script's URL of the flight", "title": "Script's URL of the flight",
"description": "URL of the script which will be executed for the flight. This URL must be publicly accesible so that the drone can fetch the script.", "description": "URL of the script which will be executed for the flight. This URL must be publicly accesible so that the drone can fetch the script.",
...@@ -51,6 +51,12 @@ ...@@ -51,6 +51,12 @@
"description": "List of computer ID of swarms subscribers", "description": "List of computer ID of swarms subscribers",
"type": "array", "type": "array",
"default": [] "default": []
},
"subscriberNetIf": {
"title": "Subscribers Network interface",
"description": "Interface used for multicast traffic.",
"type": "string",
"default": "eth0"
} }
} }
} }
...@@ -32,12 +32,13 @@ default-parameters = ...@@ -32,12 +32,13 @@ default-parameters =
{ {
"autopilotIp": "192.168.27.1", "autopilotIp": "192.168.27.1",
"autopilotPort": 7909, "autopilotPort": 7909,
"droneNetIf": "eth0",
"flightScript": "https://lab.nexedi.com/nexedi/flight-scripts/raw/master/default.js", "flightScript": "https://lab.nexedi.com/nexedi/flight-scripts/raw/master/default.js",
"isASimulation": false, "isASimulation": false,
"multicastIp": "ff15::1111", "multicastIp": "ff15::1111",
"netIf": "eth0",
"droneGuidList": [], "droneGuidList": [],
"subscriberGuidList":[] "subscriberGuidList":[],
"subscriberNetIf": "eth0"
} }
[instance-default] [instance-default]
......
...@@ -117,8 +117,8 @@ class SubscriberTestCase(SlapOSInstanceTestCase): ...@@ -117,8 +117,8 @@ class SubscriberTestCase(SlapOSInstanceTestCase):
return { return {
'_': json.dumps({ '_': json.dumps({
'droneGuidList': [cls.slap._computer_id], 'droneGuidList': [cls.slap._computer_id],
'netIf': OPC_UA_NET_IF,
'subscriberGuidList': [cls.slap._computer_id], 'subscriberGuidList': [cls.slap._computer_id],
'subscriberNetIf': OPC_UA_NET_IF
}) })
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment