39#ifndef STATE_MACHINE_H_
40#define STATE_MACHINE_H_
43#define MONIT_TIMESTAMPS_TO_RETURN OpcUa_TimestampsToReturn_Both
86 uintptr_t responseContext);
159 const char* szPolicyId,
160 const char* szUsername,
161 const char* szPassword,
164 uint32_t iTokenTarget,
166 uintptr_t userContext,
217 uintptr_t userAppContext);
228 double* revisedPublishingInterval,
229 uint32_t* revisedLifetimeCount,
230 uint32_t* revisedMaxKeepAliveCount);
274 uint32_t nbNotifElts,
275 const void* notification,
276 uintptr_t* monitoredItemCtxArray);
306 const uintptr_t* userAppCtxArray,
uint32_t SOPC_StatusCode
Definition sopc_builtintypes.h:36
SOPC_SecretBuffer SOPC_SerializedAsymmetricKey
A serialized representation of an asymmetric key.
Definition sopc_crypto_decl.h:70
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
enum _SOPC_App_Com_Event SOPC_App_Com_Event
Client and Server communication events to be managed by applicative code.
SOPC_ReturnStatus SOPC_StaMac_NewCreateSubscription(SOPC_StaMac_Machine *pSM, OpcUa_CreateSubscriptionRequest *req, uintptr_t userAppContext)
SOPC_ReturnStatus SOPC_StaMac_Create(uint32_t iscConfig, SOPC_ReverseEndpointConfigIdx reverseConfigIdx, uint32_t iCliId, const char *szPolicyId, const char *szUsername, const char *szPassword, const SOPC_SerializedCertificate *pUserCertX509, const SOPC_SerializedAsymmetricKey *pUserKey, uint32_t iTokenTarget, SOPC_StaMac_EventCbk *cbkGenericEvent, uintptr_t userContext, SOPC_StaMac_Machine **ppSM)
Creates a new state machine, initialized in state stInit.
uintptr_t SOPC_StaMac_GetUserContext(SOPC_StaMac_Machine *pSM)
Returns the user context provided to SOPC_StaMac_Create or modified through SOPC_StaMac_SetUserContex...
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.
struct SOPC_CreateMonitoredItems_Ctx SOPC_CreateMonitoredItems_Ctx
Context structure to be provided when using SOPC_StaMac_NewCreateMonitoredItems.
bool SOPC_StaMac_IsError(SOPC_StaMac_Machine *pSM)
Returns a bool whether the machine is in stError or not.
struct SOPC_StaMac_Machine SOPC_StaMac_Machine
Definition state_machine.h:123
SOPC_ReturnStatus SOPC_StaMac_NewConfigureNotificationCallback(SOPC_StaMac_Machine *pSM, SOPC_StaMacNotification_Fct *pNotificationCb)
SOPC_ReturnStatus SOPC_StaMac_SetSubscriptionNbTokens(SOPC_StaMac_Machine *pSM, uint32_t nbTokens)
void SOPC_StaMac_SetError(SOPC_StaMac_Machine *pSM)
Put the state machine in error state (without closing). This avoids additional notifications.
SOPC_ReturnStatus SOPC_StaMac_StopSession(SOPC_StaMac_Machine *pSM)
Closes the session.
uintptr_t SOPC_StaMac_GetSubscriptionCtx(SOPC_StaMac_Machine *pSM)
return the context provided in SOPC_StaMac_NewCreateSubscription
bool SOPC_StaMac_PopMonItByAppCtx(SOPC_StaMac_Machine *pSM, SOPC_CreateMonitoredItems_Ctx *pAppCtx)
Returns whether the machine has created the MonitoredItems with the given appCtx or not....
_SOPC_StaMac_ApplicativeEvent
The event passed to the connection SOPC_LibSub_EventCbk. Either an error or a valid response notifica...
Definition state_machine.h:57
@ SOPC_StaMac_ApplicativeEvent_SendFailed
Definition state_machine.h:58
@ SOPC_StaMac_ApplicativeEvent_Response
Definition state_machine.h:59
void SOPC_StaMac_SetUserContext(SOPC_StaMac_Machine *pSM, uintptr_t userContext)
Overwrite the user content in the given state machine.
SOPC_StaMac_RequestScope
Definition state_machine.h:114
@ SOPC_REQUEST_SCOPE_STATE_MACHINE
Definition state_machine.h:115
@ SOPC_REQUEST_SCOPE_APPLICATION
Definition state_machine.h:116
@ SOPC_REQUEST_SCOPE_DISCOVERY
Definition state_machine.h:118
bool SOPC_StaMac_HasSubscription(SOPC_StaMac_Machine *pSM)
Returns a bool whether the machine has an active subscription or not.
bool SOPC_StaMac_PopDeleteMonItByAppCtx(SOPC_StaMac_Machine *pSM, SOPC_DeleteMonitoredItems_Ctx *pAppCtx)
Returns whether the machine has deleted the MonitoredItems with the given appCtx or not....
SOPC_StaMac_RequestType
Definition state_machine.h:104
@ SOPC_REQUEST_TYPE_PUBLISH
Definition state_machine.h:107
@ SOPC_REQUEST_TYPE_USER
Definition state_machine.h:106
@ SOPC_REQUEST_TYPE_GET_ENDPOINTS
Definition state_machine.h:109
@ SOPC_REQUEST_TYPE_UNKNOWN
Definition state_machine.h:105
@ SOPC_REQUEST_TYPE_SUBSCRIPTION
Definition state_machine.h:108
SOPC_ReturnStatus SOPC_StaMac_StartSession(SOPC_StaMac_Machine *pSM)
Creates a session asynchronously.
void SOPC_StaMac_Delete(SOPC_StaMac_Machine **ppSM)
Deletes and deallocate the machine.
bool SOPC_StaMac_IsConnectable(SOPC_StaMac_Machine *pSM)
Returns a bool whether the machine is configured and ready for a new SecureChannel.
uint32_t SOPC_StaMac_HasSubscriptionId(SOPC_StaMac_Machine *pSM)
Returns subscription Id whether the machine has an active subscription or not (id = 0).
SOPC_ReturnStatus SOPC_StaMac_DeleteSubscription(SOPC_StaMac_Machine *pSM)
Delete subscription associated to the given state machine.
struct SOPC_DeleteMonitoredItems_Ctx SOPC_DeleteMonitoredItems_Ctx
Context structure to be provided when using SOPC_StaMac_NewDeleteMonitoredItems.
enum _SOPC_StaMac_ApplicativeEvent SOPC_StaMac_ApplicativeEvent
The event passed to the connection SOPC_LibSub_EventCbk. Either an error or a valid response notifica...
SOPC_ReturnStatus SOPC_StaMac_NewCreateMonitoredItems(SOPC_StaMac_Machine *pSM, OpcUa_CreateMonitoredItemsRequest *req, const uintptr_t *userAppCtxArray, SOPC_CreateMonitoredItems_Ctx *pAppCtx)
Creates new monitored items for the state machine subscription using the request (new API)
SOPC_ReturnStatus SOPC_StaMac_GetSubscriptionRevisedParams(SOPC_StaMac_Machine *pSM, double *revisedPublishingInterval, uint32_t *revisedLifetimeCount, uint32_t *revisedMaxKeepAliveCount)
void SOPC_StaMacNotification_Fct(uintptr_t subscriptionAppCtx, SOPC_StatusCode status, SOPC_EncodeableType *notificationType, uint32_t nbNotifElts, const void *notification, uintptr_t *monitoredItemCtxArray)
Type of callback called on Subscription Notification.
Definition state_machine.h:271
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().
bool SOPC_StaMac_IsConnected(SOPC_StaMac_Machine *pSM)
Returns a bool whether the machine is in a connected state or not.
SOPC_StaMac_State
Definition state_machine.h:90
@ stActivated
Definition state_machine.h:94
@ stCreatingSubscr
Definition state_machine.h:95
@ stActivating
Definition state_machine.h:93
@ stDeletingMonIt
Definition state_machine.h:97
@ stInit
Definition state_machine.h:92
@ stClosing
Definition state_machine.h:99
@ stDeletingSubscr
Definition state_machine.h:98
@ stError
Definition state_machine.h:91
@ stCreatingMonIt
Definition state_machine.h:96
SOPC_ReturnStatus SOPC_StaMac_NewDeleteMonitoredItems(SOPC_StaMac_Machine *pSM, OpcUa_DeleteMonitoredItemsRequest *req, SOPC_DeleteMonitoredItems_Ctx *outAppCtx)
Deletes created monitored items for the state machine subscription using the request (new API)
void SOPC_StaMac_EventCbk(uint32_t c_id, SOPC_StaMac_ApplicativeEvent event, SOPC_StatusCode status, const void *response, uintptr_t responseContext)
Callback for generic responses to a call to SOPC_StaMac_SendRequest().
Definition state_machine.h:82
Bytes buffer structure.
Definition sopc_buffer.h:38
Context structure to be provided when using SOPC_StaMac_NewCreateMonitoredItems.
Definition state_machine.h:246
uintptr_t outCtxId
Definition state_machine.h:249
OpcUa_CreateMonitoredItemsResponse * Results
Definition state_machine.h:247
OpcUa_CreateMonitoredItemsRequest * req
Definition state_machine.h:251
Context structure to be provided when using SOPC_StaMac_NewDeleteMonitoredItems.
Definition state_machine.h:313
OpcUa_DeleteMonitoredItemsResponse * Results
Definition state_machine.h:314
OpcUa_DeleteMonitoredItemsRequest * req
Definition state_machine.h:318
uintptr_t outCtxId
Definition state_machine.h:316
Encodeable object type structure definition. It provides all the services functions associated with t...
Definition sopc_encodeabletype.h:177
Definition state_machine.h:126
SOPC_StaMac_RequestType requestType
Definition state_machine.h:130
SOPC_StaMac_Machine * pSM
Definition state_machine.h:127
SOPC_StaMac_RequestScope requestScope
Definition state_machine.h:129
uintptr_t appCtx
Definition state_machine.h:128
Definition sopc_types.h:5562
Definition sopc_types.h:5586
Definition sopc_types.h:5868
Definition sopc_types.h:5818
Definition sopc_types.h:5841