ua_services_monitoreditems.c 1.0 KB

12345678910111213141516171819202122232425
  1. #include "ua_services.h"
  2. #if 0
  3. /* Activate once the infrastructure for pushing events is in place. */
  4. UA_Int32 Service_CreateMonitoredItems(SL_Channel *channel, const UA_CreateMonitoredItemsRequest *request, UA_CreateMonitoredItemsResponse *response) {
  5. if (request->itemsToCreateSize > 0) {
  6. response->resultsSize = request->itemsToCreateSize;
  7. UA_Array_new((void**)&(response->results),response->resultsSize,UA_MONITOREDITEMCREATERESULT);
  8. for (int i=0;request->itemsToCreateSize > 0 && i < request->itemsToCreateSize;i++) {
  9. UA_NodeId_printf("CreateMonitoredItems - itemToCreate=",&(request->itemsToCreate[i]->itemToMonitor.nodeId));
  10. //FIXME: search the object in the namespace
  11. if (request->itemsToCreate[i]->itemToMonitor.nodeId.identifier.numeric == 2253) { // server
  12. response->results[i]->statusCode = UA_STATUSCODE_GOOD;
  13. response->results[i]->monitoredItemId = 1024;
  14. } else {
  15. // response->results[i]->statusCode = UA_STATUSCODE_BAD_NODEIDUNKNOWN;
  16. response->results[i]->statusCode = -1;
  17. }
  18. }
  19. }
  20. }
  21. #endif