|
@@ -25,6 +25,7 @@ extern "C" {
|
|
|
#include "ua_types_generated_handling.h"
|
|
|
#include "ua_plugin_network.h"
|
|
|
#include "ua_plugin_log.h"
|
|
|
+#include "ua_client_config.h"
|
|
|
|
|
|
/**
|
|
|
* .. _client:
|
|
@@ -43,64 +44,12 @@ extern "C" {
|
|
|
* `UA_Client_Subscriptions_manuallySendPublishRequest`. See also :ref:`here
|
|
|
* <client-subscriptions>`.
|
|
|
*
|
|
|
+ *
|
|
|
+ * .. include:: client_config.rst
|
|
|
+ *
|
|
|
* Client Lifecycle
|
|
|
* ---------------- */
|
|
|
|
|
|
-typedef enum {
|
|
|
- UA_CLIENTSTATE_DISCONNECTED, /* The client is disconnected */
|
|
|
- UA_CLIENTSTATE_CONNECTED, /* A TCP connection to the server is open */
|
|
|
- UA_CLIENTSTATE_SECURECHANNEL, /* A SecureChannel to the server is open */
|
|
|
- UA_CLIENTSTATE_SESSION, /* A session with the server is open */
|
|
|
- UA_CLIENTSTATE_SESSION_RENEWED /* A session with the server is open (renewed) */
|
|
|
-} UA_ClientState;
|
|
|
-
|
|
|
-struct UA_Client;
|
|
|
-typedef struct UA_Client UA_Client;
|
|
|
-
|
|
|
-/**
|
|
|
- * Client Lifecycle callback
|
|
|
- * ------------------------- */
|
|
|
-
|
|
|
-typedef void (*UA_ClientStateCallback)(UA_Client *client, UA_ClientState clientState);
|
|
|
-
|
|
|
-/**
|
|
|
- * Subscription Inactivity callback
|
|
|
- * ------------------------- */
|
|
|
-
|
|
|
-#ifdef UA_ENABLE_SUBSCRIPTIONS
|
|
|
-typedef void (*UA_SubscriptionInactivityCallback)(UA_Client *client, UA_UInt32 subscriptionId, void *subContext);
|
|
|
-#endif
|
|
|
-
|
|
|
-/**
|
|
|
- * Client Configuration
|
|
|
- * -------------------- */
|
|
|
-
|
|
|
-typedef struct UA_ClientConfig {
|
|
|
- UA_UInt32 timeout; /* Sync response timeout in ms */
|
|
|
- UA_UInt32 secureChannelLifeTime; /* Lifetime in ms (then the channel needs
|
|
|
- to be renewed) */
|
|
|
- UA_Logger logger;
|
|
|
- UA_ConnectionConfig localConnectionConfig;
|
|
|
- UA_ConnectClientConnection connectionFunc;
|
|
|
-
|
|
|
- /* Custom DataTypes */
|
|
|
- size_t customDataTypesSize;
|
|
|
- const UA_DataType *customDataTypes;
|
|
|
-
|
|
|
- /* Callback function */
|
|
|
- UA_ClientStateCallback stateCallback;
|
|
|
-#ifdef UA_ENABLE_SUBSCRIPTIONS
|
|
|
- UA_SubscriptionInactivityCallback subscriptionInactivityCallback;
|
|
|
-#endif
|
|
|
-
|
|
|
- void *clientContext;
|
|
|
-
|
|
|
- /* number of PublishResponse standing in the sever */
|
|
|
- /* 0 = background task disabled */
|
|
|
- UA_UInt16 outStandingPublishRequests;
|
|
|
-} UA_ClientConfig;
|
|
|
-
|
|
|
-
|
|
|
/* Create a new client */
|
|
|
UA_Client UA_EXPORT *
|
|
|
UA_Client_new(UA_ClientConfig config);
|
|
@@ -230,6 +179,7 @@ UA_Client_findServersOnNetwork(UA_Client *client, const char *serverUrl,
|
|
|
*
|
|
|
* Services
|
|
|
* --------
|
|
|
+ *
|
|
|
* The raw OPC UA services are exposed to the client. But most of them time, it
|
|
|
* is better to use the convenience functions from ``ua_client_highlevel.h``
|
|
|
* that wrap the raw services. */
|
|
@@ -239,7 +189,7 @@ __UA_Client_Service(UA_Client *client, const void *request,
|
|
|
const UA_DataType *requestType, void *response,
|
|
|
const UA_DataType *responseType);
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* Attribute Service Set
|
|
|
* ^^^^^^^^^^^^^^^^^^^^^ */
|
|
|
static UA_INLINE UA_ReadResponse
|
|
@@ -258,7 +208,7 @@ UA_Client_Service_write(UA_Client *client, const UA_WriteRequest request) {
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* Method Service Set
|
|
|
* ^^^^^^^^^^^^^^^^^^ */
|
|
|
#ifdef UA_ENABLE_METHODCALLS
|
|
@@ -271,7 +221,7 @@ UA_Client_Service_call(UA_Client *client, const UA_CallRequest request) {
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* NodeManagement Service Set
|
|
|
* ^^^^^^^^^^^^^^^^^^^^^^^^^^ */
|
|
|
static UA_INLINE UA_AddNodesResponse
|
|
@@ -309,7 +259,7 @@ UA_Client_Service_deleteReferences(UA_Client *client,
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* View Service Set
|
|
|
* ^^^^^^^^^^^^^^^^ */
|
|
|
static UA_INLINE UA_BrowseResponse
|
|
@@ -359,7 +309,7 @@ UA_Client_Service_unregisterNodes(UA_Client *client,
|
|
|
return response;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* Query Service Set
|
|
|
* ^^^^^^^^^^^^^^^^^ */
|
|
|
static UA_INLINE UA_QueryFirstResponse
|