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 {
  10. LIST_ENTRY(UA_Client_NotificationsAckNumber) listEntry;
  11. UA_SubscriptionAcknowledgement subAck;
  12. } UA_Client_NotificationsAckNumber;
  13. typedef struct UA_Client_MonitoredItem {
  14. LIST_ENTRY(UA_Client_MonitoredItem) 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 {
  27. LIST_ENTRY(UA_Client_Subscription) 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) 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. UA_ClientConfig config;
  49. /* Connection */
  50. UA_Connection *connection;
  51. UA_String endpointUrl;
  52. /* SecureChannel */
  53. UA_SecureChannel *channel;
  54. UA_UInt32 requestId;
  55. UA_DateTime scRenewAt;
  56. /* Authentication */
  57. UA_Client_Authentication authenticationMethod;
  58. UA_String username;
  59. UA_String password;
  60. /* Session */
  61. UA_UserTokenPolicy token;
  62. UA_NodeId authenticationToken;
  63. UA_UInt32 requestHandle;
  64. /* Subscriptions */
  65. #ifdef UA_ENABLE_SUBSCRIPTIONS
  66. UA_UInt32 monitoredItemHandles;
  67. LIST_HEAD(ListOfUnacknowledgedNotifications, UA_Client_NotificationsAckNumber) pendingNotificationsAcks;
  68. LIST_HEAD(ListOfClientSubscriptionItems, UA_Client_Subscription) subscriptions;
  69. #endif
  70. };
  71. #endif /* UA_CLIENT_INTERNAL_H_ */