ua_client.h 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. #include "ua_util.h"
  2. #include "ua_types.h"
  3. #include "ua_connection.h"
  4. #include "ua_types_generated.h"
  5. /**
  6. * The client networklayer can handle only a single connection. The networklayer
  7. * is only concerned with getting messages to the client and receiving them.
  8. */
  9. typedef struct {
  10. UA_StatusCode (*connect)(const UA_String endpointUrl, void **resultHandle);
  11. void (*disconnect)(void *handle);
  12. UA_StatusCode (*send)(void *handle, UA_ByteStringArray gather_buf);
  13. // the response buffer exists on the heap. the size shall correspond the the connection settings
  14. UA_StatusCode (*awaitResponse)(void *handle, UA_ByteString *response, UA_UInt32 timeout);
  15. } UA_ClientNetworkLayer;
  16. struct UA_Client;
  17. typedef struct UA_Client UA_Client;
  18. UA_Client UA_EXPORT * UA_Client_new(void);
  19. void UA_Client_delete(UA_Client* client);
  20. UA_StatusCode UA_EXPORT UA_Client_connect(UA_Client *c, UA_ConnectionConfig conf,
  21. UA_ClientNetworkLayer networkLayer, char *endpointUrl);
  22. UA_StatusCode UA_EXPORT UA_Client_disconnect(UA_Client *c);
  23. UA_ReadResponse UA_EXPORT UA_Client_read(UA_Client *c, const UA_ReadRequest *request);
  24. UA_WriteResponse UA_EXPORT UA_Client_write(UA_Client *c, const UA_WriteRequest *request);
  25. UA_BrowseResponse UA_EXPORT UA_Client_browse(UA_Client *c, const UA_BrowseRequest *request);