ua_server_external_ns.h 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/.*/
  4. #ifndef UA_SERVER_EXTERNAL_NS_H_
  5. #define UA_SERVER_EXTERNAL_NS_H_
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /**
  10. * An external application that manages its own data and data model. To plug in
  11. * outside data sources, one can use
  12. *
  13. * - VariableNodes with a data source (functions that are called for read and write access)
  14. * - An external nodestore that is mapped to specific namespaces
  15. *
  16. * If no external nodestore is defined for a nodeid, it is always looked up in
  17. * the "local" nodestore of open62541. Namespace Zero is always in the local
  18. * nodestore.
  19. */
  20. typedef UA_Int32 (*UA_ExternalNodeStore_addNodes)
  21. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_AddNodesItem *nodesToAdd, UA_UInt32 *indices,
  22. UA_UInt32 indicesSize, UA_AddNodesResult* addNodesResults, UA_DiagnosticInfo *diagnosticInfos);
  23. typedef UA_Int32 (*UA_ExternalNodeStore_addReferences)
  24. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_AddReferencesItem* referencesToAdd,
  25. UA_UInt32 *indices,UA_UInt32 indicesSize, UA_StatusCode *addReferencesResults,
  26. UA_DiagnosticInfo *diagnosticInfos);
  27. typedef UA_StatusCode (*UA_ExternalNodeStore_addOneWayReference)
  28. (void *ensHandle, const UA_AddReferencesItem *item);
  29. typedef UA_StatusCode (*UA_ExternalNodeStore_getOneWayReferences)
  30. (void *ensHandle, UA_NodeId *nodeId, UA_UInt32 *referencesSize, UA_ReferenceNode **references);
  31. typedef UA_StatusCode (*UA_ExternalNodeStore_deleteNodes)
  32. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_DeleteNodesItem *nodesToDelete, UA_UInt32 *indices,
  33. UA_UInt32 indicesSize, UA_StatusCode *deleteNodesResults, UA_DiagnosticInfo *diagnosticInfos);
  34. typedef UA_Int32 (*UA_ExternalNodeStore_deleteReferences)
  35. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_DeleteReferencesItem *referenceToDelete,
  36. UA_UInt32 *indices, UA_UInt32 indicesSize, UA_StatusCode deleteReferencesresults,
  37. UA_DiagnosticInfo *diagnosticInfos);
  38. typedef UA_Int32 (*UA_ExternalNodeStore_readNodes)
  39. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_ReadValueId *readValueIds, UA_UInt32 *indices,
  40. UA_UInt32 indicesSize,UA_DataValue *readNodesResults, UA_Boolean timeStampToReturn,
  41. UA_DiagnosticInfo *diagnosticInfos);
  42. typedef UA_Int32 (*UA_ExternalNodeStore_writeNodes)
  43. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_WriteValue *writeValues, UA_UInt32 *indices,
  44. UA_UInt32 indicesSize, UA_StatusCode *writeNodesResults, UA_DiagnosticInfo *diagnosticInfo);
  45. typedef UA_Int32 (*UA_ExternalNodeStore_browseNodes)
  46. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_BrowseDescription *browseDescriptions,
  47. UA_UInt32 *indices, UA_UInt32 indicesSize, UA_UInt32 requestedMaxReferencesPerNode,
  48. UA_BrowseResult *browseResults, UA_DiagnosticInfo *diagnosticInfos);
  49. typedef UA_Int32 (*UA_ExternalNodeStore_translateBrowsePathsToNodeIds)
  50. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_BrowsePath *browsePath, UA_UInt32 *indices,
  51. UA_UInt32 indicesSize, UA_BrowsePathResult *browsePathResults, UA_DiagnosticInfo *diagnosticInfos);
  52. typedef UA_Int32 (*UA_ExternalNodeStore_call)
  53. (void *ensHandle, const UA_RequestHeader *requestHeader, UA_CallMethodRequest *request, UA_UInt32 *indices,
  54. UA_UInt32 indicesSize,UA_CallMethodResult *results);
  55. typedef UA_Int32 (*UA_ExternalNodeStore_delete)(void *ensHandle);
  56. typedef struct UA_ExternalNodeStore {
  57. void *ensHandle;
  58. UA_ExternalNodeStore_addNodes addNodes;
  59. UA_ExternalNodeStore_deleteNodes deleteNodes;
  60. UA_ExternalNodeStore_writeNodes writeNodes;
  61. UA_ExternalNodeStore_readNodes readNodes;
  62. UA_ExternalNodeStore_browseNodes browseNodes;
  63. UA_ExternalNodeStore_translateBrowsePathsToNodeIds translateBrowsePathsToNodeIds;
  64. UA_ExternalNodeStore_addReferences addReferences;
  65. UA_ExternalNodeStore_deleteReferences deleteReferences;
  66. UA_ExternalNodeStore_call call;
  67. UA_ExternalNodeStore_addOneWayReference addOneWayReference;
  68. UA_ExternalNodeStore_getOneWayReferences getOneWayReferences;
  69. UA_ExternalNodeStore_delete destroy;
  70. } UA_ExternalNodeStore;
  71. UA_StatusCode UA_EXPORT
  72. UA_Server_addExternalNamespace(UA_Server *server, const UA_String *url,
  73. UA_ExternalNodeStore *nodeStore, UA_UInt16 *assignedNamespaceIndex);
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif /* UA_SERVER_EXTERNAL_NS_H_ */