ua_client_internal.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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, void *context);
  23. void *handlerContext;
  24. LIST_ENTRY(UA_Client_MonitoredItem_s) listEntry;
  25. } UA_Client_MonitoredItem;
  26. typedef struct UA_Client_Subscription_s {
  27. UA_UInt32 LifeTime;
  28. UA_Int32 KeepAliveCount;
  29. UA_DateTime PublishingInterval;
  30. UA_UInt32 SubscriptionID;
  31. UA_Int32 NotificationsPerPublish;
  32. UA_UInt32 Priority;
  33. LIST_ENTRY(UA_Client_Subscription_s) listEntry;
  34. LIST_HEAD(UA_ListOfClientMonitoredItems, UA_Client_MonitoredItem_s) MonitoredItems;
  35. } UA_Client_Subscription;
  36. #endif
  37. /**********/
  38. /* Client */
  39. /**********/
  40. typedef enum {
  41. UA_CLIENTSTATE_READY,
  42. UA_CLIENTSTATE_CONNECTED,
  43. UA_CLIENTSTATE_ERRORED
  44. } UA_Client_State;
  45. struct UA_Client {
  46. /* State */ //maybe it should be visible to user
  47. UA_Client_State state;
  48. /* Connection */
  49. UA_Connection connection;
  50. UA_SecureChannel channel;
  51. UA_String endpointUrl;
  52. UA_UInt32 requestId;
  53. /* Session */
  54. UA_UserTokenPolicy token;
  55. UA_NodeId sessionId;
  56. UA_NodeId authenticationToken;
  57. UA_UInt32 requestHandle;
  58. #ifdef ENABLE_SUBSCRIPTIONS
  59. UA_Int32 monitoredItemHandles;
  60. LIST_HEAD(UA_ListOfUnacknowledgedNotificationNumbers, UA_Client_NotificationsAckNumber_s) pendingNotificationsAcks;
  61. LIST_HEAD(UA_ListOfClientSubscriptionItems, UA_Client_Subscription_s) subscriptions;
  62. #endif
  63. /* Config */
  64. UA_Logger logger;
  65. UA_ClientConfig config;
  66. UA_DateTime scExpiresAt;
  67. };
  68. #endif /* UA_CLIENT_INTERNAL_H_ */