Răsfoiți Sursa

Fix: Must have "active" IO connections to reject setting of TCP/IP object #5

The TCP/IP object's attribute #5 "Interface Configuration" should reject a
SetAttributeSingle request if there is any "active" IO connection present.
See Vol. 2, Section 5-4.3.2.5.2 Set Attributes Behavior (for attribute #5)

Previously OpENer rejected that request if *any* IO connection was present.
Now we do not consider IO connections in the timeout state as "active"
connections any more and allow the request. This was recommended during
the conformance test.

Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
Stefan Mätje 6 ani în urmă
părinte
comite
a2844186ed
1 a modificat fișierele cu 4 adăugiri și 2 ștergeri
  1. 4 2
      source/src/cip/ciptcpipinterface.c

+ 4 - 2
source/src/cip/ciptcpipinterface.c

@@ -297,8 +297,10 @@ static bool IsIOConnectionActive(void)
 
   while (NULL != node) {
     CipConnectionObject *connection = node->data;
-    if (ConnectionObjectIsTypeIOConnection(connection)) {
-      /* An IO connection is found */
+    if (ConnectionObjectIsTypeIOConnection(connection) &&
+        kConnectionObjectStateTimedOut != ConnectionObjectGetState(connection)) {
+      /* An IO connection is present but is only considered active
+       *  if it is NOT in timeout state. */
       return true;
     }
     node = node->next;