ua_client.h 1.2 KB

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