Skip to content
Snippets Groups Projects
Commit 2022efac authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-392: Support calling OPC-UA methods.

parent 2ce38476
No related branches found
No related tags found
1 merge request!170L2SS-392: Support calling OPC-UA methods.
......@@ -153,15 +153,18 @@ class OPCUAConnection(AsyncCommClient):
return read_function, write_function
async def call_method(self, method_path, *args):
node = await self.obj.get_child(method_path[:-1])
return await node.call_method(method_path[-1], *args)
async def _call_method(self, method_path, *args):
method_path = self.get_node_path(method_path)
try:
node = await self.obj.get_child(method_path[:-1])
result = await node.call_method(method_path[-1], *args)
except Exception as e:
raise Exception(f"Calling method {method_path} failed") from e
def call_method(self, method_path, *args):
method_path = self.get_node_path(method_path)
raise NotImplementedError
return asyncio.run_coroutine_threadsafe(self._call_method(method_path, *args), self.event_loop).result()
class ProtocolAttribute:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment