ua_client.h 1.5 KB

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