#include "uaprovider_oversampling.h"
#include <opcua_proxystub.h>
#include <opcua_errorhandling.h>
#include <opcua_identifiers.h>
#include <opcua_string.h>
#include <opcua_pki.h>
#include <opcua_trace.h>
#include <uabase_p_utilities.h>
#include "uaprovider_oversampling_helper.h"
#include "uaprovider_oversampling_nodes_1.h"
OpcUa_UInt16 g_UaProviderOverSampling_uNamespaceIndex1 = OpcUa_UInt16_Max;
#if HAVE_ENCODING_BINARY
#define UAPROVIDER_OVERSAMPLING_NUMBEROFNODES1 3
#define UAPROVIDER_OVERSAMPLING_NUMBEROFREFERENCES1 6
#else
#define UAPROVIDER_OVERSAMPLING_NUMBEROFNODES1 3
#define UAPROVIDER_OVERSAMPLING_NUMBEROFREFERENCES1 6
#endif
#define UAPROVIDER_OVERSAMPLING_NUMBEROFMETHODS1 0
static OpcUa_UInt32 g_UaProvider_OverSampling_HashTableSize = 1009;
#if UASERVER_SERVICES_HISTORYREAD
#endif
#if UASERVER_SERVICES_CALL
#endif
IFMETHODIMP(UaProvider_OverSampling_BeforeInitialize)(OpcUa_UInt32 *pHashTableSize);
IFMETHODIMP(UaProvider_OverSampling_AfterInitialize)();
IFMETHODIMP(UaProvider_OverSampling_BeforeCleanup)();
IFMETHODIMP(UaProvider_OverSampling_AfterCleanup)();
IFMETHODIMP(UaProvider_OverSampling_Cleanup)()
{
printf("Cleanup OverSampling Provider ...\n");
UaProvider_OverSampling_BeforeCleanup();
UaProvider_OverSampling_Subscription_Cleanup();
UaProvider_OverSampling_AfterCleanup();
printf("Cleanup OverSampling Provider DONE!\n");
return OpcUa_Good;
}
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_OverSampling_CreateAddressSpace");
uStatus = UaProvider_OverSampling_CreateAddressSpace1();
OpcUa_GotoErrorIfBad(uStatus);
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
OpcUa_FinishErrorHandling;
}
IFMETHODIMP(UaProvider_OverSampling_Initialize)(
{
OpcUa_InitializeStatus(OpcUa_Module_Server, "UaProvider_OverSampling_Initialize");
printf("Initialize OverSampling Provider ...\n");
g_pOverSamplingProvider = a_pProvider;
g_pOverSamplingProviderInterface = a_pProviderInterface;
a_pProviderInterface->Cleanup = UaProvider_OverSampling_Cleanup;
a_pProviderInterface->ReadAsync = UaProvider_OverSampling_ReadAsync;
a_pProviderInterface->WriteAsync = UaProvider_OverSampling_WriteAsync;
#if UASERVER_SERVICES_HISTORYREAD
a_pProviderInterface->HistoryReadRawModifiedAsync = UaProvider_OverSampling_HistoryReadRawModifiedAsync;
#endif
a_pProviderInterface->BrowseAsync = UaProvider_OverSampling_BrowseAsync;
a_pProviderInterface->TranslateAsync = UaProvider_OverSampling_TranslateAsync;
a_pProviderInterface->RegisterNodesAsync = UaProvider_OverSampling_RegisterNodesAsync;
a_pProviderInterface->UnregisterNodesAsync = UaProvider_OverSampling_UnregisterNodesAsync;
#if UASERVER_SERVICES_CALL
a_pProviderInterface->CallAsync = UaProvider_OverSampling_CallAsync;
#endif
a_pProviderInterface->AddItem = UaProvider_OverSampling_AddItem;
a_pProviderInterface->RemoveItem = UaProvider_OverSampling_RemoveItem;
a_pProviderInterface->Subscribe = UaProvider_OverSampling_Subscribe;
uStatus = UaProvider_OverSampling_BeforeInitialize(&g_UaProvider_OverSampling_HashTableSize);
OpcUa_GotoErrorIfBad(uStatus);
&g_UaProviderOverSampling_uNamespaceIndex1,
"http://www.unifiedautomation.com/OverSampling",
g_UaProvider_OverSampling_HashTableSize);
OpcUa_GotoErrorIfBad(uStatus);
uStatus = UaProvider_OverSampling_CreateAddressSpace();
OpcUa_GotoErrorIfBad(uStatus);
uStatus = UaProvider_OverSampling_Subscription_Initialize();
OpcUa_GotoErrorIfBad(uStatus);
uStatus = UaProvider_OverSampling_AfterInitialize();
OpcUa_GotoErrorIfBad(uStatus);
printf("OverSampling Provider initialized!\n");
printf(
" %d Nodes created\n", a_pProvider->
AddressSpace.uNumNodes);
printf(" NS%d:\n", g_UaProviderOverSampling_uNamespaceIndex1);
printf(" %d static nodes created\n", UAPROVIDER_OVERSAMPLING_NUMBEROFNODES1);
printf(" %d static references created\n", UAPROVIDER_OVERSAMPLING_NUMBEROFREFERENCES1);
printf(" %d static methods created\n", UAPROVIDER_OVERSAMPLING_NUMBEROFMETHODS1);
OpcUa_ReturnStatusCode;
OpcUa_BeginErrorHandling;
printf("Initializing OverSampling Provider failed!\n");
UaProvider_OverSampling_Subscription_Cleanup();
UaServer_Providers_FreeProvider(a_pProvider);
OpcUa_FinishErrorHandling;
}
#ifdef BUILD_SHARED_LIBS
{
return UaProvider_OverSampling_Initialize(pProvider, pProviderInterface);
}
#endif