ua_client_internal.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef UA_CLIENT_INTERNAL_H_
  2. #define UA_CLIENT_INTERNAL_H_
  3. #include "ua_securechannel.h"
  4. #include "queue.h"
  5. /**************************/
  6. /* Subscriptions Handling */
  7. /**************************/
  8. #ifdef ENABLE_SUBSCRIPTIONS
  9. typedef struct UA_Client_NotificationsAckNumber_s {
  10. UA_SubscriptionAcknowledgement subAck;
  11. LIST_ENTRY(UA_Client_NotificationsAckNumber_s) listEntry;
  12. } UA_Client_NotificationsAckNumber;
  13. typedef struct UA_Client_MonitoredItem_s {
  14. UA_UInt32 MonitoredItemId;
  15. UA_UInt32 MonitoringMode;
  16. UA_NodeId monitoredNodeId;
  17. UA_UInt32 AttributeID;
  18. UA_UInt32 ClientHandle;
  19. UA_UInt32 SamplingInterval;
  20. UA_UInt32 QueueSize;
  21. UA_Boolean DiscardOldest;
  22. void (*handler)(UA_UInt32 handle, UA_DataValue *value);
  23. LIST_ENTRY(UA_Client_MonitoredItem_s) listEntry;
  24. } UA_Client_MonitoredItem;
  25. typedef struct UA_Client_Subscription_s {
  26. UA_UInt32 LifeTime;
  27. UA_Int32 KeepAliveCount;
  28. UA_DateTime PublishingInterval;
  29. UA_UInt32 SubscriptionID;
  30. UA_Int32 NotificationsPerPublish;
  31. UA_UInt32 Priority;
  32. LIST_ENTRY(UA_Client_Subscription_s) listEntry;
  33. LIST_HEAD(UA_ListOfClientMonitoredItems, UA_Client_MonitoredItem_s) MonitoredItems;
  34. } UA_Client_Subscription;
  35. #endif
  36. /**********/
  37. /* Client */
  38. /**********/
  39. typedef enum {
  40. UA_CLIENTSTATE_READY,
  41. UA_CLIENTSTATE_CONNECTED,
  42. UA_CLIENTSTATE_ERRORED
  43. } UA_Client_State;
  44. struct UA_Client {
  45. /* State */ //maybe it should be visible to user
  46. UA_Client_State state;
  47. /* Connection */
  48. UA_Connection connection;
  49. UA_SecureChannel channel;
  50. UA_String endpointUrl;
  51. UA_UInt32 requestId;
  52. /* Session */
  53. UA_UserTokenPolicy token;
  54. UA_NodeId sessionId;
  55. UA_NodeId authenticationToken;
  56. UA_UInt32 requestHandle;
  57. #ifdef ENABLE_SUBSCRIPTIONS
  58. UA_Int32 monitoredItemHandles;
  59. LIST_HEAD(UA_ListOfUnacknowledgedNotificationNumbers, UA_Client_NotificationsAckNumber_s) pendingNotificationsAcks;
  60. LIST_HEAD(UA_ListOfClientSubscriptionItems, UA_Client_Subscription_s) subscriptions;
  61. #endif
  62. /* Config */
  63. UA_Logger logger;
  64. UA_ClientConfig config;
  65. UA_DateTime scExpiresAt;
  66. };
  67. #endif /* UA_CLIENT_INTERNAL_H_ */