S2OPC OPCUA Toolkit
libs2opc_client_common.h
Go to the documentation of this file.
1 /*
2  * Licensed to Systerel under one or more contributor license
3  * agreements. See the NOTICE file distributed with this work
4  * for additional information regarding copyright ownership.
5  * Systerel licenses this file to you under the Apache
6  * License, Version 2.0 (the "License"); you may not use this
7  * file except in compliance with the License. You may obtain
8  * a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
27 #ifndef LIBS2OPC_CLIENT_COMMON_H_
28 #define LIBS2OPC_CLIENT_COMMON_H_
29 
30 #include <stdint.h>
31 #include "libs2opc_client.h"
32 #include "libs2opc_client_cmds.h"
33 
34 /*
35  * ================
36  * TYPE DEFINITIONS
37  * ================
38  */
39 
52 typedef void SOPC_ClientCommon_DiscoveryCbk(const SOPC_StatusCode requestStatus,
53  const void* response,
54  const uintptr_t responseContext);
55 
56 /*
57  ===================
58  SERVICES DEFINITION
59  =================== */
60 
76  SOPC_ClientCommon_DiscoveryCbk* const cbkGetEndpoints);
77 
85 
98 uint32_t SOPC_ClientCommon_CreateReverseEndpoint(const char* reverseEndpointURL);
99 
112 
130 
152 
182  const SOPC_LibSub_CstString* lszNodeId,
183  const SOPC_LibSub_AttributeId* lattrId,
184  int32_t nElements,
185  SOPC_LibSub_DataId* lDataId,
187 
197 
211  void* requestStruct,
212  uintptr_t requestContext);
213 
226  uintptr_t requestContext);
227 
240 
254 SOPC_ReturnStatus SOPC_ClientCommon_SetLocaleIds(size_t nbLocales, const char** localeIds);
255 
273  const char* productUri,
274  const char* defaultAppName,
275  const char* defaultAppNameLocale,
276  OpcUa_ApplicationType applicationType);
277 
278 #endif /* LIBS2OPC_CLIENT_COMMON_H_ */
SOPC_StatusCode
uint32_t SOPC_StatusCode
Definition: libs2opc_client.h:57
SOPC_ClientCommon_Initialize
SOPC_ReturnStatus SOPC_ClientCommon_Initialize(const SOPC_LibSub_StaticCfg *pCfg, SOPC_ClientCommon_DiscoveryCbk *const cbkGetEndpoints)
Configure the library. This function shall be called once by the host application before any other se...
SOPC_ClientCommon_Clear
void SOPC_ClientCommon_Clear(void)
Clears the connections and configurations. It shall be done before a call to SOPC_CommonHelper_Clear.
SOPC_ClientCommon_CreateReverseEndpoint
uint32_t SOPC_ClientCommon_CreateReverseEndpoint(const char *reverseEndpointURL)
Creates a new reverse endpoint to be used for reverse connection mechanism Return a reverse endpoint ...
SOPC_ClientHelper_DataChangeCbk
void SOPC_ClientHelper_DataChangeCbk(const int32_t connectionId, const char *nodeId, const SOPC_DataValue *value)
Callback type for data change event (related to a subscription)
Definition: libs2opc_client_cmds.h:54
SOPC_ClientCommon_ConfigureConnection
SOPC_ReturnStatus SOPC_ClientCommon_ConfigureConnection(const SOPC_LibSub_ConnectionCfg *pCfg, SOPC_LibSub_ConfigurationId *pCfgId)
Configure a future connection. The given /p pCfgId is later used to create connections.
SOPC_ClientCommon_AsyncSendGetEndpointsRequest
SOPC_ReturnStatus SOPC_ClientCommon_AsyncSendGetEndpointsRequest(SOPC_ClientHelper_EndpointConnection *connection, uintptr_t requestContext)
sends a GetEndpoints request
SOPC_LibSub_ConfigurationId
uint32_t SOPC_LibSub_ConfigurationId
Definition: libs2opc_client.h:116
libs2opc_client_cmds.h
Interface of a library supporting the subscription management, read/write operation and browse.
SOPC_ClientCommon_DiscoveryCbk
void SOPC_ClientCommon_DiscoveryCbk(const SOPC_StatusCode requestStatus, const void *response, const uintptr_t responseContext)
Callback type for discovery events.
Definition: libs2opc_client_common.h:52
SOPC_LibSub_CstString
const char * SOPC_LibSub_CstString
Definition: libs2opc_client.h:113
SOPC_ClientCommon_SetApplicationDescription
SOPC_ReturnStatus SOPC_ClientCommon_SetApplicationDescription(const char *applicationUri, const char *productUri, const char *defaultAppName, const char *defaultAppNameLocale, OpcUa_ApplicationType applicationType)
Define client application description.
SOPC_LibSub_StaticCfg
Static configuration of OPC client library.
Definition: libs2opc_client.h:276
SOPC_LibSub_ConnectionId
uint32_t SOPC_LibSub_ConnectionId
Definition: libs2opc_client.h:119
SOPC_ClientHelper_EndpointConnection
Connection configuration to a remote OPC server.
Definition: libs2opc_client_cmds.h:150
SOPC_ClientCommon_DeleteSubscription
SOPC_ReturnStatus SOPC_ClientCommon_DeleteSubscription(const SOPC_LibSub_ConnectionId cliId)
deletes a subscription
SOPC_LibSub_AttributeId
uint32_t SOPC_LibSub_AttributeId
AttributeIds, as defined in the OPC UA Reference, Part 6 Annex A.
Definition: libs2opc_client.h:167
SOPC_ClientCommon_Connect
SOPC_ReturnStatus SOPC_ClientCommon_Connect(const SOPC_LibSub_ConfigurationId cfgId, SOPC_LibSub_ConnectionId *pCliId)
Creates a new connection to a remote OPC server from configuration id cfg_id. The connection represen...
SOPC_ClientCommon_CreateSubscription
SOPC_ReturnStatus SOPC_ClientCommon_CreateSubscription(const SOPC_LibSub_ConnectionId cliId, SOPC_ClientHelper_DataChangeCbk cbkWrapper)
Create a subscription.
SOPC_LibSub_DataId
uint32_t SOPC_LibSub_DataId
Definition: libs2opc_client.h:122
SOPC_ClientCommon_Disconnect
SOPC_ReturnStatus SOPC_ClientCommon_Disconnect(const SOPC_LibSub_ConnectionId cliId)
Disconnect from a remote OPC server. The function waits until the client is effectively disconnected,...
SOPC_ClientCommon_AddToSubscription
SOPC_ReturnStatus SOPC_ClientCommon_AddToSubscription(const SOPC_LibSub_ConnectionId cliId, const SOPC_LibSub_CstString *lszNodeId, const SOPC_LibSub_AttributeId *lattrId, int32_t nElements, SOPC_LibSub_DataId *lDataId, OpcUa_CreateMonitoredItemsResponse *results)
Add variables to the subscription of the connection. This call is synchroneous: it waits for the serv...
SOPC_ClientCommon_SetLocaleIds
SOPC_ReturnStatus SOPC_ClientCommon_SetLocaleIds(size_t nbLocales, const char **localeIds)
Define client preferred locales ids from an array of locale strings.
_OpcUa_CreateMonitoredItemsResponse
Definition: sopc_types.h:5586
SOPC_LibSub_ConnectionCfg
Connection configuration to a remote OPC server.
Definition: libs2opc_client.h:365
libs2opc_client.h
Interface of an example client library supporting the subscription management.
SOPC_ClientCommon_AsyncSendRequestOnSession
SOPC_ReturnStatus SOPC_ClientCommon_AsyncSendRequestOnSession(SOPC_LibSub_ConnectionId cliId, void *requestStruct, uintptr_t requestContext)
Sends a generic request on the connection. The request must be accepted by the SOPC encoders (OpcUa_<...
OpcUa_ApplicationType
enum _OpcUa_ApplicationType OpcUa_ApplicationType
SOPC_ReturnStatus
SOPC_ReturnStatus
Definition: libs2opc_client.h:61