- IEC 61850 server: functions IedModel_getModelNodeByShortObjectReference and IedModel_getModelNodeByObjectReference now also work with object references that have only LD part

v1.2
Michael Zillgith 7 years ago
parent db28db570e
commit 285237b358

@ -3,7 +3,7 @@
*
* Copyright 2013 Michael Zillgith
*
* This file is part of libIEC61850.
* This file is part of libIEC61850.
*
* libIEC61850 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -301,15 +301,16 @@ IedModel_getModelNodeByObjectReference(IedModel* model, const char* objectRefere
char* separator = strchr(objRef, '/');
if (separator == NULL)
return NULL;
*separator = 0;
if (separator != NULL)
*separator = 0;
LogicalDevice* ld = IedModel_getDevice(model, objRef);
if (ld == NULL) return NULL;
if ((separator == NULL) || (*(separator + 1) == 0))
return (ModelNode*) ld;
return ModelNode_getChild((ModelNode*) ld, separator + 1);
}
@ -349,10 +350,8 @@ IedModel_getModelNodeByShortObjectReference(IedModel* model, const char* objectR
char* separator = strchr(objRef, '/');
if (separator == NULL)
return NULL;
*separator = 0;
if (separator != NULL)
*separator = 0;
char ldName[65];
strcpy(ldName, model->name);
@ -362,6 +361,9 @@ IedModel_getModelNodeByShortObjectReference(IedModel* model, const char* objectR
if (ld == NULL) return NULL;
if ((separator == NULL) || (*(separator + 1) == 0))
return (ModelNode*) ld;
return ModelNode_getChild((ModelNode*) ld, separator + 1);
}

Loading…
Cancel
Save