|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
/*
|
|
|
|
|
* mms_get_namelist_service.c
|
|
|
|
|
*
|
|
|
|
|
* Copyright 2013, 2014, 2015 Michael Zillgith
|
|
|
|
|
* Copyright 2013-2022 Michael Zillgith
|
|
|
|
|
*
|
|
|
|
|
* This file is part of libIEC61850.
|
|
|
|
|
*
|
|
|
|
@ -109,6 +109,8 @@ appendMmsSubVariable(char* name, char* child)
|
|
|
|
|
|
|
|
|
|
char* newName = (char*) GLOBAL_MALLOC(newSize);
|
|
|
|
|
|
|
|
|
|
if (newName)
|
|
|
|
|
{
|
|
|
|
|
int bufPos = 0;
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < nameLen; i++) {
|
|
|
|
@ -121,6 +123,7 @@ appendMmsSubVariable(char* name, char* child)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
newName[bufPos] = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return newName;
|
|
|
|
|
}
|
|
|
|
@ -139,6 +142,8 @@ addSubNamedVaribleNamesToList(LinkedList nameList, char* prefix, MmsVariableSpec
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
int* index = (int*) GLOBAL_MALLOC(sizeof(int) * variable->typeSpec.structure.elementCount);
|
|
|
|
|
|
|
|
|
|
if (index)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < variable->typeSpec.structure.elementCount; i++)
|
|
|
|
|
index[i] = i;
|
|
|
|
|
|
|
|
|
@ -152,6 +157,8 @@ addSubNamedVaribleNamesToList(LinkedList nameList, char* prefix, MmsVariableSpec
|
|
|
|
|
char* variableName = appendMmsSubVariable(prefix, variables[i]->name);
|
|
|
|
|
#endif /* (CONFIG_MMS_SORT_NAME_LIST == 1) */
|
|
|
|
|
|
|
|
|
|
if (variableName)
|
|
|
|
|
{
|
|
|
|
|
listElement = LinkedList_insertAfter(listElement, variableName);
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
@ -160,9 +167,12 @@ addSubNamedVaribleNamesToList(LinkedList nameList, char* prefix, MmsVariableSpec
|
|
|
|
|
listElement = addSubNamedVaribleNamesToList(listElement, variableName, variables[i]);
|
|
|
|
|
#endif /* (CONFIG_MMS_SORT_NAME_LIST == 1) */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
GLOBAL_FREEMEM(index);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|