|
|
|
@ -80,6 +80,8 @@ getNameListVMDSpecific(MmsServerConnection connection)
|
|
|
|
|
}
|
|
|
|
|
#endif /* (CONFIG_MMS_SUPPORT_VMD_SCOPE_NAMED_VARIABLES == 1) */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
static void
|
|
|
|
|
sortIndex(int* index, int size, MmsVariableSpecification** namedVariables)
|
|
|
|
|
{
|
|
|
|
@ -96,6 +98,7 @@ sortIndex(int* index, int size, MmsVariableSpecification** namedVariables)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif /* (CONFIG_MMS_SORT_NAME_LIST == 1) */
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SUPPORT_FLATTED_NAME_SPACE == 1)
|
|
|
|
|
static char*
|
|
|
|
@ -133,23 +136,36 @@ addSubNamedVaribleNamesToList(LinkedList nameList, char* prefix, MmsVariableSpec
|
|
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
MmsVariableSpecification** variables = variable->typeSpec.structure.elements;
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
int* index = GLOBAL_MALLOC(sizeof(int) * variable->typeSpec.structure.elementCount);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < variable->typeSpec.structure.elementCount; i++)
|
|
|
|
|
index[i] = i;
|
|
|
|
|
|
|
|
|
|
MmsVariableSpecification** variables = variable->typeSpec.structure.elements;
|
|
|
|
|
|
|
|
|
|
sortIndex(index, variable->typeSpec.structure.elementCount, variables);
|
|
|
|
|
|
|
|
|
|
#endif /* (CONFIG_MMS_SORT_NAME_LIST == 1) */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < variable->typeSpec.structure.elementCount; i++) {
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
char* variableName = appendMmsSubVariable(prefix, variables[index[i]]->name);
|
|
|
|
|
#else
|
|
|
|
|
char* variableName = appendMmsSubVariable(prefix, variables[i]->name);
|
|
|
|
|
#endif /* (CONFIG_MMS_SORT_NAME_LIST == 1) */
|
|
|
|
|
|
|
|
|
|
listElement = LinkedList_insertAfter(listElement, variableName);
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
listElement = addSubNamedVaribleNamesToList(listElement, variableName, variables[index[i]]);
|
|
|
|
|
#else
|
|
|
|
|
listElement = addSubNamedVaribleNamesToList(listElement, variableName, variables[i]);
|
|
|
|
|
#endif /* (CONFIG_MMS_SORT_NAME_LIST == 1) */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
GLOBAL_FREEMEM(index);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return listElement;
|
|
|
|
@ -157,7 +173,6 @@ addSubNamedVaribleNamesToList(LinkedList nameList, char* prefix, MmsVariableSpec
|
|
|
|
|
|
|
|
|
|
#endif /* (CONFIG_MMS_SUPPORT_FLATTED_NAME_SPACE == 1) */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static LinkedList
|
|
|
|
|
getNameListDomainSpecific(MmsServerConnection connection, char* domainName)
|
|
|
|
|
{
|
|
|
|
@ -175,26 +190,38 @@ getNameListDomainSpecific(MmsServerConnection connection, char* domainName)
|
|
|
|
|
|
|
|
|
|
LinkedList element = nameList;
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
int* index = GLOBAL_MALLOC(sizeof(int) * domain->namedVariablesCount);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < domain->namedVariablesCount; i++)
|
|
|
|
|
index[i] = i;
|
|
|
|
|
|
|
|
|
|
sortIndex(index, domain->namedVariablesCount, domain->namedVariables);
|
|
|
|
|
#endif /* (CONFIG_MMS_SORT_NAME_LIST == 1) */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < domain->namedVariablesCount; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
element = LinkedList_insertAfter(element, copyString(variables[index[i]]->name));
|
|
|
|
|
#else
|
|
|
|
|
element = LinkedList_insertAfter(element, copyString(variables[i]->name));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SUPPORT_FLATTED_NAME_SPACE == 1)
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
char* prefix = variables[index[i]]->name;
|
|
|
|
|
element = addSubNamedVaribleNamesToList(element, prefix, variables[index[i]]);
|
|
|
|
|
#endif
|
|
|
|
|
#else
|
|
|
|
|
char* prefix = variables[i]->name;
|
|
|
|
|
element = addSubNamedVaribleNamesToList(element, prefix, variables[i]);
|
|
|
|
|
#endif /* (CONFIG_MMS_SORT_NAME_LIST == 1) */
|
|
|
|
|
#endif /* (CONFIG_MMS_SUPPORT_FLATTED_NAME_SPACE == 1) */
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
GLOBAL_FREEMEM(index);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return nameList;
|
|
|
|
@ -472,11 +499,6 @@ mmsServer_handleGetNameListRequest(
|
|
|
|
|
if (nameList == NULL)
|
|
|
|
|
mmsServer_createConfirmedErrorPdu(invokeId, response, MMS_ERROR_ACCESS_OBJECT_NON_EXISTENT);
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
|
|
|
|
// StringUtils_sortList(nameList);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
createNameListResponse(connection, invokeId, nameList, response, continueAfterId);
|
|
|
|
|
LinkedList_destroy(nameList);
|
|
|
|
|
}
|
|
|
|
|