#include <uaserver_config.h>
#include <opcua_platformdefs.h>
#include <opcua_statuscodes.h>
#include <uabase_p_atomic.h>
#include <uaserver_basenode.h>
#include <uaserver_utilities.h>
#include <uaserver_call.h>
#include "uaprovider_demo_hooks.h"
#include "uaprovider_demo_types_1.h"
#include "uaprovider_demo_boilertype_methods.h"
#include "uaprovider_demo_methods_1.h"
#include "uaprovider_demo_methods_1.h"
#include "uaprovider_demo_identifiers_1.h"
OPCUA_BEGIN_EXTERN_C
#define OPCUA_ARRAY_FROM_VARIANT(type, a_pVariant, a_pNoOfValues, a_ppValues) \
{ \
OpcUa_Int32 iArrayPos; \
OpcUa_##type *pValue; \
OpcUa_##type *pValues; \
\
OpcUa_ReturnErrorIfArgumentNull(a_pVariant); \
OpcUa_ReturnErrorIfArgumentNull(a_pNoOfValues); \
OpcUa_ReturnErrorIfArgumentNull(a_ppValues); \
\
if (!a_pVariant || a_pVariant->ArrayType != OpcUa_VariantArrayType_Array || a_pVariant->Datatype != OpcUaType_ExtensionObject \
|| (a_pVariant->Value.Array.Length && !a_pVariant->Value.Array.Value.ExtensionObjectArray) ) \
{ \
OpcUa_GotoErrorWithStatus(OpcUa_BadInvalidArgument); \
} \
for (iArrayPos=0; iArrayPos<a_pVariant->Value.Array.Length; iArrayPos++) \
{ \
if (a_pVariant->Value.Array.Value.ExtensionObjectArray[iArrayPos].Encoding != OpcUa_ExtensionObjectEncoding_EncodeableObject \
|| !a_pVariant->Value.Array.Value.ExtensionObjectArray[iArrayPos].Body.EncodeableObject.Type \
|| a_pVariant->Value.Array.Value.ExtensionObjectArray[iArrayPos].Body.EncodeableObject.Type->TypeId != OpcUaId_##type) \
{ \
OpcUa_GotoErrorWithStatus(OpcUa_BadInvalidArgument); \
} \
} \
\
*a_pNoOfValues = 0; \
if (a_pVariant->Value.Array.Length > 0) \
{ \
pValues = (OpcUa_##type*) OpcUa_Alloc(a_pVariant->Value.Array.Length * sizeof(OpcUa_##type)); \
OpcUa_GotoErrorIfAllocFailed(pValues); \
OpcUa_MemSet(pValues, 0, a_pVariant->Value.Array.Length * sizeof(OpcUa_##type)); \
for (iArrayPos=0; iArrayPos<a_pVariant->Value.Array.Length; iArrayPos++) \
{ \
pValue = (OpcUa_##type*) a_pVariant->Value.Array.Value.ExtensionObjectArray[iArrayPos].Body.EncodeableObject.Object; \
pValues[iArrayPos] = *pValue; \
} \
*a_ppValues = pValues; \
*a_pNoOfValues = a_pVariant->Value.Array.Length; \
} \
}
#define OPCUA_ARRAY_TO_VARIANT(type, a_pNoOfValues, a_ppValues, a_pVariant) \
{ \
OpcUa_Int32 iArrayPos; \
OpcUa_##type *pValue; \
\
OpcUa_ReturnErrorIfArgumentNull(a_pNoOfValues); \
OpcUa_ReturnErrorIfArgumentNull(a_ppValues); \
OpcUa_ReturnErrorIfArgumentNull(a_pVariant); \
\
OpcUa_Variant_Initialize(a_pVariant); \
\
if (*a_pNoOfValues > 0) \
{ \
OpcUa_GotoErrorIfArgumentNull(*a_ppValues); \
\
a_pVariant->Value.Array.Value.ExtensionObjectArray = (OpcUa_ExtensionObject*) OpcUa_Alloc(*a_pNoOfValues * sizeof (OpcUa_ExtensionObject)); \
OpcUa_GotoErrorIfAllocFailed(a_pVariant->Value.Array.Value.ExtensionObjectArray); \
a_pVariant->Datatype = OpcUaType_ExtensionObject; \
a_pVariant->ArrayType = OpcUa_VariantArrayType_Array; \
OpcUa_MemSet(a_pVariant->Value.Array.Value.ExtensionObjectArray, 0, *a_pNoOfValues * sizeof (OpcUa_ExtensionObject)); \
a_pVariant->Value.Array.Length = *a_pNoOfValues; \
for (iArrayPos=0; iArrayPos<*a_pNoOfValues; iArrayPos++) \
{ \
uStatus = OpcUa_EncodeableObject_CreateExtension(&OpcUa_##type##_EncodeableType, &a_pVariant->Value.Array.Value.ExtensionObjectArray[iArrayPos], (OpcUa_Void**)&pValue); \
if (OpcUa_IsBad(uStatus)) \
{ \
OpcUa_Variant_Clear(a_pVariant); \
OpcUa_GotoError; \
} \
OpcUa_MemCpy(pValue, sizeof (OpcUa_##type), (*a_ppValues)+iArrayPos, sizeof(OpcUa_##type)); \
} \
OpcUa_Free(*a_ppValues); \
*a_pNoOfValues = 0; \
*a_ppValues = OpcUa_Null; \
} \
else \
{ \
a_pVariant->Datatype = OpcUaType_ExtensionObject; \
a_pVariant->ArrayType = OpcUa_VariantArrayType_Array; \
} \
}
{
OpcUa_Double SetPoint;
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_BoilerType_Heat");
if (a_pRequest->NoOfInputArguments == 1)
{
a_pResult->NoOfInputArgumentResults = 1;
if (pArgument0->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument0->
Datatype != OpcUaType_Double)
{
uStatus = OpcUa_BadInvalidArgument;
}
OpcUa_GotoErrorIfBad(uStatus);
SetPoint = pArgument0->
Value.Double;
}
else if (a_pRequest->NoOfInputArguments < 1)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_Double SetPoint;
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_BoilerType_Fill");
if (a_pRequest->NoOfInputArguments == 1)
{
a_pResult->NoOfInputArgumentResults = 1;
if (pArgument0->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument0->
Datatype != OpcUaType_Double)
{
uStatus = OpcUa_BadInvalidArgument;
}
OpcUa_GotoErrorIfBad(uStatus);
SetPoint = pArgument0->
Value.Double;
}
else if (a_pRequest->NoOfInputArguments < 1)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_CTT_References_Has3ForwardReferences2_Method1");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
a_pResult->
StatusCode = UaProvider_Demo_Demo_CTT_References_Has3ForwardReferences2_Method1(a_pCallContext, &a_pRequest->
ObjectId, &a_pResult->
StatusCode);
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_CTT_References_Has3ForwardReferences2_Method2");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
a_pResult->
StatusCode = UaProvider_Demo_Demo_CTT_References_Has3ForwardReferences2_Method2(a_pCallContext, &a_pRequest->
ObjectId, &a_pResult->
StatusCode);
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_CTT_References_Has3ForwardReferences2_Method3");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
a_pResult->
StatusCode = UaProvider_Demo_Demo_CTT_References_Has3ForwardReferences2_Method3(a_pCallContext, &a_pRequest->
ObjectId, &a_pResult->
StatusCode);
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_CTT_References_Has3ForwardReferences5_ReferencedNode3");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
a_pResult->
StatusCode = UaProvider_Demo_Demo_CTT_References_Has3ForwardReferences5_ReferencedNode3(a_pCallContext, &a_pRequest->
ObjectId, &a_pResult->
StatusCode);
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_UInt32 Summand1;
OpcUa_UInt32 Summand2;
OpcUa_Int32 i;
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_CTT_Methods_MethodIO");
if (a_pRequest->NoOfInputArguments == 2)
{
OpcUa_UInt32 Sum;
a_pResult->NoOfInputArgumentResults = 2;
if (pArgument0->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument0->
Datatype != OpcUaType_UInt32)
{
uStatus = OpcUa_BadInvalidArgument;
}
if (pArgument1->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument1->
Datatype != OpcUaType_UInt32)
{
uStatus = OpcUa_BadInvalidArgument;
}
OpcUa_GotoErrorIfBad(uStatus);
OpcUa_UInt32_Initialize(&Sum);
Summand1 = pArgument0->
Value.UInt32;
Summand2 = pArgument1->
Value.UInt32;
a_pResult->
StatusCode = UaProvider_Demo_Demo_CTT_Methods_MethodIO(a_pCallContext, &a_pRequest->
ObjectId, &a_pResult->
StatusCode, Summand1, Summand2, &Sum);
{
a_pResult->NoOfOutputArguments = 1;
}
}
else if (a_pRequest->NoOfInputArguments < 2)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
{
for (i = 0; i < a_pResult->NoOfOutputArguments; i++)
{
}
a_pResult->NoOfOutputArguments = 0;
}
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_CTT_NodeClasses_Method");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_DynamicNodes_CreateDynamicNode");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_DynamicNodes_DeleteDynamicNode");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_History_StartLogging");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_History_StopLogging");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_UInt32 AnimationSpeed;
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_Images_Dynamic_SetAnimationSpeed");
if (a_pRequest->NoOfInputArguments == 1)
{
a_pResult->NoOfInputArgumentResults = 1;
if (pArgument0->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument0->
Datatype != OpcUaType_UInt32)
{
uStatus = OpcUa_BadInvalidArgument;
}
OpcUa_GotoErrorIfBad(uStatus);
AnimationSpeed = pArgument0->
Value.UInt32;
a_pResult->
StatusCode = UaProvider_Demo_Demo_Images_Dynamic_SetAnimationSpeed(a_pCallContext, &a_pRequest->
ObjectId, &a_pResult->
StatusCode, AnimationSpeed);
}
else if (a_pRequest->NoOfInputArguments < 1)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_Method_DoSomethingAfter10s");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
Demo_HeaterStatus HeaterStatus;
Demo_Priority Priority;
OpcUa_Int32 i;
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_Method_EnumTest");
if (a_pRequest->NoOfInputArguments == 2)
{
Demo_HeaterStatus RetHeaterStatus;
Demo_Priority RetPriority;
a_pResult->NoOfInputArgumentResults = 2;
if (pArgument0->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument0->
Datatype != OpcUaType_Int32)
{
uStatus = OpcUa_BadInvalidArgument;
}
if (pArgument1->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument1->
Datatype != OpcUaType_Int32)
{
uStatus = OpcUa_BadInvalidArgument;
}
OpcUa_GotoErrorIfBad(uStatus);
Demo_HeaterStatus_Initialize(&RetHeaterStatus);
Demo_Priority_Initialize(&RetPriority);
HeaterStatus = pArgument0->
Value.Int32;
Priority = pArgument1->
Value.Int32;
a_pResult->
StatusCode = UaProvider_Demo_Demo_Method_EnumTest(a_pCallContext, &a_pRequest->
ObjectId, &a_pResult->
StatusCode, HeaterStatus, Priority, &RetHeaterStatus, &RetPriority);
{
a_pResult->NoOfOutputArguments = 2;
}
}
else if (a_pRequest->NoOfInputArguments < 2)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
{
for (i = 0; i < a_pResult->NoOfOutputArguments; i++)
{
}
a_pResult->NoOfOutputArguments = 0;
}
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_CTT_Methods_MethodNoArgs");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_Double a;
OpcUa_Double b;
OpcUa_Int32 i;
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_Method_Multiply");
if (a_pRequest->NoOfInputArguments == 2)
{
OpcUa_Double result;
a_pResult->NoOfInputArgumentResults = 2;
if (pArgument0->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument0->
Datatype != OpcUaType_Double)
{
uStatus = OpcUa_BadInvalidArgument;
}
if (pArgument1->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument1->
Datatype != OpcUaType_Double)
{
uStatus = OpcUa_BadInvalidArgument;
}
OpcUa_GotoErrorIfBad(uStatus);
OpcUa_Double_Initialize(&result);
a = pArgument0->
Value.Double;
b = pArgument1->
Value.Double;
{
a_pResult->NoOfOutputArguments = 1;
}
}
else if (a_pRequest->NoOfInputArguments < 2)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
{
for (i = 0; i < a_pResult->NoOfOutputArguments; i++)
{
}
a_pResult->NoOfOutputArguments = 0;
}
OpcUa_FinishErrorHandling;
}
{
Demo_Vector v1;
Demo_Vector v2;
OpcUa_Int32 i;
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_Method_VectorAdd");
Demo_Vector_Initialize(&v1);
Demo_Vector_Initialize(&v2);
if (a_pRequest->NoOfInputArguments == 2)
{
Demo_Vector result;
#ifdef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
Demo_Vector *presult;
#endif
a_pResult->NoOfInputArgumentResults = 2;
if (pArgument0->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument0->
Datatype != OpcUaType_ExtensionObject
|| !pArgument0->
Value.ExtensionObject
#ifdef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
|| !pArgument0->
Value.ExtensionObject->Body.EncodeableObject.Type
|| pArgument0->
Value.ExtensionObject->Body.EncodeableObject.Type->TypeId != Demo_VectorId)
#else
|| pArgument0->
Value.ExtensionObject->TypeId.NodeId.NamespaceIndex != g_UaProviderDemo_uNamespaceIndex1
|| pArgument0->
Value.ExtensionObject->TypeId.NodeId.Identifier.Numeric != Demo_Vector_Encoding_DefaultBinary)
#endif
{
uStatus = OpcUa_BadInvalidArgument;
}
if (pArgument1->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument1->
Datatype != OpcUaType_ExtensionObject
|| !pArgument1->
Value.ExtensionObject
#ifdef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
|| !pArgument1->
Value.ExtensionObject->Body.EncodeableObject.Type
|| pArgument1->
Value.ExtensionObject->Body.EncodeableObject.Type->TypeId != Demo_VectorId)
#else
|| pArgument1->
Value.ExtensionObject->TypeId.NodeId.NamespaceIndex != g_UaProviderDemo_uNamespaceIndex1
|| pArgument1->
Value.ExtensionObject->TypeId.NodeId.Identifier.Numeric != Demo_Vector_Encoding_DefaultBinary)
#endif
{
uStatus = OpcUa_BadInvalidArgument;
}
OpcUa_GotoErrorIfBad(uStatus);
Demo_Vector_Initialize(&result);
#ifdef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
v1 = *((Demo_Vector*)pArgument0->
Value.ExtensionObject->Body.EncodeableObject.Object);
#else
&Demo_Vector_EncodeableType,
pArgument0->
Value.ExtensionObject,
&v1);
OpcUa_GotoErrorIfBad(uStatus);
#endif
#ifdef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
v2 = *((Demo_Vector*)pArgument1->
Value.ExtensionObject->Body.EncodeableObject.Object);
#else
&Demo_Vector_EncodeableType,
pArgument1->
Value.ExtensionObject,
&v2);
OpcUa_GotoErrorIfBad(uStatus);
#endif
a_pResult->
StatusCode = UaProvider_Demo_Demo_Method_VectorAdd(a_pCallContext, &a_pRequest->
ObjectId, &a_pResult->
StatusCode, &v1, &v2, &result);
{
a_pResult->NoOfOutputArguments = 1;
#ifdef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
OpcUa_GotoErrorIfBad(uStatus);
*presult = result;
Demo_Vector_Initialize(&result);
#else
&Demo_Vector_EncodeableType,
g_UaProviderDemo_uNamespaceIndex1,
(OpcUa_Void*)&result,
OpcUa_GotoErrorIfBad(uStatus);
Demo_Vector_Clear(&result);
#endif
#ifndef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
Demo_Vector_Clear(&v1);
#endif
#ifndef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
Demo_Vector_Clear(&v2);
#endif
}
}
else if (a_pRequest->NoOfInputArguments < 2)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
#ifndef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
Demo_Vector_Clear(&v1);
#endif
#ifndef UAPROVIDER_DEMO_STACK_STRUCTURE_SERIALIZATION
Demo_Vector_Clear(&v2);
#endif
{
for (i = 0; i < a_pResult->NoOfOutputArguments; i++)
{
}
a_pResult->NoOfOutputArguments = 0;
}
OpcUa_FinishErrorHandling;
}
{
OpcUa_UInt32 speed;
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_SetSimulationSpeed");
if (a_pRequest->NoOfInputArguments == 1)
{
a_pResult->NoOfInputArgumentResults = 1;
if (pArgument0->
ArrayType != OpcUa_VariantArrayType_Scalar
|| pArgument0->
Datatype != OpcUaType_UInt32)
{
uStatus = OpcUa_BadInvalidArgument;
}
OpcUa_GotoErrorIfBad(uStatus);
speed = pArgument0->
Value.UInt32;
}
else if (a_pRequest->NoOfInputArguments < 1)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_StartSimulation");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_Demo_Call_Demo_StopSimulation");
if (a_pRequest->NoOfInputArguments <= 0)
{
a_pResult->NoOfInputArgumentResults = 0;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
#if UASERVER_SUPPORT_EVENTS
{
if (a_pRequest->NoOfInputArguments == 2)
{
a_pResult->NoOfInputArgumentResults = 2;
{
}
{
}
{
{
}
}
{
a_pResult->
StatusCode = OpcUa_BadConditionBranchAlreadyAcked;
if (pAckedState != OpcUa_Null
&& pAckedState->
Datatype == OpcUaType_Boolean
&& pAckedState->
ArrayType == OpcUa_VariantArrayType_Scalar
&& pAckedState->
Value.Boolean == OpcUa_False)
{
}
}
{
OpcUa_Variant_Initialize(&value);
OpcUa_ReturnErrorIfAllocFailed(value.
Value.LocalizedText);
value.
Datatype = OpcUaType_LocalizedText;
OpcUa_LocalizedText_Initialize(value.
Value.LocalizedText);
OpcUa_String_StrnCat(&value.
Value.LocalizedText->Text, OpcUa_String_FromCString(
"Acknowledged"), OPCUA_STRING_LENDONTCARE);
OpcUa_Variant_Clear(&value);
value.
Value.Boolean = OpcUa_True;
OpcUa_Variant_Clear(&value);
value.
Value.DateTime = OpcUa_DateTime_UtcNow();
OpcUa_Variant_Clear(&value);
OpcUa_ReturnErrorIfAllocFailed(value.
Value.LocalizedText);
value.
Datatype = OpcUaType_LocalizedText;
OpcUa_LocalizedText_Initialize(value.
Value.LocalizedText);
OpcUa_Variant_Clear(&value);
value.
Value.DateTime = OpcUa_DateTime_UtcNow();
OpcUa_Variant_Clear(&value);
if (pSourceNode != OpcUa_Null)
{
OpcUa_BaseNode *pBaseNode;
if (pBaseNode != OpcUa_Null)
{
}
}
}
}
else if (a_pRequest->NoOfInputArguments < 2)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
return OpcUa_Good;
}
{
if (a_pRequest->NoOfInputArguments == 2)
{
a_pResult->NoOfInputArgumentResults = 2;
{
}
{
}
{
{
}
}
{
a_pResult->
StatusCode = OpcUa_BadConditionBranchAlreadyConfirmed;
if (pAckedState != OpcUa_Null
&& pAckedState->
Datatype == OpcUaType_Boolean
&& pAckedState->
ArrayType == OpcUa_VariantArrayType_Scalar
&& pAckedState->
Value.Boolean == OpcUa_False)
{
}
}
{
OpcUa_Variant_Initialize(&value);
OpcUa_ReturnErrorIfAllocFailed(value.
Value.LocalizedText);
value.
Datatype = OpcUaType_LocalizedText;
OpcUa_LocalizedText_Initialize(value.
Value.LocalizedText);
OpcUa_String_StrnCat(&value.
Value.LocalizedText->Text, OpcUa_String_FromCString(
"Confirmed"), OPCUA_STRING_LENDONTCARE);
OpcUa_Variant_Clear(&value);
value.
Value.Boolean = OpcUa_True;
OpcUa_Variant_Clear(&value);
value.
Value.DateTime = OpcUa_DateTime_UtcNow();
OpcUa_Variant_Clear(&value);
OpcUa_ReturnErrorIfAllocFailed(value.
Value.LocalizedText);
value.
Datatype = OpcUaType_LocalizedText;
OpcUa_LocalizedText_Initialize(value.
Value.LocalizedText);
OpcUa_Variant_Clear(&value);
value.
Value.DateTime = OpcUa_DateTime_UtcNow();
OpcUa_Variant_Clear(&value);
if (pSourceNode != OpcUa_Null)
{
OpcUa_BaseNode *pBaseNode;
if (pBaseNode != OpcUa_Null)
{
}
}
}
}
else if (a_pRequest->NoOfInputArguments < 2)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
return OpcUa_Good;
}
{
if (a_pRequest->NoOfInputArguments == 2)
{
a_pResult->NoOfInputArgumentResults = 2;
{
}
{
}
{
{
}
}
{
OpcUa_Variant_Initialize(&value);
OpcUa_ReturnErrorIfAllocFailed(value.
Value.LocalizedText);
value.
Datatype = OpcUaType_LocalizedText;
OpcUa_LocalizedText_Initialize(value.
Value.LocalizedText);
OpcUa_Variant_Clear(&value);
value.
Value.DateTime = OpcUa_DateTime_UtcNow();
OpcUa_Variant_Clear(&value);
if (pSourceNode != OpcUa_Null)
{
OpcUa_BaseNode *pBaseNode;
if (pBaseNode != OpcUa_Null)
{
}
}
}
}
else if (a_pRequest->NoOfInputArguments < 2)
{
a_pResult->
StatusCode = OpcUa_BadArgumentsMissing;
}
else
{
a_pResult->
StatusCode = OpcUa_BadTooManyArguments;
}
return OpcUa_Good;
}
#endif
{
OpcUa_Int32 i;
OpcUa_BaseNode *pMethodNode = OpcUa_Null;
OpcUa_BaseNode *pObjectNode = OpcUa_Null;
OpcUa_ReturnErrorIfArgumentNull(a_pCallContext);
for (i = 0; i < pRequest->NoOfMethodsToCall; i++)
{
{
if (pMethodNode == OpcUa_Null || pObjectNode == OpcUa_Null)
{
continue;
}
#if UASERVER_SUPPORT_AUTHORIZATION
{
continue;
}
#else
OpcUa_Method_GetUserExecutable(pMethodNode) == OpcUa_False)
{
continue;
}
#endif
{
switch (pMethodId->Identifier.Numeric)
{
case Demo_BoilerType_HeatId:
UaProvider_Demo_Call_BoilerType_Heat(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
break;
case Demo_BoilerType_FillId:
UaProvider_Demo_Call_BoilerType_Fill(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
break;
case Demo_Objects_Demo_CTT_References_Has3ForwardReferences2_Method1:
UaProvider_Demo_Call_Demo_CTT_References_Has3ForwardReferences2_Method1(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
break;
case Demo_Objects_Demo_CTT_References_Has3ForwardReferences2_Method2:
UaProvider_Demo_Call_Demo_CTT_References_Has3ForwardReferences2_Method2(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
break;
case Demo_Objects_Demo_CTT_References_Has3ForwardReferences2_Method3:
UaProvider_Demo_Call_Demo_CTT_References_Has3ForwardReferences2_Method3(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
break;
case Demo_Objects_Demo_CTT_References_Has3ForwardReferences5_ReferencedNode3:
UaProvider_Demo_Call_Demo_CTT_References_Has3ForwardReferences5_ReferencedNode3(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
break;
default:
break;
}
}
{
if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_BoilerDemo_Boiler1_Heat) == 0)
{
UaProvider_Demo_Call_BoilerType_Heat(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_BoilerDemo_Boiler1_Fill) == 0)
{
UaProvider_Demo_Call_BoilerType_Fill(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_CTT_Methods_MethodIO) == 0)
{
UaProvider_Demo_Call_Demo_CTT_Methods_MethodIO(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_CTT_NodeClasses_Method) == 0)
{
UaProvider_Demo_Call_Demo_CTT_NodeClasses_Method(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_DynamicNodes_CreateDynamicNode) == 0)
{
UaProvider_Demo_Call_Demo_DynamicNodes_CreateDynamicNode(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_DynamicNodes_DeleteDynamicNode) == 0)
{
UaProvider_Demo_Call_Demo_DynamicNodes_DeleteDynamicNode(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_History_StartLogging) == 0)
{
UaProvider_Demo_Call_Demo_History_StartLogging(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_History_StopLogging) == 0)
{
UaProvider_Demo_Call_Demo_History_StopLogging(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_Images_Dynamic_SetAnimationSpeed) == 0)
{
UaProvider_Demo_Call_Demo_Images_Dynamic_SetAnimationSpeed(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_Method_DoSomethingAfter10s) == 0)
{
UaProvider_Demo_Call_Demo_Method_DoSomethingAfter10s(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_Method_EnumTest) == 0)
{
UaProvider_Demo_Call_Demo_Method_EnumTest(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_CTT_Methods_MethodNoArgs) == 0)
{
UaProvider_Demo_Call_Demo_CTT_Methods_MethodNoArgs(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_Method_Multiply) == 0)
{
UaProvider_Demo_Call_Demo_Method_Multiply(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_Method_VectorAdd) == 0)
{
UaProvider_Demo_Call_Demo_Method_VectorAdd(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_SetSimulationSpeed) == 0)
{
UaProvider_Demo_Call_Demo_SetSimulationSpeed(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_StartSimulation) == 0)
{
UaProvider_Demo_Call_Demo_StartSimulation(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
else if (OpcUa_StrCmpA(OpcUa_String_GetRawString(&pMethodId->Identifier.String), Demo_Objects_Demo_StopSimulation) == 0)
{
UaProvider_Demo_Call_Demo_StopSimulation(a_pCallContext, &pRequest->
MethodsToCall[i], &pResponse->
Results[i]);
}
}
}
#if UASERVER_SUPPORT_EVENTS
{
{
case OpcUaId_AcknowledgeableConditionType_Acknowledge:
{
if (pEvent != OpcUa_Null)
{
}
break;
}
case OpcUaId_AcknowledgeableConditionType_Confirm:
{
if (pEvent != OpcUa_Null)
{
}
break;
}
case OpcUaId_ConditionType_AddComment:
{
if (pEvent != OpcUa_Null)
{
}
break;
}
default:
break;
}
}
#endif
}
return OpcUa_Good;
}
OPCUA_END_EXTERN_C