ua_transport_connection.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * ua_transport_connection.h
  3. *
  4. * Created on: 10.05.2014
  5. * Author: open62541
  6. */
  7. #ifndef UA_TRANSPORT_CONNECTION_H_
  8. #define UA_TRANSPORT_CONNECTION_H_
  9. #include "ua_transport.h"
  10. typedef struct TL_Buffer{
  11. UA_UInt32 protocolVersion;
  12. UA_UInt32 sendBufferSize;
  13. UA_UInt32 recvBufferSize;
  14. UA_UInt32 maxMessageSize;
  15. UA_UInt32 maxChunkCount;
  16. } TL_Buffer;
  17. struct UA_TL_Connection;
  18. typedef struct UA_TL_Connection UA_TL_Connection;
  19. typedef UA_Int32 (*TL_Closer)(UA_TL_Connection*);
  20. typedef UA_Int32 (*TL_Writer)(UA_Int32 connectionHandle, const UA_ByteString** gather_bufs, UA_Int32 gather_len); // send mutiple buffer concatenated into one msg (zero copy)
  21. UA_Int32 UA_TL_Connection_configByHello(UA_TL_Connection *connection, UA_OPCUATcpHelloMessage *helloMessage);
  22. UA_Int32 UA_TL_Connection_delete(UA_TL_Connection *connection);
  23. UA_Int32 UA_TL_Connection_callWriter(UA_TL_Connection *connection, const UA_ByteString** gather_bufs, UA_Int32 gather_len);
  24. UA_Int32 UA_TL_Connection_close(UA_TL_Connection *connection);
  25. UA_Int32 UA_TL_Connection_new(UA_TL_Connection **connection, TL_Buffer localBuffers,TL_Writer writer, TL_Closer closeCallback,UA_Int32 handle, void* networkLayerData);
  26. UA_Int32 UA_TL_Connection_bind(UA_TL_Connection *connection, UA_Int32 handle);
  27. UA_Boolean UA_TL_Connection_compare(UA_TL_Connection *connection1, UA_TL_Connection *connection2);
  28. //setters
  29. UA_Int32 UA_TL_Connection_setState(UA_TL_Connection *connection, UA_Int32 connectionState);
  30. UA_Int32 UA_TL_Connection_setWriter(UA_TL_Connection *connection, TL_Writer writer);
  31. //UA_Int32 UA_TL_Connection_setConnectionHandle(UA_TL_Connection *connection, UA_Int32 connectionHandle);
  32. //getters
  33. UA_Int32 UA_TL_Connection_getHandle(UA_TL_Connection *connection, UA_UInt32 *connectionId);
  34. UA_Int32 UA_TL_Connection_getProtocolVersion(UA_TL_Connection *connection, UA_UInt32 *protocolVersion);
  35. UA_Int32 UA_TL_Connection_getState(UA_TL_Connection *connection, UA_Int32 *connectionState);
  36. UA_Int32 UA_TL_Connection_getLocalConfig(UA_TL_Connection *connection, TL_Buffer *localConfiguration);
  37. UA_Int32 UA_TL_Connection_getNetworkLayerData(UA_TL_Connection *connection,void** networkLayerData);
  38. #endif /* UA_TRANSPORT_CONNECTION_H_ */