|
@@ -135,7 +135,7 @@ Service_SetPublishingMode(UA_Server *server, UA_Session *session,
|
|
UA_SetPublishingModeResponse *response) {
|
|
UA_SetPublishingModeResponse *response) {
|
|
UA_LOG_DEBUG_SESSION(server->config.logger, session, "Processing SetPublishingModeRequest");
|
|
UA_LOG_DEBUG_SESSION(server->config.logger, session, "Processing SetPublishingModeRequest");
|
|
UA_Boolean publishingEnabled = request->publishingEnabled; /* request is const */
|
|
UA_Boolean publishingEnabled = request->publishingEnabled; /* request is const */
|
|
- response->responseHeader.serviceResult =
|
|
|
|
|
|
+ response->responseHeader.serviceResult =
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_SetPublishingMode,
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_SetPublishingMode,
|
|
&publishingEnabled,
|
|
&publishingEnabled,
|
|
&request->subscriptionIdsSize, &UA_TYPES[UA_TYPES_UINT32],
|
|
&request->subscriptionIdsSize, &UA_TYPES[UA_TYPES_UINT32],
|
|
@@ -310,7 +310,7 @@ Service_CreateMonitoredItems(UA_Server *server, UA_Session *session,
|
|
/* Reset the subscription lifetime */
|
|
/* Reset the subscription lifetime */
|
|
cmc.sub->currentLifetimeCount = 0;
|
|
cmc.sub->currentLifetimeCount = 0;
|
|
|
|
|
|
- response->responseHeader.serviceResult =
|
|
|
|
|
|
+ response->responseHeader.serviceResult =
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_CreateMonitoredItem, &cmc,
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_CreateMonitoredItem, &cmc,
|
|
&request->itemsToCreateSize, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST],
|
|
&request->itemsToCreateSize, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATEREQUEST],
|
|
&response->resultsSize, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT]);
|
|
&response->resultsSize, &UA_TYPES[UA_TYPES_MONITOREDITEMCREATERESULT]);
|
|
@@ -361,7 +361,7 @@ void Service_ModifyMonitoredItems(UA_Server *server, UA_Session *session,
|
|
|
|
|
|
sub->currentLifetimeCount = 0; /* Reset the subscription lifetime */
|
|
sub->currentLifetimeCount = 0; /* Reset the subscription lifetime */
|
|
|
|
|
|
- response->responseHeader.serviceResult =
|
|
|
|
|
|
+ response->responseHeader.serviceResult =
|
|
UA_Server_processServiceOperations(server, session,
|
|
UA_Server_processServiceOperations(server, session,
|
|
(UA_ServiceOperation)Operation_ModifyMonitoredItem, sub,
|
|
(UA_ServiceOperation)Operation_ModifyMonitoredItem, sub,
|
|
&request->itemsToModifySize, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST],
|
|
&request->itemsToModifySize, &UA_TYPES[UA_TYPES_MONITOREDITEMMODIFYREQUEST],
|
|
@@ -417,7 +417,7 @@ void Service_SetMonitoringMode(UA_Server *server, UA_Session *session,
|
|
smc.sub->currentLifetimeCount = 0; /* Reset the subscription lifetime */
|
|
smc.sub->currentLifetimeCount = 0; /* Reset the subscription lifetime */
|
|
|
|
|
|
smc.monitoringMode = request->monitoringMode;
|
|
smc.monitoringMode = request->monitoringMode;
|
|
- response->responseHeader.serviceResult =
|
|
|
|
|
|
+ response->responseHeader.serviceResult =
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_SetMonitoringMode, &smc,
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_SetMonitoringMode, &smc,
|
|
&request->monitoredItemIdsSize, &UA_TYPES[UA_TYPES_UINT32],
|
|
&request->monitoredItemIdsSize, &UA_TYPES[UA_TYPES_UINT32],
|
|
&response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]);
|
|
&response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]);
|
|
@@ -512,7 +512,7 @@ Service_Publish(UA_Server *server, UA_Session *session,
|
|
|
|
|
|
/* Answer immediately to a late subscription */
|
|
/* Answer immediately to a late subscription */
|
|
UA_Subscription *immediate;
|
|
UA_Subscription *immediate;
|
|
- UA_Boolean found = true;
|
|
|
|
|
|
+ UA_Boolean found = true;
|
|
int loopCount = 1;
|
|
int loopCount = 1;
|
|
|
|
|
|
if(session->lastSeenSubscriptionId > 0) {
|
|
if(session->lastSeenSubscriptionId > 0) {
|
|
@@ -529,8 +529,8 @@ Service_Publish(UA_Server *server, UA_Session *session,
|
|
LIST_FOREACH(immediate, &session->serverSubscriptions, listEntry) {
|
|
LIST_FOREACH(immediate, &session->serverSubscriptions, listEntry) {
|
|
if(!found) {
|
|
if(!found) {
|
|
if(session->lastSeenSubscriptionId == immediate->subscriptionId) {
|
|
if(session->lastSeenSubscriptionId == immediate->subscriptionId) {
|
|
- found = true;
|
|
|
|
- }
|
|
|
|
|
|
+ found = true;
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
if(immediate->state == UA_SUBSCRIPTIONSTATE_LATE) {
|
|
if(immediate->state == UA_SUBSCRIPTIONSTATE_LATE) {
|
|
session->lastSeenSubscriptionId = immediate->subscriptionId;
|
|
session->lastSeenSubscriptionId = immediate->subscriptionId;
|
|
@@ -538,9 +538,9 @@ Service_Publish(UA_Server *server, UA_Session *session,
|
|
"Response on a late subscription", immediate->subscriptionId);
|
|
"Response on a late subscription", immediate->subscriptionId);
|
|
UA_Subscription_publishCallback(server, immediate);
|
|
UA_Subscription_publishCallback(server, immediate);
|
|
return;
|
|
return;
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
/* after the first loop, we can publish the first subscription with UA_SUBSCRIPTIONSTATE_LATE */
|
|
/* after the first loop, we can publish the first subscription with UA_SUBSCRIPTIONSTATE_LATE */
|
|
found = true;
|
|
found = true;
|
|
}
|
|
}
|
|
@@ -569,7 +569,7 @@ Service_DeleteSubscriptions(UA_Server *server, UA_Session *session,
|
|
UA_LOG_DEBUG_SESSION(server->config.logger, session,
|
|
UA_LOG_DEBUG_SESSION(server->config.logger, session,
|
|
"Processing DeleteSubscriptionsRequest");
|
|
"Processing DeleteSubscriptionsRequest");
|
|
|
|
|
|
- response->responseHeader.serviceResult =
|
|
|
|
|
|
+ response->responseHeader.serviceResult =
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_DeleteSubscription, NULL,
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_DeleteSubscription, NULL,
|
|
&request->subscriptionIdsSize, &UA_TYPES[UA_TYPES_UINT32],
|
|
&request->subscriptionIdsSize, &UA_TYPES[UA_TYPES_UINT32],
|
|
&response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]);
|
|
&response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]);
|
|
@@ -610,7 +610,7 @@ void Service_DeleteMonitoredItems(UA_Server *server, UA_Session *session,
|
|
/* Reset the subscription lifetime */
|
|
/* Reset the subscription lifetime */
|
|
sub->currentLifetimeCount = 0;
|
|
sub->currentLifetimeCount = 0;
|
|
|
|
|
|
- response->responseHeader.serviceResult =
|
|
|
|
|
|
+ response->responseHeader.serviceResult =
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_DeleteMonitoredItem, sub,
|
|
UA_Server_processServiceOperations(server, session, (UA_ServiceOperation)Operation_DeleteMonitoredItem, sub,
|
|
&request->monitoredItemIdsSize, &UA_TYPES[UA_TYPES_UINT32],
|
|
&request->monitoredItemIdsSize, &UA_TYPES[UA_TYPES_UINT32],
|
|
&response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]);
|
|
&response->resultsSize, &UA_TYPES[UA_TYPES_STATUSCODE]);
|