S2OPC OPCUA Toolkit
|
Helpers for the Toolkit API. More...
#include <stdarg.h>
#include <stdbool.h>
#include "sopc_key_manager.h"
#include "sopc_types.h"
#include "sopc_builtintypes.h"
#include "sopc_crypto_profiles.h"
#include "sopc_log_manager.h"
#include "sopc_user_app_itf.h"
#include "libs2opc_client.h"
Go to the source code of this file.
Macros | |
#define | MAX_NOTIFICATIONS_PER_REQUEST 1000 |
#define | SKIP_S2OPC_DEFINITIONS |
Functions | |
SOPC_ReturnStatus | Helpers_NewSCConfigFromLibSubCfg (const char *szServerUrl, const char *szServerUri, const char *szSecuPolicy, OpcUa_MessageSecurityMode msgSecurityMode, bool bDisablePKI, const char *szPathCertifAuth, const char *szPathCertServer, const char *szPathCertClient, const char *szPathKeyClient, const char *szPathCrl, uint32_t iScRequestedLifetime, const OpcUa_GetEndpointsResponse *expectedEndpoints, SOPC_Client_Config *clientAppCfg, SOPC_SecureChannel_Config **ppNewCfg) |
Creates a new Toolkit secure channel configuration from elements of the SOPC_LibSub_ConnectionCfg. More... | |
void | Helpers_SecureChannel_Config_Free (SOPC_SecureChannel_Config **ppscConfig) |
A SOPC_SecureChannel_Config destructor which free elements from Helpers_NewSCConfigFromLibSubCfg(). More... | |
SOPC_ReturnStatus | Helpers_NewCreateSubscriptionRequest (double fPublishIntervalMs, uint32_t iCntMaxKeepAlive, uint32_t iCntLifetime, void **ppRequest) |
Creates a new CreateSubscriptionRequest. More... | |
SOPC_ReturnStatus | Helpers_NewDeleteSubscriptionRequest (uint32_t subscriptionId, void **ppRequest) |
Creates a new DeleteSubscriptionRequest. More... | |
SOPC_ReturnStatus | Helpers_NewPublishRequest (bool bAck, uint32_t iSubId, uint32_t iSeqNum, void **ppRequest) |
Creates a new PublishRequest. More... | |
SOPC_ReturnStatus | Helpers_NewCreateMonitoredItemsRequest (SOPC_NodeId **lpNid, const uint32_t *liAttrId, int32_t nElems, uint32_t iSubId, OpcUa_TimestampsToReturn tsToReturn, uint32_t *liCliHndl, uint32_t iQueueSize, void **ppRequest) |
Creates a new CreateMonitoredItemsRequest with multiple ItemToCreate. More... | |
SOPC_ReturnStatus | Helpers_NewValueFromDataValue (SOPC_DataValue *pVal, SOPC_LibSub_Value **pplsVal) |
Converts a SOPC_DataValue to a SOPC_LibSub_Value, returns NULL when the conversion is not possible (or on memory allocation failure, or when an uint64_t is greater than the INT64_MAX). More... | |
SOPC_LibSub_Timestamp | Helpers_OPCTimeToNTP (SOPC_DateTime ts) |
OPC-UA time (hundreds of nanosecs since 1601/01/01 00:00:00 UTC) to NTP time (2**-32 seconds since 1900/01/01 00:00:00 UTC). More... | |
void | Helpers_Log (const SOPC_Log_Level log_level, const char *format,...) |
Buffers a log message, then calls the callback configured with the LibSub. More... | |
void | Helpers_SetLogger (SOPC_LibSub_LogCbk cbk) |
Sets the cbk function as the called callback by Helpers_Log(). More... | |
void | Helpers_LoggerStdout (const SOPC_Log_Level log_level, const SOPC_LibSub_CstString text) |
Prints a log message to stdout, with the following format "# log_level: text\n". More... | |
Helpers for the Toolkit API.
#define MAX_NOTIFICATIONS_PER_REQUEST 1000 |
#define SKIP_S2OPC_DEFINITIONS |
SOPC_ReturnStatus Helpers_NewSCConfigFromLibSubCfg | ( | const char * | szServerUrl, |
const char * | szServerUri, | ||
const char * | szSecuPolicy, | ||
OpcUa_MessageSecurityMode | msgSecurityMode, | ||
bool | bDisablePKI, | ||
const char * | szPathCertifAuth, | ||
const char * | szPathCertServer, | ||
const char * | szPathCertClient, | ||
const char * | szPathKeyClient, | ||
const char * | szPathCrl, | ||
uint32_t | iScRequestedLifetime, | ||
const OpcUa_GetEndpointsResponse * | expectedEndpoints, | ||
SOPC_Client_Config * | clientAppCfg, | ||
SOPC_SecureChannel_Config ** | ppNewCfg | ||
) |
Creates a new Toolkit secure channel configuration from elements of the SOPC_LibSub_ConnectionCfg.
Parameters are copied where needed, and can be freed after the call to this function.
void Helpers_SecureChannel_Config_Free | ( | SOPC_SecureChannel_Config ** | ppscConfig | ) |
A SOPC_SecureChannel_Config destructor which free elements from Helpers_NewSCConfigFromLibSubCfg().
SOPC_ReturnStatus Helpers_NewCreateSubscriptionRequest | ( | double | fPublishIntervalMs, |
uint32_t | iCntMaxKeepAlive, | ||
uint32_t | iCntLifetime, | ||
void ** | ppRequest | ||
) |
Creates a new CreateSubscriptionRequest.
SOPC_ReturnStatus Helpers_NewDeleteSubscriptionRequest | ( | uint32_t | subscriptionId, |
void ** | ppRequest | ||
) |
Creates a new DeleteSubscriptionRequest.
subscriptionId | subscription id |
ppRequest | pointer to the request to be filled |
SOPC_ReturnStatus Helpers_NewPublishRequest | ( | bool | bAck, |
uint32_t | iSubId, | ||
uint32_t | iSeqNum, | ||
void ** | ppRequest | ||
) |
Creates a new PublishRequest.
SOPC_ReturnStatus Helpers_NewCreateMonitoredItemsRequest | ( | SOPC_NodeId ** | lpNid, |
const uint32_t * | liAttrId, | ||
int32_t | nElems, | ||
uint32_t | iSubId, | ||
OpcUa_TimestampsToReturn | tsToReturn, | ||
uint32_t * | liCliHndl, | ||
uint32_t | iQueueSize, | ||
void ** | ppRequest | ||
) |
Creates a new CreateMonitoredItemsRequest with multiple ItemToCreate.
SOPC_ReturnStatus Helpers_NewValueFromDataValue | ( | SOPC_DataValue * | pVal, |
SOPC_LibSub_Value ** | pplsVal | ||
) |
Converts a SOPC_DataValue to a SOPC_LibSub_Value, returns NULL when the conversion is not possible (or on memory allocation failure, or when an uint64_t is greater than the INT64_MAX).
Does not handle arrays.
SOPC_LibSub_Timestamp Helpers_OPCTimeToNTP | ( | SOPC_DateTime | ts | ) |
OPC-UA time (hundreds of nanosecs since 1601/01/01 00:00:00 UTC) to NTP time (2**-32 seconds since 1900/01/01 00:00:00 UTC).
void Helpers_Log | ( | const SOPC_Log_Level | log_level, |
const char * | format, | ||
... | |||
) |
Buffers a log message, then calls the callback configured with the LibSub.
See Helpers_SetLogger().
void Helpers_SetLogger | ( | SOPC_LibSub_LogCbk | cbk | ) |
Sets the cbk
function as the called callback by Helpers_Log().
The default log function outputs to the standard output.
void Helpers_LoggerStdout | ( | const SOPC_Log_Level | log_level, |
const SOPC_LibSub_CstString | text | ||
) |
Prints a log message to stdout, with the following format "# log_level: text\n".