open62541 1.3.12
Open source implementation of OPC UA
Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
1/** This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 *
5 * Copyright 2015-2020 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
6 * Copyright 2015-2016 (c) Sten GrĂ¼ner
7 * Copyright 2015-2016 (c) Chris Iatrou
8 * Copyright 2015-2017 (c) Florian Palm
9 * Copyright 2015 (c) Holger Jeromin
10 * Copyright 2015 (c) Oleksiy Vasylyev
11 * Copyright 2017 (c) Stefan Profanter, fortiss GmbH
12 * Copyright 2017 (c) Mark Giraud, Fraunhofer IOSB
13 * Copyright 2018 (c) Thomas Stalder, Blue Time Concept SA
14 * Copyright 2018 (c) Kalycito Infotech Private Limited
15 * Copyright 2020 (c) Christian von Arnim, ISW University of Stuttgart
16 */
17
18#ifndef UA_CLIENT_H_
19#define UA_CLIENT_H_
20
21#include <open62541/config.h>
22#include <open62541/nodeids.h>
23#include <open62541/types.h>
26
30
32
33
34
35typedef struct {
36 void *clientContext; /* User-defined pointer attached to the client */
37 UA_Logger logger; /* Logger used by the client */
38 UA_UInt32 timeout; /* Response timeout in ms */
39
40 /* The description must be internally consistent.
41 * - The ApplicationUri set in the ApplicationDescription must match the
42 * URI set in the certificate */
44
45
46 UA_ExtensionObject userIdentityToken; /* Configured User-Identity Token */
47 UA_MessageSecurityMode securityMode; /* None, Sign, SignAndEncrypt. The
48 * default is invalid. This indicates
49 * the client to select any matching
50 * endpoint. */
51 UA_String securityPolicyUri; /* SecurityPolicy for the SecureChannel. An
52 * empty string indicates the client to select
53 * any matching SecurityPolicy. */
54
55
58
59
61
62
64
65
66
67 UA_UInt32 secureChannelLifeTime; /* Lifetime in ms (then the channel needs
68 to be renewed) */
69 UA_UInt32 requestedSessionTimeout; /* Session timeout in ms */
71 UA_UInt32 connectivityCheckInterval; /* Connectivity check interval in ms.
72 * 0 = background task disabled */
73 /* Available SecurityPolicies */
76
77 /* Certificate Verification Plugin */
79
80 /* Callbacks for async connection handshakes */
82 UA_StatusCode (*pollConnectionFunc)(UA_Connection *connection,
83 UA_UInt32 timeout,
84 const UA_Logger *logger);
85
86 /* Callback for state changes. The client state is differentated into the
87 * SecureChannel state and the Session state. The connectStatus is set if
88 * the client connection (including reconnects) has failed and the client
89 * has to "give up". If the connectStatus is not set, the client still has
90 * hope to connect or recover. */
91 void (*stateCallback)(UA_Client *client,
92 UA_SecureChannelState channelState,
93 UA_SessionState sessionState,
94 UA_StatusCode connectStatus);
95
96 /* When connectivityCheckInterval is greater than 0, every
97 * connectivityCheckInterval (in ms), an async read request is performed on
98 * the server. inactivityCallback is called when the client receive no
99 * response for this read request The connection can be closed, this in an
100 * attempt to recreate a healthy connection. */
101 void (*inactivityCallback)(UA_Client *client);
102
103#ifdef UA_ENABLE_SUBSCRIPTIONS
104 /* Number of PublishResponse queued up in the server */
106
107 /* If the client does not receive a PublishResponse after the defined delay
108 * of ``(sub->publishingInterval * sub->maxKeepAliveCount) +
109 * client->config.timeout)``, then subscriptionInactivityCallback is called
110 * for the subscription.. */
111 void (*subscriptionInactivityCallback)(UA_Client *client,
112 UA_UInt32 subscriptionId,
113 void *subContext);
114#endif
115
119
120
121
122/** The method UA_Client_new is defined in client_config_default.h. So default
123 * plugins outside of the core library (for logging, etc) are already available
124 * during the initialization.
125 *
126 * UA_Client * UA_Client_new(void);
127 */
128
129/** Creates a new client. Moves the config into the client with a shallow copy.
130 * The config content is cleared together with the client. */
131UA_Client *
133
134/** Returns the current state. All arguments except ``client`` can be NULL. */
135void
137 UA_SecureChannelState *channelState,
138 UA_SessionState *sessionState,
139 UA_StatusCode *connectStatus);
140
141/** Get the client configuration */
142UA_EXPORT UA_ClientConfig *
144
145/** Get the client context */
146static void *
147UA_Client_getContext(UA_Client *client) {
148 return UA_Client_getConfig(client)->clientContext; /* Cannot fail */
149}
150
151/** (Disconnect and) delete the client */
152void
154
155
156
157/** Connect to the server. First a SecureChannel is opened, then a Session. The
158 * client configuration restricts the SecureChannel selection and contains the
159 * UserIdentityToken for the Session.
160 *
161 * @param client to use
162 * @param endpointURL to connect (for example "opc.tcp://localhost:4840")
163 * @return Indicates whether the operation succeeded or returns an error code */
165UA_Client_connect(UA_Client *client, const char *endpointUrl);
166
167/** Connect async (non-blocking) to the server. After initiating the connection,
168 * call UA_Client_run_iterate repeatedly until the connection is fully
169 * established. You can set a callback to client->config.stateCallback to be
170 * notified when the connection status changes. Or use UA_Client_getState to get
171 * the state manually. */
173UA_Client_connectAsync(UA_Client *client, const char *endpointUrl);
174
175/** Connect to the server without creating a session
176 *
177 * @param client to use
178 * @param endpointURL to connect (for example "opc.tcp://localhost:4840")
179 * @return Indicates whether the operation succeeded or returns an error code */
181UA_Client_connectSecureChannel(UA_Client *client, const char *endpointUrl);
182
183/** Connect async (non-blocking) only the SecureChannel */
185UA_Client_connectSecureChannelAsync(UA_Client *client, const char *endpointUrl);
186
187/** Connect to the server and create+activate a Session with the given username
188 * and password. This first set the UserIdentityToken in the client config and
189 * then calls the regular connect method. */
190static UA_StatusCode
191UA_Client_connectUsername(UA_Client *client, const char *endpointUrl,
192 const char *username, const char *password) {
193 UA_UserNameIdentityToken* identityToken = UA_UserNameIdentityToken_new();
194 if(!identityToken)
196 identityToken->userName = UA_STRING_ALLOC(username);
197 identityToken->password = UA_STRING_ALLOC(password);
199 UA_ExtensionObject_clear(&cc->userIdentityToken);
202 cc->userIdentityToken.content.decoded.data = identityToken;
203 return UA_Client_connect(client, endpointUrl);
204}
205
206/** Disconnect and close a connection to the selected server. Disconnection is
207 * always performed async (without blocking). */
210
211/** Disconnect async. Run UA_Client_run_iterate until the callback notifies that
212 * all connections are closed. */
215
216/** Disconnect the SecureChannel but keep the Session intact (if it exists).
217 * This is always an async (non-blocking) operation. */
220
221
222
223/** Gets a list of endpoints of a server
224 *
225 * @param client to use. Must be connected to the same endpoint given in
226 * serverUrl or otherwise in disconnected state.
227 * @param serverUrl url to connect (for example "opc.tcp://localhost:4840")
228 * @param endpointDescriptionsSize size of the array of endpoint descriptions
229 * @param endpointDescriptions array of endpoint descriptions that is allocated
230 * by the function (you need to free manually)
231 * @return Indicates whether the operation succeeded or returns an error code */
233UA_Client_getEndpoints(UA_Client *client, const char *serverUrl,
234 size_t* endpointDescriptionsSize,
235 UA_EndpointDescription** endpointDescriptions);
236
237/** Gets a list of all registered servers at the given server.
238 *
239 * You can pass an optional filter for serverUris. If the given server is not registered,
240 * an empty array will be returned. If the server is registered, only that application
241 * description will be returned.
242 *
243 * Additionally you can optionally indicate which locale you want for the server name
244 * in the returned application description. The array indicates the order of preference.
245 * A server may have localized names.
246 *
247 * @param client to use. Must be connected to the same endpoint given in
248 * serverUrl or otherwise in disconnected state.
249 * @param serverUrl url to connect (for example "opc.tcp://localhost:4840")
250 * @param serverUrisSize Optional filter for specific server uris
251 * @param serverUris Optional filter for specific server uris
252 * @param localeIdsSize Optional indication which locale you prefer
253 * @param localeIds Optional indication which locale you prefer
254 * @param registeredServersSize size of returned array, i.e., number of found/registered servers
255 * @param registeredServers array containing found/registered servers
256 * @return Indicates whether the operation succeeded or returns an error code */
258UA_Client_findServers(UA_Client *client, const char *serverUrl,
259 size_t serverUrisSize, UA_String *serverUris,
260 size_t localeIdsSize, UA_String *localeIds,
261 size_t *registeredServersSize,
262 UA_ApplicationDescription **registeredServers);
263
264#ifdef UA_ENABLE_DISCOVERY
265/** Get a list of all known server in the network. Only supported by LDS servers.
266 *
267 * @param client to use. Must be connected to the same endpoint given in
268 * serverUrl or otherwise in disconnected state.
269 * @param serverUrl url to connect (for example "opc.tcp://localhost:4840")
270 * @param startingRecordId optional. Only return the records with an ID higher
271 * or equal the given. Can be used for pagination to only get a subset of
272 * the full list
273 * @param maxRecordsToReturn optional. Only return this number of records
274
275 * @param serverCapabilityFilterSize optional. Filter the returned list to only
276 * get servers with given capabilities, e.g. "LDS"
277 * @param serverCapabilityFilter optional. Filter the returned list to only get
278 * servers with given capabilities, e.g. "LDS"
279 * @param serverOnNetworkSize size of returned array, i.e., number of
280 * known/registered servers
281 * @param serverOnNetwork array containing known/registered servers
282 * @return Indicates whether the operation succeeded or returns an error code */
284UA_Client_findServersOnNetwork(UA_Client *client, const char *serverUrl,
285 UA_UInt32 startingRecordId, UA_UInt32 maxRecordsToReturn,
286 size_t serverCapabilityFilterSize, UA_String *serverCapabilityFilter,
287 size_t *serverOnNetworkSize, UA_ServerOnNetwork **serverOnNetwork);
288#endif
289
290
291/** Don't use this function. Use the type versions below instead. */
292void
293__UA_Client_Service(UA_Client *client, const void *request,
294 const UA_DataType *requestType, void *response,
295 const UA_DataType *responseType);
296
297/*
298 * Attribute Service Set
299 * ^^^^^^^^^^^^^^^^^^^^^ */
300static UA_ReadResponse
301UA_Client_Service_read(UA_Client *client, const UA_ReadRequest request) {
302 UA_ReadResponse response;
304 &response, &UA_TYPES[UA_TYPES_READRESPONSE]);
305 return response;
306}
307
308static UA_WriteResponse
309UA_Client_Service_write(UA_Client *client, const UA_WriteRequest request) {
310 UA_WriteResponse response;
312 &response, &UA_TYPES[UA_TYPES_WRITERESPONSE]);
313 return response;
314}
315
316/*
317* Historical Access Service Set
318* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
319#ifdef UA_ENABLE_HISTORIZING
320static UA_HistoryReadResponse
321UA_Client_Service_historyRead(UA_Client *client, const UA_HistoryReadRequest request) {
322 UA_HistoryReadResponse response;
323 __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_HISTORYREADREQUEST],
324 &response, &UA_TYPES[UA_TYPES_HISTORYREADRESPONSE]);
325 return response;
326}
327
328static UA_HistoryUpdateResponse
329UA_Client_Service_historyUpdate(UA_Client *client, const UA_HistoryUpdateRequest request) {
330 UA_HistoryUpdateResponse response;
331 __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_HISTORYUPDATEREQUEST],
332 &response, &UA_TYPES[UA_TYPES_HISTORYUPDATERESPONSE]);
333 return response;
334}
335#endif
336
337/*
338 * Method Service Set
339 * ^^^^^^^^^^^^^^^^^^ */
340#ifdef UA_ENABLE_METHODCALLS
341static UA_CallResponse
342UA_Client_Service_call(UA_Client *client, const UA_CallRequest request) {
343 UA_CallResponse response;
345 &response, &UA_TYPES[UA_TYPES_CALLRESPONSE]);
346 return response;
347}
348#endif
349
350/*
351 * NodeManagement Service Set
352 * ^^^^^^^^^^^^^^^^^^^^^^^^^^ */
354UA_Client_Service_addNodes(UA_Client *client, const UA_AddNodesRequest request) {
355 UA_AddNodesResponse response;
358 return response;
359}
360
362UA_Client_Service_addReferences(UA_Client *client,
363 const UA_AddReferencesRequest request) {
367 return response;
368}
369
371UA_Client_Service_deleteNodes(UA_Client *client,
372 const UA_DeleteNodesRequest request) {
373 UA_DeleteNodesResponse response;
376 return response;
377}
378
380UA_Client_Service_deleteReferences(UA_Client *client,
381 const UA_DeleteReferencesRequest request) {
385 return response;
386}
387
388/*
389 * View Service Set
390 * ^^^^^^^^^^^^^^^^ */
392UA_Client_Service_browse(UA_Client *client, const UA_BrowseRequest request) {
393 UA_BrowseResponse response;
395 &response, &UA_TYPES[UA_TYPES_BROWSERESPONSE]);
396 return response;
397}
398
400UA_Client_Service_browseNext(UA_Client *client,
401 const UA_BrowseNextRequest request) {
402 UA_BrowseNextResponse response;
405 return response;
406}
407
409UA_Client_Service_translateBrowsePathsToNodeIds(UA_Client *client,
412 __UA_Client_Service(client, &request,
414 &response,
416 return response;
417}
418
420UA_Client_Service_registerNodes(UA_Client *client,
421 const UA_RegisterNodesRequest request) {
425 return response;
426}
427
429UA_Client_Service_unregisterNodes(UA_Client *client,
430 const UA_UnregisterNodesRequest request) {
432 __UA_Client_Service(client, &request,
435 return response;
436}
437
438/*
439 * Query Service Set
440 * ^^^^^^^^^^^^^^^^^ */
441#ifdef UA_ENABLE_QUERY
442
443static UA_QueryFirstResponse
444UA_Client_Service_queryFirst(UA_Client *client,
445 const UA_QueryFirstRequest request) {
446 UA_QueryFirstResponse response;
447 __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_QUERYFIRSTREQUEST],
448 &response, &UA_TYPES[UA_TYPES_QUERYFIRSTRESPONSE]);
449 return response;
450}
451
452static UA_QueryNextResponse
453UA_Client_Service_queryNext(UA_Client *client,
454 const UA_QueryNextRequest request) {
455 UA_QueryNextResponse response;
456 __UA_Client_Service(client, &request, &UA_TYPES[UA_TYPES_QUERYFIRSTREQUEST],
457 &response, &UA_TYPES[UA_TYPES_QUERYFIRSTRESPONSE]);
458 return response;
459}
460
461#endif
462
463
464
465/** Use the type versions of this method. See below. However, the general
466 * mechanism of async service calls is explained here.
467 *
468 * We say that an async service call has been dispatched once this method
469 * returns UA_STATUSCODE_GOOD. If there is an error after an async service has
470 * been dispatched, the callback is called with an "empty" response where the
471 * statusCode has been set accordingly. This is also done if the client is
472 * shutting down and the list of dispatched async services is emptied.
473 *
474 * The statusCode received when the client is shutting down is
475 * UA_STATUSCODE_BADSHUTDOWN.
476 *
477 * The statusCode received when the client don't receive response
478 * after specified config->timeout (in ms) is
479 * UA_STATUSCODE_BADTIMEOUT.
480 *
481 * Instead, you can use __UA_Client_AsyncServiceEx to specify
482 * a custom timeout
483 *
484 * The userdata and requestId arguments can be NULL. */
485
486typedef void (*UA_ClientAsyncServiceCallback)(UA_Client *client, void *userdata,
487 UA_UInt32 requestId, void *response);
488
490__UA_Client_AsyncService(UA_Client *client, const void *request,
491 const UA_DataType *requestType,
493 const UA_DataType *responseType,
494 void *userdata, UA_UInt32 *requestId);
495
497UA_Client_sendAsyncRequest(UA_Client *client, const void *request,
498 const UA_DataType *requestType, UA_ClientAsyncServiceCallback callback,
499 const UA_DataType *responseType, void *userdata, UA_UInt32 *requestId);
500
501/** Set new userdata and callback for an existing request.
502 *
503 * @param client Pointer to the UA_Client
504 * @param requestId RequestId of the request, which was returned by
505 * UA_Client_sendAsyncRequest before
506 * @param userdata The new userdata.
507 * @param callback The new callback
508 * @return UA_StatusCode UA_STATUSCODE_GOOD on success
509 * UA_STATUSCODE_BADNOTFOUND when no request with requestId is found. */
512 void *userdata, UA_ClientAsyncServiceCallback callback);
513
514/** Listen on the network and process arriving asynchronous responses in the
515 * background. Internal housekeeping, renewal of SecureChannels and subscription
516 * management is done as well. */
519
520/** Force the manual renewal of the SecureChannel. This is useful to renew the
521 * SecureChannel during a downtime when no time-critical operations are
522 * performed. This method is asynchronous. The renewal is triggered (the OPN
523 * message is sent) but not completed. The OPN response is handled with
524 * ``UA_Client_run_iterate`` or a synchronous servica-call operation.
525 *
526 * @return The return value is UA_STATUSCODE_GOODCALLAGAIN if the SecureChannel
527 * has not elapsed at least 75% of its lifetime. Otherwise the
528 * ``connectStatus`` is returned. */
531
532/** Use the type versions of this method. See below. However, the general
533 * mechanism of async service calls is explained here.
534 *
535 * We say that an async service call has been dispatched once this method
536 * returns UA_STATUSCODE_GOOD. If there is an error after an async service has
537 * been dispatched, the callback is called with an "empty" response where the
538 * statusCode has been set accordingly. This is also done if the client is
539 * shutting down and the list of dispatched async services is emptied.
540 *
541 * The statusCode received when the client is shutting down is
542 * UA_STATUSCODE_BADSHUTDOWN.
543 *
544 * The statusCode received when the client don't receive response
545 * after specified timeout (in ms) is
546 * UA_STATUSCODE_BADTIMEOUT.
547 *
548 * The timeout can be disabled by setting timeout to 0
549 *
550 * The userdata and requestId arguments can be NULL. */
552__UA_Client_AsyncServiceEx(UA_Client *client, const void *request,
553 const UA_DataType *requestType,
555 const UA_DataType *responseType,
556 void *userdata, UA_UInt32 *requestId,
557 UA_UInt32 timeout);
558
559
560
561typedef void (*UA_ClientCallback)(UA_Client *client, void *data);
562
563/** Add a callback for execution at a specified time. If the indicated time lies
564 * in the past, then the callback is executed at the next iteration of the
565 * server's main loop.
566 *
567 * @param client The client object.
568 * @param callback The callback that shall be added.
569 * @param data Data that is forwarded to the callback.
570 * @param date The timestamp for the execution time.
571 * @param callbackId Set to the identifier of the repeated callback . This can
572 * be used to cancel the callback later on. If the pointer is null, the
573 * identifier is not set.
574 * @return Upon success, UA_STATUSCODE_GOOD is returned. An error code
575 * otherwise. */
578 void *data, UA_DateTime date, UA_UInt64 *callbackId);
579
580/** Add a callback for cyclic repetition to the client.
581 *
582 * @param client The client object.
583 * @param callback The callback that shall be added.
584 * @param data Data that is forwarded to the callback.
585 * @param interval_ms The callback shall be repeatedly executed with the given
586 * interval (in ms). The interval must be positive. The first execution
587 * occurs at now() + interval at the latest.
588 * @param callbackId Set to the identifier of the repeated callback . This can
589 * be used to cancel the callback later on. If the pointer is null, the
590 * identifier is not set.
591 * @return Upon success, UA_STATUSCODE_GOOD is returned. An error code
592 * otherwise. */
595 void *data, UA_Double interval_ms,
596 UA_UInt64 *callbackId);
597
600 UA_UInt64 callbackId,
601 UA_Double interval_ms);
602
603void
605
606
607
608/** Lookup a datatype by its NodeId. Takes the custom types in the client
609 * configuration into account. Return NULL if none found. */
610UA_EXPORT const UA_DataType *
612
613
614
616
617#endif /* UA_CLIENT_H_ */
void(* UA_ClientAsyncServiceCallback)(UA_Client *client, void *userdata, UA_UInt32 requestId, void *response)
Use the type versions of this method.
Definition client.h:486
UA_StatusCode UA_Client_addTimedCallback(UA_Client *client, UA_ClientCallback callback, void *data, UA_DateTime date, UA_UInt64 *callbackId)
Add a callback for execution at a specified time.
void UA_Client_getState(UA_Client *client, UA_SecureChannelState *channelState, UA_SessionState *sessionState, UA_StatusCode *connectStatus)
Returns the current state.
void __UA_Client_Service(UA_Client *client, const void *request, const UA_DataType *requestType, void *response, const UA_DataType *responseType)
Don't use this function.
UA_EXPORT UA_ClientConfig * UA_Client_getConfig(UA_Client *client)
Get the client configuration.
UA_StatusCode UA_Client_connect(UA_Client *client, const char *endpointUrl)
Connect to the server.
UA_StatusCode UA_Client_renewSecureChannel(UA_Client *client)
Force the manual renewal of the SecureChannel.
UA_StatusCode UA_Client_connectSecureChannel(UA_Client *client, const char *endpointUrl)
Connect to the server without creating a session.
void(* UA_ClientCallback)(UA_Client *client, void *data)
Definition client.h:561
UA_StatusCode UA_Client_disconnectAsync(UA_Client *client)
Disconnect async.
UA_StatusCode UA_Client_disconnect(UA_Client *client)
Disconnect and close a connection to the selected server.
UA_StatusCode UA_Client_findServersOnNetwork(UA_Client *client, const char *serverUrl, UA_UInt32 startingRecordId, UA_UInt32 maxRecordsToReturn, size_t serverCapabilityFilterSize, UA_String *serverCapabilityFilter, size_t *serverOnNetworkSize, UA_ServerOnNetwork **serverOnNetwork)
Get a list of all known server in the network.
UA_StatusCode UA_Client_modifyAsyncCallback(UA_Client *client, UA_UInt32 requestId, void *userdata, UA_ClientAsyncServiceCallback callback)
Set new userdata and callback for an existing request.
UA_EXPORT const UA_DataType * UA_Client_findDataType(UA_Client *client, const UA_NodeId *typeId)
Lookup a datatype by its NodeId.
UA_StatusCode UA_Client_connectAsync(UA_Client *client, const char *endpointUrl)
Connect async (non-blocking) to the server.
UA_Client * UA_Client_newWithConfig(const UA_ClientConfig *config)
The method UA_Client_new is defined in client_config_default.h.
UA_StatusCode UA_Client_addRepeatedCallback(UA_Client *client, UA_ClientCallback callback, void *data, UA_Double interval_ms, UA_UInt64 *callbackId)
Add a callback for cyclic repetition to the client.
UA_StatusCode UA_Client_sendAsyncRequest(UA_Client *client, const void *request, const UA_DataType *requestType, UA_ClientAsyncServiceCallback callback, const UA_DataType *responseType, void *userdata, UA_UInt32 *requestId)
void UA_Client_removeCallback(UA_Client *client, UA_UInt64 callbackId)
void UA_Client_delete(UA_Client *client)
(Disconnect and) delete the client
UA_StatusCode UA_Client_getEndpoints(UA_Client *client, const char *serverUrl, size_t *endpointDescriptionsSize, UA_EndpointDescription **endpointDescriptions)
Gets a list of endpoints of a server.
UA_StatusCode UA_Client_run_iterate(UA_Client *client, UA_UInt32 timeout)
Listen on the network and process arriving asynchronous responses in the background.
UA_StatusCode UA_Client_changeRepeatedCallbackInterval(UA_Client *client, UA_UInt64 callbackId, UA_Double interval_ms)
UA_StatusCode __UA_Client_AsyncService(UA_Client *client, const void *request, const UA_DataType *requestType, UA_ClientAsyncServiceCallback callback, const UA_DataType *responseType, void *userdata, UA_UInt32 *requestId)
UA_StatusCode UA_Client_connectSecureChannelAsync(UA_Client *client, const char *endpointUrl)
Connect async (non-blocking) only the SecureChannel.
UA_StatusCode UA_Client_findServers(UA_Client *client, const char *serverUrl, size_t serverUrisSize, UA_String *serverUris, size_t localeIdsSize, UA_String *localeIds, size_t *registeredServersSize, UA_ApplicationDescription **registeredServers)
Gets a list of all registered servers at the given server.
UA_StatusCode UA_Client_disconnectSecureChannel(UA_Client *client)
Disconnect the SecureChannel but keep the Session intact (if it exists).
UA_StatusCode __UA_Client_AsyncServiceEx(UA_Client *client, const void *request, const UA_DataType *requestType, UA_ClientAsyncServiceCallback callback, const UA_DataType *responseType, void *userdata, UA_UInt32 *requestId, UA_UInt32 timeout)
Use the type versions of this method.
UA_SessionState
Definition common.h:132
UA_SecureChannelState
Definition common.h:120
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:89
#define _UA_END_DECLS
Definition config.h:96
UA_Connection(* UA_ConnectClientConnection)(UA_ConnectionConfig config, UA_String endpointUrl, UA_UInt32 timeout, const UA_Logger *logger)
Definition network.h:170
#define UA_STATUSCODE_BADOUTOFMEMORY
"Not enough memory to complete the operation."
Definition statuscodes.h:25
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition client.h:35
UA_UInt32 timeout
Definition client.h:38
size_t securityPoliciesSize
Definition client.h:74
UA_EndpointDescription endpoint
Definition client.h:56
const UA_DataTypeArray * customDataTypes
Definition client.h:63
UA_Logger logger
Definition client.h:37
UA_UInt16 outStandingPublishRequests
Definition client.h:105
size_t sessionLocaleIdsSize
Definition client.h:117
UA_String applicationUri
Definition client.h:60
UA_UInt32 requestedSessionTimeout
Definition client.h:69
UA_CertificateVerification certificateVerification
Definition client.h:78
UA_SecurityPolicy * securityPolicies
Definition client.h:75
UA_ApplicationDescription clientDescription
Definition client.h:43
UA_ConnectionConfig localConnectionConfig
Definition client.h:70
UA_String securityPolicyUri
Definition client.h:51
UA_ExtensionObject userIdentityToken
Definition client.h:46
UA_MessageSecurityMode securityMode
Definition client.h:47
UA_ConnectClientConnection initConnectionFunc
Definition client.h:81
UA_UserTokenPolicy userTokenPolicy
Definition client.h:57
UA_UInt32 connectivityCheckInterval
Definition client.h:71
void * clientContext
Definition client.h:36
UA_LocaleId * sessionLocaleIds
Definition client.h:116
UA_UInt32 secureChannelLifeTime
Definition client.h:67
Datatype arrays with custom type definitions can be added in a linked list to the client or server co...
Definition types.h:859
UA_ExtensionObjectEncoding encoding
Definition types.h:702
const UA_DataType * type
Definition types.h:709
struct UA_ExtensionObject::@25::@27 decoded
union UA_ExtensionObject::@25 content
uint16_t UA_UInt16
Definition types.h:46
@ UA_EXTENSIONOBJECT_DECODED
Definition types.h:695
uint32_t UA_UInt32
Definition types.h:56
int64_t UA_DateTime
Definition types.h:144
uint32_t UA_StatusCode
Definition types.h:77
double UA_Double
Definition types.h:74
#define UA_STRING_ALLOC(CHARS)
Definition types.h:137
uint64_t UA_UInt64
Definition types.h:66
#define UA_TYPES_WRITERESPONSE
#define UA_TYPES_UNREGISTERNODESRESPONSE
#define UA_TYPES_CALLREQUEST
#define UA_TYPES_BROWSENEXTREQUEST
#define UA_TYPES_ADDNODESREQUEST
#define UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE
#define UA_TYPES_ADDREFERENCESREQUEST
#define UA_TYPES_BROWSENEXTRESPONSE
UA_MessageSecurityMode
#define UA_TYPES_DELETEREFERENCESREQUEST
#define UA_TYPES_BROWSEREQUEST
#define UA_TYPES_REGISTERNODESREQUEST
#define UA_TYPES_CALLRESPONSE
#define UA_TYPES_ADDNODESRESPONSE
#define UA_TYPES_ADDREFERENCESRESPONSE
#define UA_TYPES_DELETEREFERENCESRESPONSE
#define UA_TYPES_DELETENODESRESPONSE
#define UA_TYPES_READREQUEST
#define UA_TYPES_WRITEREQUEST
#define UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST
const UA_DataType UA_TYPES[191]
#define UA_TYPES_USERNAMEIDENTITYTOKEN
#define UA_TYPES_DELETENODESREQUEST
#define UA_TYPES_BROWSERESPONSE
#define UA_TYPES_READRESPONSE
#define UA_TYPES_UNREGISTERNODESREQUEST
#define UA_TYPES_REGISTERNODESRESPONSE