Update ied_connection.c

During my test, it was observed that when there are 2 logical nodes with same string repeats, ( such as almGGIO1 and almGGIO10) in those cases, these 2 below functions add the DOs from almGGIO1 to almGGIO10. and model discovery will show invalid DOs under almGGIO10. My test was done in 1.5 version, I think this change is relevent in current version also.

IedConnection_getLogicalNodeDirectory
IedConnection_getLogicalNodeVariables
pull/521/head
aravindmithra 12 months ago committed by GitHub
parent 519b0208cc
commit 8f77fbdc6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -2783,7 +2783,7 @@ IedConnection_getLogicalNodeDirectory(IedConnection self, IedClientError* error,
goto next_element; goto next_element;
int lnNameLen = (int)(fcPos - variableName); int lnNameLen = (int)(fcPos - variableName);
if (strlen(logicalNodeName) == lnNameLen){
if (strncmp(variableName, logicalNodeName, lnNameLen) == 0) if (strncmp(variableName, logicalNodeName, lnNameLen) == 0)
{ {
char* fcEndPos = strchr(fcPos + 1, '$'); char* fcEndPos = strchr(fcPos + 1, '$');
@ -2802,6 +2802,7 @@ IedConnection_getLogicalNodeDirectory(IedConnection self, IedClientError* error,
} }
} }
} }
}
next_element: next_element:
@ -2929,12 +2930,13 @@ IedConnection_getLogicalNodeVariables(IedConnection self, IedClientError* error,
if (fcPos) if (fcPos)
{ {
int lnNameLen = (int)(fcPos - variableName); int lnNameLen = (int)(fcPos - variableName);
if (strlen(logicalNodeName) == lnNameLen){
if (strncmp(variableName, logicalNodeName, lnNameLen) == 0) if (strncmp(variableName, logicalNodeName, lnNameLen) == 0)
{ {
LinkedList_add(lnDirectory, StringUtils_copyString(fcPos + 1)); LinkedList_add(lnDirectory, StringUtils_copyString(fcPos + 1));
} }
} }
}
variable = LinkedList_getNext(variable); variable = LinkedList_getNext(variable);
} }

Loading…
Cancel
Save