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 
29 #ifndef LIBS2OPC_CLIENT_COMMON_H_
30 #define LIBS2OPC_CLIENT_COMMON_H_
31 
32 #include <stdint.h>
33 #include "libs2opc_client.h"
34 #include "libs2opc_client_cmds.h"
35 
36 /*
37  * ================
38  * TYPE DEFINITIONS
39  * ================
40  */
41 
54 typedef void SOPC_ClientCommon_DiscoveryCbk(const SOPC_StatusCode requestStatus,
55  const void* response,
56  const uintptr_t responseContext);
57 
58 /*
59  ===================
60  SERVICES DEFINITION
61  =================== */
62 
78  SOPC_ClientCommon_DiscoveryCbk* const cbkGetEndpoints);
79 
87 
100 uint32_t SOPC_ClientCommon_CreateReverseEndpoint(const char* reverseEndpointURL);
101 
114 
132 
154 
184  const SOPC_LibSub_CstString* lszNodeId,
185  const SOPC_LibSub_AttributeId* lattrId,
186  int32_t nElements,
187  SOPC_LibSub_DataId* lDataId,
189 
199 
213  void* requestStruct,
214  uintptr_t requestContext);
215 
228  uintptr_t requestContext);
229 
242 
256 SOPC_ReturnStatus SOPC_ClientCommon_SetLocaleIds(size_t nbLocales, const char** localeIds);
257 
275  const char* productUri,
276  const char* defaultAppName,
277  const char* defaultAppNameLocale,
278  OpcUa_ApplicationType applicationType);
279 
280 #endif /* LIBS2OPC_CLIENT_COMMON_H_ */
SOPC_StatusCode
uint32_t SOPC_StatusCode
Definition: libs2opc_client.h:60
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:59
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:122
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:54
SOPC_LibSub_CstString
const char * SOPC_LibSub_CstString
Definition: libs2opc_client.h:118
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:294
SOPC_LibSub_ConnectionId
uint32_t SOPC_LibSub_ConnectionId
Definition: libs2opc_client.h:126
SOPC_ClientHelper_EndpointConnection
Connection configuration to a remote OPC server.
Definition: libs2opc_client_cmds.h:159
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:179
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:130
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:384
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:64