Go to the documentation of this file.
39 #ifndef STATE_MACHINE_H_
40 #define STATE_MACHINE_H_
43 #define MONIT_TIMESTAMPS_TO_RETURN OpcUa_TimestampsToReturn_Both
44 #define MONIT_QSIZE 10
54 #define SKIP_S2OPC_DEFINITIONS
136 const char* szPolicyId,
137 const char* szUsername,
138 const char* szPassword,
139 const char* szPath_cert_x509_token,
140 const char* szPath_key_x509_token,
142 double fPublishInterval,
143 uint32_t iCntMaxKeepAlive,
144 uint32_t iCntLifetime,
145 uint32_t iTokenTarget,
148 uintptr_t userContext,
238 char const*
const* lszNodeId,
239 const uint32_t* liAttrId,
void SOPC_StaMac_SetUserContext(SOPC_StaMac_Machine *pSM, uintptr_t userContext)
Overwrite the user content in the given state machine.
uintptr_t outCtxId
Definition: state_machine.h:216
SOPC_ReturnStatus SOPC_StaMac_Create(uint32_t iscConfig, SOPC_ReverseEndpointConfigIdx reverseConfigIdx, uint32_t iCliId, const char *szPolicyId, const char *szUsername, const char *szPassword, const char *szPath_cert_x509_token, const char *szPath_key_x509_token, SOPC_LibSub_DataChangeCbk *cbkLibSubDataChanged, double fPublishInterval, uint32_t iCntMaxKeepAlive, uint32_t iCntLifetime, uint32_t iTokenTarget, int64_t iTimeoutMs, SOPC_LibSub_EventCbk *cbkGenericEvent, uintptr_t userContext, SOPC_StaMac_Machine **ppSM)
Creates a new state machine, initialized in state stInit.
SOPC_StaMac_RequestType requestType
Definition: state_machine.h:97
bool SOPC_StaMac_HasMonItByAppCtx(SOPC_StaMac_Machine *pSM, SOPC_CreateMonitoredItem_Ctx *pAppCtx)
Returns whether the machine has created the MonitoredItem with the given appCtx or not.
uintptr_t SOPC_StaMac_GetUserContext(SOPC_StaMac_Machine *pSM)
Returns the user context provided to SOPC_StaMac_Create or modified through SOPC_StaMac_SetUserContex...
OpcUa_CreateMonitoredItemsResponse * Results
Definition: state_machine.h:215
@ stActivated
Definition: state_machine.h:64
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:255
@ SOPC_REQUEST_TYPE_GET_ENDPOINTS
Definition: state_machine.h:80
@ stError
Definition: state_machine.h:61
@ SOPC_REQUEST_TYPE_UNKNOWN
Definition: state_machine.h:74
@ SOPC_REQUEST_TYPE_DELETE_SUBSCRIPTION
Definition: state_machine.h:79
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_StaMac_State
Definition: state_machine.h:60
bool SOPC_StaMac_IsError(SOPC_StaMac_Machine *pSM)
Returns a bool whether the machine is in stError or not.
Interface of a library supporting the subscription management, read/write operation and browse.
@ stClosing
Definition: state_machine.h:68
uintptr_t appCtx
Definition: state_machine.h:95
void SOPC_StaMac_Delete(SOPC_StaMac_Machine **ppSM)
Deletes and deallocate the machine.
bool SOPC_StaMac_EventDispatcher(SOPC_StaMac_Machine *pSM, uintptr_t *pAppCtx, SOPC_App_Com_Event event, uint32_t arg, void *pParam, uintptr_t appCtx)
Handles the events from the Toolkit and changes the state machine state.
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:231
@ stDeletingSubscr
Definition: state_machine.h:67
SOPC_ReturnStatus SOPC_StaMac_ConfigureDataChangeCallback(SOPC_StaMac_Machine *pSM, SOPC_ClientHelper_DataChangeCbk *pCbkClientHelper)
@ SOPC_REQUEST_TYPE_CREATE_SUBSCRIPTION
Definition: state_machine.h:77
@ stActivating
Definition: state_machine.h:63
A log manager providing circular logging, multiple logging categories and levels with thread-safe acc...
void SOPC_StaMac_SetError(SOPC_StaMac_Machine *pSM)
Put the state machine in error state (without closing). This avoids additional notifications.
int64_t SOPC_StaMac_GetTimeout(SOPC_StaMac_Machine *pSM)
Returns the timeout of the machine, used for the synchroneous calls.
SOPC_StaMac_RequestScope
Definition: state_machine.h:85
SOPC_StaMac_RequestType
Definition: state_machine.h:73
Definition: state_machine.h:94
bool SOPC_StaMac_IsConnectable(SOPC_StaMac_Machine *pSM)
Returns a bool whether the machine is configured and ready for a new SecureChannel.
SOPC_StaMac_RequestScope requestScope
Definition: state_machine.h:96
SOPC_ReturnStatus SOPC_StaMac_CreateSubscription(SOPC_StaMac_Machine *pSM)
@ SOPC_REQUEST_SCOPE_DISCOVERY
Definition: state_machine.h:89
SOPC_ReturnStatus SOPC_StaMac_SendRequest(SOPC_StaMac_Machine *pSM, void *requestStruct, uintptr_t appCtx, SOPC_StaMac_RequestScope requestScope, SOPC_StaMac_RequestType requestType)
Sends a request, wraps SOPC_ToolkitClient_AsyncSendRequestOnSession().
SOPC_ReturnStatus SOPC_StaMac_StopSession(SOPC_StaMac_Machine *pSM)
Closes the session.
@ SOPC_REQUEST_SCOPE_STATE_MACHINE
Definition: state_machine.h:86
@ SOPC_REQUEST_SCOPE_APPLICATION
Definition: state_machine.h:87
@ SOPC_REQUEST_TYPE_CREATE_MONITORED_ITEMS
Definition: state_machine.h:78
Contains the types to be used by the user application to use the Toolkit.
SOPC_App_Com_Event
Client and Server communication events to be managed by applicative code.
Definition: sopc_user_app_itf.h:283
bool SOPC_StaMac_HasSubscription(SOPC_StaMac_Machine *pSM)
Returns a bool whether the machine has an active subscription or not.
@ stInit
Definition: state_machine.h:62
SOPC_ReturnStatus SOPC_StaMac_CreateMonitoredItem(SOPC_StaMac_Machine *pSM, char const *const *lszNodeId, const uint32_t *liAttrId, int32_t nElems, SOPC_CreateMonitoredItem_Ctx *pAppCtx, uint32_t *lCliHndl)
Creates a MonitoredItem asynchronously.
struct SOPC_CreateMonitoredItem_Ctx SOPC_CreateMonitoredItem_Ctx
Context structure to be provided when using SOPC_StaMac_CreateMonitoredItem.
Definition: sopc_types.h:5586
bool SOPC_StaMac_IsConnected(SOPC_StaMac_Machine *pSM)
Returns a bool whether the machine is in a connected state or not.
@ SOPC_REQUEST_TYPE_PUBLISH
Definition: state_machine.h:76
Interface of an example client library supporting the subscription management.
@ stCreatingMonIt
Definition: state_machine.h:66
@ stCreatingSubscr
Definition: state_machine.h:65
Context structure to be provided when using SOPC_StaMac_CreateMonitoredItem.
Definition: state_machine.h:214
Defines the cryptographic profiles: constants and struct.
SOPC_ReturnStatus SOPC_StaMac_StartSession(SOPC_StaMac_Machine *pSM)
Creates a session asynchronously.
SOPC_ReturnStatus SOPC_StaMac_DeleteSubscription(SOPC_StaMac_Machine *pSM)
Delete subscription associated to the given state machine.
@ SOPC_REQUEST_TYPE_USER
Definition: state_machine.h:75
struct SOPC_StaMac_Machine SOPC_StaMac_Machine
Definition: state_machine.h:101
SOPC_ReturnStatus
Definition: libs2opc_client.h:61