|
@@ -1,24 +1,30 @@
|
|
#include "ua_services.h"
|
|
#include "ua_services.h"
|
|
|
|
+#include "ua_statuscodes.h"
|
|
|
|
|
|
-#if 0
|
|
|
|
|
|
+//#if 0
|
|
/* Activate once the infrastructure for pushing events is in place. */
|
|
/* Activate once the infrastructure for pushing events is in place. */
|
|
|
|
|
|
UA_Int32 Service_CreateMonitoredItems(SL_Channel *channel, const UA_CreateMonitoredItemsRequest *request, UA_CreateMonitoredItemsResponse *response) {
|
|
UA_Int32 Service_CreateMonitoredItems(SL_Channel *channel, const UA_CreateMonitoredItemsRequest *request, UA_CreateMonitoredItemsResponse *response) {
|
|
if (request->itemsToCreateSize > 0) {
|
|
if (request->itemsToCreateSize > 0) {
|
|
response->resultsSize = request->itemsToCreateSize;
|
|
response->resultsSize = request->itemsToCreateSize;
|
|
- UA_Array_new((void**)&(response->results),response->resultsSize,UA_MONITOREDITEMCREATERESULT);
|
|
|
|
|
|
+
|
|
|
|
+ UA_Array_new((void**)&(response->results),response->resultsSize,&UA_.types[UA_MONITOREDITEMCREATERESULT]);
|
|
for (int i=0;request->itemsToCreateSize > 0 && i < request->itemsToCreateSize;i++) {
|
|
for (int i=0;request->itemsToCreateSize > 0 && i < request->itemsToCreateSize;i++) {
|
|
- UA_NodeId_printf("CreateMonitoredItems - itemToCreate=",&(request->itemsToCreate[i]->itemToMonitor.nodeId));
|
|
|
|
|
|
+ UA_NodeId_printf("CreateMonitoredItems - itemToCreate=",&(request->itemsToCreate[i].itemToMonitor.nodeId));
|
|
//FIXME: search the object in the namespace
|
|
//FIXME: search the object in the namespace
|
|
- if (request->itemsToCreate[i]->itemToMonitor.nodeId.identifier.numeric == 2253) { // server
|
|
|
|
- response->results[i]->statusCode = UA_STATUSCODE_GOOD;
|
|
|
|
- response->results[i]->monitoredItemId = 1024;
|
|
|
|
|
|
+ if (request->itemsToCreate[i].itemToMonitor.nodeId.identifier.numeric == 2253) { // server
|
|
|
|
+
|
|
|
|
+ response->results[i].statusCode = UA_STATUSCODE_GOOD;
|
|
|
|
+ response->results[i].monitoredItemId = 1024;
|
|
} else {
|
|
} else {
|
|
// response->results[i]->statusCode = UA_STATUSCODE_BAD_NODEIDUNKNOWN;
|
|
// response->results[i]->statusCode = UA_STATUSCODE_BAD_NODEIDUNKNOWN;
|
|
- response->results[i]->statusCode = -1;
|
|
|
|
|
|
+
|
|
|
|
+ response->results[i].statusCode = -1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //mock up
|
|
|
|
+ return UA_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
-#endif
|
|
|
|
|
|
+//#endif
|