Quellcode durchsuchen

trying to fix the watchdog issue: i am pretty sure it is about the Publish service (it sets timeout of 6 seconds), I tried to fake the Response, and am pretty sure it is okay (Wireshark comparisons) - however the watchdog issue is still not fixed!

Stasik0 vor 10 Jahren
Ursprung
Commit
025e1f0c90
4 geänderte Dateien mit 19 neuen und 2 gelöschten Zeilen
  1. 3 1
      src/ua_services.h
  2. 12 0
      src/ua_services_subscription.c
  3. 1 1
      src/ua_services_view.c
  4. 3 0
      src/ua_transport_binary_secure.c

+ 3 - 1
src/ua_services.h

@@ -229,7 +229,9 @@ UA_Int32 Service_CreateSubscription(SL_Channel *channel, const UA_CreateSubscrip
                                    UA_CreateSubscriptionResponse *response);
 // Service_ModifySubscription
 // Service_SetPublishingMode
-// Service_Publish
+UA_Int32 Service_Publish(SL_Channel *channel, const UA_PublishRequest *request,
+                                   UA_PublishResponse *response);
+
 // Service_Republish
 // Service_TransferSubscription
 // Service_DeleteSubscription

+ 12 - 0
src/ua_services_subscription.c

@@ -5,6 +5,7 @@
  *      Author: root
  */
 #include "ua_services.h"
+#include "ua_statuscodes.h"
 
 UA_Int32 Service_CreateSubscription(SL_Channel *channel, const UA_CreateSubscriptionRequest *request,
                                    UA_CreateSubscriptionResponse *response)
@@ -16,3 +17,14 @@ UA_Int32 Service_CreateSubscription(SL_Channel *channel, const UA_CreateSubscrip
 	response->revisedMaxKeepAliveCount = 50;
 	return UA_SUCCESS;
 }
+
+UA_Int32 Service_Publish(SL_Channel *channel, const UA_PublishRequest *request,
+                                   UA_PublishResponse *response)
+{
+
+	response->subscriptionId = 42;
+	response->notificationMessage.sequenceNumber = 1;
+	response->notificationMessage.publishTime = UA_DateTime_now();
+	return UA_SUCCESS;
+}
+

+ 1 - 1
src/ua_services_view.c

@@ -144,7 +144,7 @@ UA_Int32 Service_TranslateBrowsePathsToNodeIds(SL_Channel *channel,
 	for (UA_Int32 i = 0; i < request->browsePathsSize; i++) {
 		UA_BrowsePathResult_init(&response->results[i]);
 //FIXME: implement
-		response->results[i].statusCode = UA_STATUSCODE_BADQUERYTOOCOMPLEX;
+		response->results[i].statusCode = UA_STATUSCODE_BADNOMATCH;
 	}
 
 	return retval;

+ 3 - 0
src/ua_transport_binary_secure.c

@@ -152,6 +152,9 @@ UA_Int32 SL_handleRequest(SL_Channel *channel, const UA_ByteString *msg, UA_UInt
 	}else if(serviceid == UA_CREATEMONITOREDITEMSREQUEST_NS0) {
 		INVOKE_SERVICE(CreateMonitoredItems);
 		responsetype = UA_CREATEMONITOREDITEMSRESPONSE_NS0;
+	}else if(serviceid == UA_PUBLISHREQUEST_NS0) {
+		INVOKE_SERVICE(Publish);
+		responsetype = UA_PUBLISHRESPONSE_NS0;
 	}else{
 		printf("SL_processMessage - unknown request, namespace=%d, request=%d\n",
 		       serviceRequestType.namespace,