Imagine a use case where all methods share a generic method callback. This callback may translate OPC UA method calls to some equivalent feature of a sub-system in the application. We have such a use case and we need to know the OPC UA data type of the output arguments to set the correct data type in the output argument variants (in our case the sub-system's data types maps 1:N to OPC UA types).
But to avoid copying internal code to a callback implementation we would like to see the method callback provide this information. Our proposal is to update the method callback definition by adding a new argument UA_Argument *outputArgs which should provide the value of the OutputArguments node.
I'm not sure if understood your problem correctly, but the input and output argument types are already encoded in the variants that are supplied during the callback.
Description
Imagine a use case where all methods share a generic method callback. This callback may translate OPC UA method calls to some equivalent feature of a sub-system in the application. We have such a use case and we need to know the OPC UA data type of the output arguments to set the correct data type in the output argument variants (in our case the sub-system's data types maps 1:N to OPC UA types).
We can solve this with the current open62541 implementation and find the OutputArguments node of the Method node by duplicating the implementation of
getArgumentsVariableNode()
in ua_services_method.c. https://github.com/open62541/open62541/blob/223d3d5d55e6bbc771f9e0d6bfe2af0facc6f395/src/server/ua_services_method.c#L22But to avoid copying internal code to a callback implementation we would like to see the method callback provide this information. Our proposal is to update the method callback definition by adding a new argument
UA_Argument *outputArgs
which should provide the value of the OutputArguments node.We can provide a PR once we agreed to a solution.
Background Information / Reproduction Steps
N/A
Checklist
Please provide the following information:
UA_LOGLEVEL
set as low as necessary) attached