ua_client_internal.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. LIST_ENTRY(UA_Client_NotificationsAckNumber_s) listEntry;
  11. UA_SubscriptionAcknowledgement subAck;
  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 authenticationToken;
  59. UA_UInt32 requestHandle;
  60. #ifdef UA_ENABLE_SUBSCRIPTIONS
  61. UA_UInt32 monitoredItemHandles;
  62. LIST_HEAD(UA_ListOfUnacknowledgedNotificationNumbers, UA_Client_NotificationsAckNumber_s) pendingNotificationsAcks;
  63. LIST_HEAD(UA_ListOfClientSubscriptionItems, UA_Client_Subscription_s) subscriptions;
  64. #endif
  65. /* Config */
  66. UA_ClientConfig config;
  67. UA_DateTime scRenewAt;
  68. };
  69. #endif /* UA_CLIENT_INTERNAL_H_ */