- IED server: list objects access handler uses now '.' delimiter for the subObjectName (LIB61850-417)

v1.6_develop_417_rbac2
Michael Zillgith 2 years ago
parent fd19abb0ab
commit 4cd4629a35

@ -40,6 +40,19 @@ StringUtils_copyStringMax(char* dest, int maxBufferSize, const char* str1);
LIB61850_INTERNAL char*
StringUtils_copyStringToBuffer(const char* string, char* buffer);
/**
* \brief Copy string to buffer and replace characters
*
* NOTE: str should be a 0 terminated string. The terminating 0 is also copied.
*
* \param str the source string to copy
* \param buffer the destination buffer
* \param oldChar the character that has to be replaced while copying
* \param newChar the replacement character
*/
LIB61850_INTERNAL char*
StringUtils_copyStringToBufferAndReplace(const char* str, char* buffer, char oldChar, char newChar);
LIB61850_INTERNAL char*
StringUtils_copySubString(char* startPos, char* endPos);

@ -1,7 +1,7 @@
/*
* string_utilities.c
*
* Copyright 2013 Michael Zillgith
* Copyright 2013-2023 Michael Zillgith
*
* This file is part of libIEC61850.
*
@ -65,6 +65,27 @@ StringUtils_copyStringToBuffer(const char* string, char* buffer)
return buffer;
}
char*
StringUtils_copyStringToBufferAndReplace(const char* str, char* buffer, char oldChar, char newChar)
{
int i = 0;
while (true)
{
if (str[i] == oldChar)
buffer[i] = newChar;
else
buffer[i] = str[i];
if (str[i] == 0)
break;
i++;
}
return buffer;
}
char*
StringUtils_createStringFromBuffer(const uint8_t* buf, int size)

@ -3497,7 +3497,7 @@ mmsListObjectsAccessHandler(void* parameter, MmsGetNameListType listType, MmsDom
StringUtils_createStringFromBufferInBuffer(str, (uint8_t*) (doStart + 1), doEnd - doStart);
subObjectName = StringUtils_copyStringToBuffer(doEnd + 2, subObjectBuf);
subObjectName = StringUtils_copyStringToBufferAndReplace(doEnd + 2, subObjectBuf, '$', '.');
}
}
}
@ -3564,7 +3564,7 @@ mmsListObjectsAccessHandler(void* parameter, MmsGetNameListType listType, MmsDom
StringUtils_createStringFromBufferInBuffer(str, (uint8_t*) (doStart + 1), doEnd - doStart);
subObjectName = StringUtils_copyStringToBuffer(doEnd + 2, subObjectBuf);
subObjectName = StringUtils_copyStringToBufferAndReplace(doEnd + 2, subObjectBuf, '$', '.');
}
if (fc == IEC61850_FC_SP) {

Loading…
Cancel
Save