Go to the documentation of this file.
30 #ifndef LIBS2OPC_CLIENT_H_
31 #define LIBS2OPC_CLIENT_H_
54 #ifndef SKIP_S2OPC_DEFINITIONS
97 #define SOPC_SecurityPolicy_None_URI "http://opcfoundation.org/UA/SecurityPolicy#None"
98 #define SOPC_SecurityPolicy_Basic256_URI "http://opcfoundation.org/UA/SecurityPolicy#Basic256"
99 #define SOPC_SecurityPolicy_Basic256Sha256_URI "http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256"
100 #define SOPC_SecurityPolicy_Aes128Sha256RsaOaep_URI "http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep"
101 #define SOPC_SecurityPolicy_Aes256Sha256RsaPss_URI "http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss"
181 #define SOPC_LibSub_AttributeId_NodeId 1
182 #define SOPC_LibSub_AttributeId_NodeClass 2
183 #define SOPC_LibSub_AttributeId_BrowseName 3
184 #define SOPC_LibSub_AttributeId_DisplayName 4
185 #define SOPC_LibSub_AttributeId_Description 5
186 #define SOPC_LibSub_AttributeId_WriteMask 6
187 #define SOPC_LibSub_AttributeId_UserWriteMask 7
188 #define SOPC_LibSub_AttributeId_IsAbstract 8
189 #define SOPC_LibSub_AttributeId_Symmetric 9
190 #define SOPC_LibSub_AttributeId_InverseName 10
191 #define SOPC_LibSub_AttributeId_ContainsNoLoops 11
192 #define SOPC_LibSub_AttributeId_EventNotifier 12
193 #define SOPC_LibSub_AttributeId_Value 13
194 #define SOPC_LibSub_AttributeId_DataType 14
195 #define SOPC_LibSub_AttributeId_ValueRank 15
196 #define SOPC_LibSub_AttributeId_ArrayDimensions 16
197 #define SOPC_LibSub_AttributeId_AccessLevel 17
198 #define SOPC_LibSub_AttributeId_UserAccessLevel 18
199 #define SOPC_LibSub_AttributeId_MinimumSamplingInterval 19
200 #define SOPC_LibSub_AttributeId_Historizing 20
201 #define SOPC_LibSub_AttributeId_Executable 21
202 #define SOPC_LibSub_AttributeId_UserExecutable 22
275 const void* response,
276 uintptr_t responseContext);
538 uintptr_t requestContext);
Structure defining the value of a node.
Definition: libs2opc_client.h:165
@ OpcUa_MessageSecurityMode_SignAndEncrypt
Definition: libs2opc_client.h:93
SOPC_LibSub_DisconnectCbk * disconnect_callback
Definition: libs2opc_client.h:296
@ SOPC_LOG_LEVEL_WARNING
Definition: libs2opc_client.h:81
SOPC_LibSub_CstString password
Definition: libs2opc_client.h:399
void * raw_value
Definition: libs2opc_client.h:172
uint32_t SOPC_StatusCode
Definition: libs2opc_client.h:60
OpcUa_MessageSecurityMode security_mode
Definition: libs2opc_client.h:390
void SOPC_LibSub_EventCbk(SOPC_LibSub_ConnectionId c_id, SOPC_LibSub_ApplicativeEvent event, SOPC_StatusCode status, const void *response, uintptr_t responseContext)
Callback for generic responses to a call to SOPC_LibSub_AsyncSendRequestOnSession().
Definition: libs2opc_client.h:272
SOPC_UserPolicyId
Definition: libs2opc_client.h:104
SOPC_LibSub_DataType type
Definition: libs2opc_client.h:166
@ OpcUa_MessageSecurityMode_Sign
Definition: libs2opc_client.h:92
uint32_t n_max_keepalive
Definition: libs2opc_client.h:404
int64_t publish_period_ms
Definition: libs2opc_client.h:403
SOPC_LibSub_Timestamp server_timestamp
Definition: libs2opc_client.h:171
uint32_t maxBytes
Definition: libs2opc_client.h:301
@ SOPC_STATUS_WOULD_BLOCK
Definition: libs2opc_client.h:70
@ SOPC_LibSub_DataType_string
Definition: libs2opc_client.h:142
SOPC_LibSub_CstString security_policy
Definition: libs2opc_client.h:389
OpcUa_MessageSecurityMode
Definition: libs2opc_client.h:89
@ SOPC_STATUS_ENCODING_ERROR
Definition: libs2opc_client.h:69
uint32_t SOPC_LibSub_ConfigurationId
Definition: libs2opc_client.h:122
void Helpers_LoggerStdout(const SOPC_Log_Level log_level, const SOPC_LibSub_CstString text)
Helper logger, prints a log message to stdout, with the following format "# log_level: text\n".
SOPC_LibSub_CstString path_key_cli
Definition: libs2opc_client.h:396
void * value
Definition: libs2opc_client.h:168
@ SOPC_STATUS_INVALID_STATE
Definition: libs2opc_client.h:68
SOPC_LibSub_EventCbk * generic_response_callback
Definition: libs2opc_client.h:410
const char * SOPC_LibSub_CstString
Definition: libs2opc_client.h:118
SOPC_ReturnStatus SOPC_LibSub_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_USER_POLICY_ID_USERNAME
Definition: libs2opc_client.h:106
void SOPC_LibSub_DataChangeCbk(const SOPC_LibSub_ConnectionId c_id, const SOPC_LibSub_DataId d_id, const SOPC_LibSub_Value *value)
Callback type for data change event (related to a subscription)
Definition: libs2opc_client.h:247
Static configuration of OPC client library.
Definition: libs2opc_client.h:294
const char * log_path
Definition: libs2opc_client.h:300
uint32_t SOPC_LibSub_ConnectionId
Definition: libs2opc_client.h:126
@ SOPC_STATUS_OUT_OF_MEMORY
Definition: libs2opc_client.h:72
uint32_t SOPC_LibSub_AttributeId
AttributeIds, as defined in the OPC UA Reference, Part 6 Annex A.
Definition: libs2opc_client.h:179
int64_t timeout_ms
Definition: libs2opc_client.h:407
SOPC_ReturnStatus SOPC_LibSub_ConfigureConnection(const SOPC_LibSub_ConnectionCfg *pCfg, SOPC_LibSub_ConfigurationId *pCfgId)
Configure a future connection. This function shall be called once per connection before a call to SOP...
@ SOPC_STATUS_INVALID_PARAMETERS
Definition: libs2opc_client.h:67
@ SOPC_LibSub_DataType_other
Definition: libs2opc_client.h:144
uint16_t maxFiles
Definition: libs2opc_client.h:302
SOPC_LibSub_DataType
Definition: libs2opc_client.h:139
@ OpcUa_MessageSecurityMode_None
Definition: libs2opc_client.h:91
uint32_t n_max_lifetime
Definition: libs2opc_client.h:405
SOPC_Log_Level
Definition: libs2opc_client.h:79
@ SOPC_LOG_LEVEL_ERROR
Definition: libs2opc_client.h:80
SOPC_LibSub_LogCbk * host_log_callback
Definition: libs2opc_client.h:295
void SOPC_LibSub_Clear(void)
Clears the connections, configurations, and clears the Toolkit.
void SOPC_Sleep(unsigned int milliseconds)
void SOPC_LibSub_LogCbk(const SOPC_Log_Level log_level, SOPC_LibSub_CstString text)
Log callback type.
Definition: libs2opc_client.h:224
@ SOPC_LibSub_DataType_bool
Definition: libs2opc_client.h:140
SOPC_ReturnStatus SOPC_LibSub_AddToSubscription(const SOPC_LibSub_ConnectionId cliId, const SOPC_LibSub_CstString *lszNodeId, const SOPC_LibSub_AttributeId *lattrId, int32_t nElements, SOPC_LibSub_DataId *lDataId)
Add variables to the subscription of the connection. This call is synchroneous: it waits for the serv...
SOPC_LibSub_CstString path_cert_x509_token
Definition: libs2opc_client.h:400
@ SOPC_STATUS_TIMEOUT
Definition: libs2opc_client.h:71
@ SOPC_LibSub_DataType_integer
Definition: libs2opc_client.h:141
void Helpers_Log(const SOPC_Log_Level log_level, const char *format,...)
Buffers a log message, then calls the callback configured with the LibSub.
@ SOPC_STATUS_NOK
Definition: libs2opc_client.h:66
SOPC_LibSub_CstString path_cert_auth
Definition: libs2opc_client.h:392
SOPC_LibSub_CstString server_uri
Definition: libs2opc_client.h:387
SOPC_ReturnStatus SOPC_LibSub_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_<...
uint32_t reverse_config_idx
Definition: libs2opc_client.h:385
SOPC_Log_Level level
Definition: libs2opc_client.h:299
SOPC_LibSub_CstString policyId
Definition: libs2opc_client.h:397
@ SOPC_STATUS_NOT_SUPPORTED
Definition: libs2opc_client.h:74
bool key_x509_token_encrypted
Definition: libs2opc_client.h:402
@ SOPC_USER_POLICY_ID_ANONYMOUS
Definition: libs2opc_client.h:105
SOPC_LibSub_CstString server_url
Definition: libs2opc_client.h:388
void SOPC_LibSub_DisconnectCbk(const SOPC_LibSub_ConnectionId c_id)
Callback type for disconnect event.
Definition: libs2opc_client.h:232
SOPC_ReturnStatus SOPC_LibSub_Initialize(const SOPC_LibSub_StaticCfg *pCfg)
Configure the library. This function shall be called once by the host application before any other se...
@ SOPC_STATUS_CLOSED
Definition: libs2opc_client.h:73
SOPC_LibSub_CstString path_crl
Definition: libs2opc_client.h:393
uint8_t disable_certificate_verification
Definition: libs2opc_client.h:391
@ SOPC_LibSub_ApplicativeEvent_Response
Definition: libs2opc_client.h:213
uint32_t SOPC_LibSub_DataId
Definition: libs2opc_client.h:130
SOPC_LibSub_CstString path_cert_srv
Definition: libs2opc_client.h:394
@ SOPC_LOG_LEVEL_INFO
Definition: libs2opc_client.h:82
SOPC_LibSub_CstString path_key_x509_token
Definition: libs2opc_client.h:401
SOPC_LibSub_ApplicativeEvent
The event passed to the connection SOPC_LibSub_EventCbk. Either an error or a valid response notifica...
Definition: libs2opc_client.h:211
@ OpcUa_MessageSecurityMode_Invalid
Definition: libs2opc_client.h:90
SOPC_LibSub_CstString path_cert_cli
Definition: libs2opc_client.h:395
SOPC_StatusCode quality
Definition: libs2opc_client.h:167
char * SOPC_LibSub_String
Definition: libs2opc_client.h:114
@ SOPC_STATUS_OK
Definition: libs2opc_client.h:65
@ SOPC_LibSub_DataType_bytestring
Definition: libs2opc_client.h:143
SOPC_LibSub_CstString SOPC_LibSub_GetVersion(void)
Return the current version of the library.
SOPC_LibSub_Timestamp source_timestamp
Definition: libs2opc_client.h:170
Connection configuration to a remote OPC server.
Definition: libs2opc_client.h:384
int32_t length
Definition: libs2opc_client.h:169
SOPC_LibSub_CstString username
Definition: libs2opc_client.h:398
SOPC_ReturnStatus SOPC_LibSub_Configured(void)
Mark the library as configured. All calls to SOPC_LibSub_ConfigureConnection() shall be done prior to...
SOPC_LibSub_DataChangeCbk * data_change_callback
Definition: libs2opc_client.h:406
@ SOPC_LOG_LEVEL_DEBUG
Definition: libs2opc_client.h:83
const void * expected_endpoints
Definition: libs2opc_client.h:411
@ SOPC_LibSub_ApplicativeEvent_SendFailed
Definition: libs2opc_client.h:212
SOPC_ReturnStatus SOPC_LibSub_Disconnect(const SOPC_LibSub_ConnectionId cliId)
Disconnect from a remote OPC server. The function waits until the client is effectively disconnected,...
uint16_t token_target
Definition: libs2opc_client.h:409
uint64_t SOPC_LibSub_Timestamp
Definition: libs2opc_client.h:134
uint32_t sc_lifetime
Definition: libs2opc_client.h:408
SOPC_ReturnStatus
Definition: libs2opc_client.h:64