#include <uaserver_config.h>
#include <pthread.h>
#include <errno.h>
#include <opcua_statuscodes.h>
#include <opcua_attributes.h>
#include <uabase_p_atomic.h>
#include <uaserver_basenode.h>
#include <uaserver_utilities.h>
#include <uaserver_read.h>
#include "uaprovider_oversampling_hooks.h"
#include "uaprovider_oversampling_identifiers_1.h"
OpcUa_List g_ReadJobs;
pthread_t g_ReadThread;
pthread_attr_t g_ReadAttr;
pthread_mutex_t g_ReadMutex;
pthread_cond_t g_ReadCondition;
OPCUA_BEGIN_EXTERN_C
void* UaProvider_OverSampling_ReadThread(void *arg)
{
OpcUa_ReferenceParameter(arg);
while (1)
{
int i;
OpcUa_BaseNode *pNode;
pthread_mutex_lock(&g_ReadMutex);
while (!pReadCtx && g_bShutdown == OpcUa_False)
{
pthread_cond_wait(&g_ReadCondition, &g_ReadMutex);
}
pthread_mutex_unlock(&g_ReadMutex);
if (g_bShutdown)
{
while (pReadCtx)
{
}
break;
}
if (!pReadCtx)
continue;
for (i = 0; i < pReq->NoOfNodesToRead; i++)
{
pNodeId = &pNodeToRead->
NodeId;
if (pNodeId->
NamespaceIndex != g_UaProviderOverSampling_uNamespaceIndex1)
continue;
if (pNode)
{
&& OpcUa_BaseNode_GetType(pNode) == eVariable
{
continue;
}
if (pNodeToRead->
AttributeId == OpcUa_Attributes_Value)
{
#if UASERVER_SUPPORT_AUTHORIZATION
{
continue;
}
#endif
switch (pNodeToRead->
NodeId.Identifier.Numeric)
{
case OverSampling_Objects_S1KHz_Voltage:
case OverSampling_Objects_S1KHz_Current:
{
if (OpcUa_String_IsNull(&pNodeToRead->
IndexRange))
{
switch (pNodeToRead->
NodeId.Identifier.Numeric)
{
case OverSampling_Objects_S1KHz_Voltage:
{
}
{
}
break;
case OverSampling_Objects_S1KHz_Current:
{
}
{
}
break;
default:
break;
}
}
else
{
}
}
else
{
}
break;
default:
break;
}
}
else
{
}
}
else
{
}
}
}
return 0;
}
{
pthread_mutex_lock(&g_ReadMutex);
OpcUa_List_AddElementToEnd(&g_ReadJobs, a_pReadCtx);
pthread_cond_signal(&g_ReadCondition);
pthread_mutex_unlock(&g_ReadMutex);
return OpcUa_Good;
}
OPCUA_END_EXTERN_C