ua_client_internal.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. LIST_ENTRY(UA_Client_MonitoredItem_s) listEntry;
  15. UA_UInt32 MonitoredItemId;
  16. UA_UInt32 MonitoringMode;
  17. UA_NodeId monitoredNodeId;
  18. UA_UInt32 AttributeID;
  19. UA_UInt32 ClientHandle;
  20. UA_Double SamplingInterval;
  21. UA_UInt32 QueueSize;
  22. UA_Boolean DiscardOldest;
  23. void (*handler)(UA_UInt32 monId, UA_DataValue *value, void *context);
  24. void *handlerContext;
  25. } UA_Client_MonitoredItem;
  26. typedef struct UA_Client_Subscription_s {
  27. LIST_ENTRY(UA_Client_Subscription_s) listEntry;
  28. UA_UInt32 LifeTime;
  29. UA_UInt32 KeepAliveCount;
  30. UA_Double PublishingInterval;
  31. UA_UInt32 SubscriptionID;
  32. UA_UInt32 NotificationsPerPublish;
  33. UA_UInt32 Priority;
  34. LIST_HEAD(UA_ListOfClientMonitoredItems, UA_Client_MonitoredItem_s) MonitoredItems;
  35. } UA_Client_Subscription;
  36. void UA_Client_Subscriptions_forceDelete(UA_Client *client, UA_Client_Subscription *sub);
  37. #endif
  38. /**********/
  39. /* Client */
  40. /**********/
  41. typedef enum {
  42. UA_CLIENTAUTHENTICATION_NONE,
  43. UA_CLIENTAUTHENTICATION_USERNAME
  44. } UA_Client_Authentication;
  45. struct UA_Client {
  46. /* State */
  47. UA_ClientState state;
  48. /* Connection */
  49. UA_Connection *connection;
  50. UA_SecureChannel *channel;
  51. UA_String endpointUrl;
  52. UA_UInt32 requestId;
  53. /* Authentication */
  54. UA_Client_Authentication authenticationMethod;
  55. UA_String username;
  56. UA_String password;
  57. /* Session */
  58. UA_UserTokenPolicy token;
  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_ */