ua_client.h 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #ifndef UA_CLIENT_H_
  2. #define UA_CLIENT_H_
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "ua_config.h"
  7. #include "ua_types.h"
  8. #include "ua_connection.h"
  9. #include "ua_log.h"
  10. #include "ua_types_generated.h"
  11. struct UA_Client;
  12. typedef struct UA_Client UA_Client;
  13. /**
  14. * The client networklayer is defined by a single function that fills a UA_Connection struct after
  15. * successfully connecting.
  16. */
  17. typedef UA_Connection (*UA_ConnectClientConnection)(UA_ConnectionConfig localConf, char *endpointUrl,
  18. UA_Logger *logger);
  19. typedef struct UA_ClientConfig {
  20. UA_Int32 timeout; //sync response timeout
  21. UA_Int32 secureChannelLifeTime; // lifetime in ms (then the channel needs to be renewed)
  22. UA_Int32 timeToRenewSecureChannel; //time in ms before expiration to renew the secure channel
  23. UA_ConnectionConfig localConnectionConfig;
  24. } UA_ClientConfig;
  25. extern UA_EXPORT const UA_ClientConfig UA_ClientConfig_standard;
  26. UA_Client UA_EXPORT * UA_Client_new(UA_ClientConfig config, UA_Logger logger);
  27. UA_EXPORT void UA_Client_delete(UA_Client* client);
  28. UA_StatusCode UA_EXPORT UA_Client_connect(UA_Client *client, UA_ConnectClientConnection connFunc, char *endpointUrl);
  29. UA_StatusCode UA_EXPORT UA_Client_disconnect(UA_Client *client);
  30. UA_StatusCode UA_EXPORT UA_Client_renewSecureChannel(UA_Client *client);
  31. /* Attribute Service Set */
  32. UA_ReadResponse UA_EXPORT UA_Client_read(UA_Client *client, UA_ReadRequest *request);
  33. UA_WriteResponse UA_EXPORT UA_Client_write(UA_Client *client, UA_WriteRequest *request);
  34. /* View Service Set */
  35. UA_BrowseResponse UA_EXPORT UA_Client_browse(UA_Client *client, UA_BrowseRequest *request);
  36. UA_BrowseNextResponse UA_EXPORT UA_Client_browseNext(UA_Client *client, UA_BrowseNextRequest *request);
  37. UA_TranslateBrowsePathsToNodeIdsResponse UA_EXPORT
  38. UA_Client_translateTranslateBrowsePathsToNodeIds(UA_Client *client,
  39. UA_TranslateBrowsePathsToNodeIdsRequest *request);
  40. /* NodeManagement Service Set */
  41. UA_AddNodesResponse UA_EXPORT UA_Client_addNodes(UA_Client *client, UA_AddNodesRequest *request);
  42. UA_AddReferencesResponse UA_EXPORT
  43. UA_Client_addReferences(UA_Client *client, UA_AddReferencesRequest *request);
  44. UA_DeleteNodesResponse UA_EXPORT UA_Client_deleteNodes(UA_Client *client, UA_DeleteNodesRequest *request);
  45. UA_DeleteReferencesResponse UA_EXPORT
  46. UA_Client_deleteReferences(UA_Client *client, UA_DeleteReferencesRequest *request);
  47. /* Client-Side Macro/Procy functions */
  48. UA_AddNodesResponse UA_EXPORT *UA_Client_createObjectNode( UA_Client *client, UA_ExpandedNodeId reqId, UA_QualifiedName browseName, UA_LocalizedText displayName,
  49. UA_LocalizedText description, UA_ExpandedNodeId parentNodeId, UA_NodeId referenceTypeId,
  50. UA_UInt32 userWriteMask, UA_UInt32 writeMask, UA_ExpandedNodeId typeDefinition);
  51. UA_AddNodesResponse UA_EXPORT *UA_Client_createVariableNode(UA_Client *client, UA_ExpandedNodeId reqId, UA_QualifiedName browseName, UA_LocalizedText displayName,
  52. UA_LocalizedText description, UA_ExpandedNodeId parentNodeId, UA_NodeId referenceTypeId,
  53. UA_UInt32 userWriteMask, UA_UInt32 writeMask, UA_ExpandedNodeId typeDefinition,
  54. UA_NodeId dataType, UA_Variant *value );
  55. UA_AddNodesResponse UA_EXPORT *UA_Client_createReferenceTypeNode(UA_Client *client, UA_ExpandedNodeId reqId, UA_QualifiedName browseName, UA_LocalizedText displayName,
  56. UA_LocalizedText description, UA_ExpandedNodeId parentNodeId, UA_NodeId referenceTypeId,
  57. UA_UInt32 userWriteMask, UA_UInt32 writeMask, UA_ExpandedNodeId typeDefinition,
  58. UA_LocalizedText inverseName );
  59. UA_AddNodesResponse UA_EXPORT *UA_Client_createObjectTypeNode(UA_Client *client, UA_ExpandedNodeId reqId, UA_QualifiedName browseName, UA_LocalizedText displayName,
  60. UA_LocalizedText description, UA_ExpandedNodeId parentNodeId, UA_NodeId referenceTypeId,
  61. UA_UInt32 userWriteMask, UA_UInt32 writeMask, UA_ExpandedNodeId typeDefinition);
  62. #ifdef __cplusplus
  63. } // extern "C"
  64. #endif
  65. #endif /* UA_CLIENT_H_ */