ua_server_external_ns.h 4.0 KB

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