ua_client_internal.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 UA_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_Double SamplingInterval;
  20. UA_UInt32 QueueSize;
  21. UA_Boolean DiscardOldest;
  22. void (*handler)(UA_UInt32 monId, 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_UInt32 KeepAliveCount;
  29. UA_Double PublishingInterval;
  30. UA_UInt32 SubscriptionID;
  31. UA_UInt32 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_CLIENTAUTHENTICATION_NONE,
  42. UA_CLIENTAUTHENTICATION_USERNAME
  43. } UA_Client_Authentication;
  44. struct UA_Client {
  45. /* State */
  46. UA_ClientState state;
  47. /* Connection */
  48. UA_Connection connection;
  49. UA_SecureChannel channel;
  50. UA_String endpointUrl;
  51. UA_UInt32 requestId;
  52. /* Authentication */
  53. UA_Client_Authentication authenticationMethod;
  54. UA_String username;
  55. UA_String password;
  56. /* Session */
  57. UA_UserTokenPolicy token;
  58. UA_NodeId sessionId;
  59. UA_NodeId authenticationToken;
  60. UA_UInt32 requestHandle;
  61. #ifdef UA_ENABLE_SUBSCRIPTIONS
  62. UA_UInt32 monitoredItemHandles;
  63. LIST_HEAD(UA_ListOfUnacknowledgedNotificationNumbers, UA_Client_NotificationsAckNumber_s) pendingNotificationsAcks;
  64. LIST_HEAD(UA_ListOfClientSubscriptionItems, UA_Client_Subscription_s) subscriptions;
  65. #endif
  66. /* Config */
  67. UA_ClientConfig config;
  68. UA_DateTime scRenewAt;
  69. };
  70. #endif /* UA_CLIENT_INTERNAL_H_ */