#include <uaserver_config.h>
#include <opcua_statuscodes.h>
#include <uabase_p_atomic.h>
#include <uaserver_basenode.h>
#include <uaserver_utilities.h>
#include <uaserver_historyread.h>
#include "uaprovider_demo_helper.h"
#include "uaprovider_demo_userdata.h"
#if HAVE_DATA_LOGGER
#include <uaserver_datalogger.h>
#endif
OPCUA_BEGIN_EXTERN_C
{
OpcUa_Int32 i;
OpcUa_BaseNode *pNode = OpcUa_Null;
OpcUa_ReturnErrorIfArgumentNull(a_pHistoryReadRawModifiedCtx);
for (i = 0; i < a_pHistoryReadRawModifiedCtx->NoOfNodesToRead; i++)
{
pNodeToRead = &a_pHistoryReadRawModifiedCtx->pNodesToRead[i];
pNodeId = &pNodeToRead->
NodeId;
{
if (pNode)
{
if (OpcUa_BaseNode_GetClass(pNode) != OpcUa_NodeClass_Variable ||
{
a_pHistoryReadRawModifiedCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotReadable;
continue;
}
#if UASERVER_SUPPORT_AUTHORIZATION
{
a_pHistoryReadRawModifiedCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotReadable;
continue;
}
#endif
#if HAVE_DATA_LOGGER && UASERVER_DATALOGGER_SUPPORT_DATA
{
if (pUserData && pUserData->UserDataType == UaProvider_Demo_UserDataType_HistoryDataLogger)
{
pUserData->Data.HistoryDataLogger.DataLogger,
pUserData->Data.HistoryDataLogger.DataLogItem,
a_pHistoryReadRawModifiedCtx->pHistoryReadRawModifiedDetails,
a_pHistoryReadRawModifiedCtx->TimestampsToReturn,
a_pHistoryReadRawModifiedCtx->ReleaseContinuationPoints,
&a_pHistoryReadRawModifiedCtx->pNodesToRead[i],
pHistoryResult,
a_pHistoryReadRawModifiedCtx->RequestHeader.TimeoutHint);
a_pHistoryReadRawModifiedCtx->pResponse->Results[i].StatusCode = ret;
}
else
{
a_pHistoryReadRawModifiedCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotReadable;
}
}
#endif
}
}
}
return OpcUa_Good;
}
{
OpcUa_Int32 i;
OpcUa_BaseNode *pNode = OpcUa_Null;
OpcUa_ReturnErrorIfArgumentNull(a_pHistoryReadEventCtx);
for (i = 0; i < a_pHistoryReadEventCtx->NoOfNodesToRead; i++)
{
pNodeToRead = &a_pHistoryReadEventCtx->pNodesToRead[i];
pNodeId = &pNodeToRead->
NodeId;
{
if (pNode)
{
if (OpcUa_BaseNode_GetClass(pNode) != OpcUa_NodeClass_Object ||
{
a_pHistoryReadEventCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotReadable;
continue;
}
#if UASERVER_SUPPORT_AUTHORIZATION
{
a_pHistoryReadEventCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotReadable;
continue;
}
#endif
}
}
}
return OpcUa_Good;
}
{
OpcUa_Int32 i;
OpcUa_BaseNode *pNode = OpcUa_Null;
OpcUa_ReturnErrorIfArgumentNull(a_pHistoryReadProcessedCtx);
for (i = 0; i < a_pHistoryReadProcessedCtx->NoOfNodesToRead; i++)
{
pNodeToRead = &a_pHistoryReadProcessedCtx->pNodesToRead[i];
pNodeId = &pNodeToRead->
NodeId;
{
if (pNode)
{
if (OpcUa_BaseNode_GetClass(pNode) != OpcUa_NodeClass_Variable ||
{
a_pHistoryReadProcessedCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotReadable;
continue;
}
#if UASERVER_SUPPORT_AUTHORIZATION
{
a_pHistoryReadProcessedCtx->pResponse->Results[i].StatusCode = OpcUa_BadUserAccessDenied;
continue;
}
#endif
a_pHistoryReadProcessedCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotImplemented;
}
}
}
return OpcUa_Good;
}
{
OpcUa_Int32 i;
OpcUa_BaseNode *pNode = OpcUa_Null;
OpcUa_ReturnErrorIfArgumentNull(a_pHistoryReadAtTimeCtx);
for (i = 0; i < a_pHistoryReadAtTimeCtx->NoOfNodesToRead; i++)
{
pNodeToRead = &a_pHistoryReadAtTimeCtx->pNodesToRead[i];
pNodeId = &pNodeToRead->
NodeId;
{
if (pNode)
{
if (OpcUa_BaseNode_GetClass(pNode) != OpcUa_NodeClass_Variable ||
{
a_pHistoryReadAtTimeCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotReadable;
continue;
}
#if UASERVER_SUPPORT_AUTHORIZATION
{
a_pHistoryReadAtTimeCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotReadable;
continue;
}
#endif
a_pHistoryReadAtTimeCtx->pResponse->Results[i].StatusCode = OpcUa_BadNotImplemented;
}
}
}
return OpcUa_Good;
}
OPCUA_END_EXTERN_C