Commit 7dfe7c81 authored by Christian Bergmiller's avatar Christian Bergmiller

make add_method_callback sync

parent 8357920a
......@@ -371,7 +371,7 @@ async def _create_method(parent, nodeid, qname, callback, inputs, outputs):
datatype=ua.ObjectIds.Argument
)
if hasattr(parent.server, "add_method_callback"):
await parent.server.add_method_callback(method.nodeid, callback)
parent.server.add_method_callback(method.nodeid, callback)
return results[0].AddedNodeId
......
......@@ -111,7 +111,7 @@ class InternalSession:
async def delete_references(self, params):
return self.iserver.node_mgt_service.delete_references(params, self.user)
async def add_method_callback(self, methodid, callback):
def add_method_callback(self, methodid, callback):
return self.aspace.add_method_callback(methodid, callback)
def call(self, params):
......
......@@ -555,14 +555,14 @@ class Server:
def unsubscribe_server_callback(self, event, handle):
self.iserver.unsubscribe_server_callback(event, handle)
async def link_method(self, node, callback):
def link_method(self, node, callback):
"""
Link a python function to a UA method in the address space; required when a UA method has been imported
to the address space via XML; the python executable must be linked manually
:param node: UA method node
:param callback: python function that the UA method will call
"""
await self.iserver.isession.add_method_callback(node.nodeid, callback)
self.iserver.isession.add_method_callback(node.nodeid, callback)
def load_type_definitions(self, nodes=None) -> Coroutine:
"""
......
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