Commit dfda86b6 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 632ad024
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
* autopilotIp: IPv4 address to identify the autopilot from the companion board * autopilotIp: IPv4 address to identify the autopilot from the companion board
* droneGuidList: List of computer id on which flight script must be deployed * droneGuidList: List of computer id on which flight script must be deployed
* droneNetIf: Drone network interface used for multicast traffic
* isASimulation: Must be set to 'true' to automatically take off during simulation * isASimulation: Must be set to 'true' to automatically take off during simulation
* multicastIp: IPv6 of the multicast group of the swarm * multicastIp: IPv6 of the multicast group of the swarm
* netIf: Network interface used for multicast traffic
* flightScript: URL of user's script to execute to fly drone swarm * flightScript: URL of user's script to execute to fly drone swarm
* subscriberGuidList: List of computer id on which a GUI must be deployed * subscriberGuidList: List of computer id on which a GUI must be deployed
* subscriberNetIf: Subscriber network interface used for multicast traffic
## How it works ## ## How it works ##
......
...@@ -18,11 +18,11 @@ md5sum = 94479f7e7299650fc41878fab06e6555 ...@@ -18,11 +18,11 @@ md5sum = 94479f7e7299650fc41878fab06e6555
[instance-profile] [instance-profile]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 80dae3e883663311d9814def78ee875a md5sum = e0ea95530bf84edfc37eea994cc9ee86
[instance-default] [instance-default]
filename = instance-default.cfg.jinja2 filename = instance-default.cfg.jinja2
md5sum = 9db922cc0fcaa67006a2d6b9b95b95fe md5sum = 5c8ebd1f9ca3024d083b0652868e2f71
[instance-peer] [instance-peer]
filename = instance-peer.cfg.jinja2.in filename = instance-peer.cfg.jinja2.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/v2.0/subscribe.js config-flightScript = https://lab.nexedi.com/nexedi/flight-scripts/-/raw/v2.0/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/v2.0/default.js", "flightScript": "https://lab.nexedi.com/nexedi/flight-scripts/-/raw/v2.0/default.js",
"isASimulation": false, "isASimulation": false,
"multicastIp": "ff15::1111", "multicastIp": "ff15::1111",
"netIf": "eth0",
"droneGuidList": [], "droneGuidList": [],
"subscriberGuidList":[] "subscriberGuidList":[],
"subscriberNetIf": "eth0"
} }
[instance-default] [instance-default]
......
...@@ -119,8 +119,8 @@ class SubscriberTestCase(SlapOSInstanceTestCase): ...@@ -119,8 +119,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