- refactoring names in string_utils.h/.c
- fixed bug in StringUtils_copySubString
This commit is contained in:
parent
245a21b129
commit
9ad549592d
40 changed files with 250 additions and 250 deletions
|
@ -96,7 +96,7 @@ printRawMmsMessage(void* parameter, uint8_t* message, int messageLength, bool re
|
|||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
char* hostname = copyString("localhost");
|
||||
char* hostname = StringUtils_copyString("localhost");
|
||||
int tcpPort = 102;
|
||||
int maxPduSize = 65000;
|
||||
|
||||
|
@ -124,7 +124,7 @@ int main(int argc, char** argv) {
|
|||
break;
|
||||
|
||||
case 'h':
|
||||
hostname = copyString(optarg);
|
||||
hostname = StringUtils_copyString(optarg);
|
||||
break;
|
||||
case 'p':
|
||||
tcpPort = atoi(optarg);
|
||||
|
@ -140,27 +140,27 @@ int main(int argc, char** argv) {
|
|||
break;
|
||||
case 't':
|
||||
getDeviceDirectory = 1;
|
||||
domainName = copyString(optarg);
|
||||
domainName = StringUtils_copyString(optarg);
|
||||
break;
|
||||
case 'a':
|
||||
readWriteHasDomain = 1;
|
||||
domainName = copyString(optarg);
|
||||
domainName = StringUtils_copyString(optarg);
|
||||
break;
|
||||
case 'r':
|
||||
readVariable = 1;
|
||||
variableName = copyString(optarg);
|
||||
variableName = StringUtils_copyString(optarg);
|
||||
break;
|
||||
case 'f':
|
||||
showFileList = 1;
|
||||
break;
|
||||
case 'g':
|
||||
getFileAttributes = 1;
|
||||
filename = copyString(optarg);
|
||||
filename = StringUtils_copyString(optarg);
|
||||
break;
|
||||
|
||||
case 'j':
|
||||
readJournal = 1;
|
||||
journalName = copyString(optarg);
|
||||
journalName = StringUtils_copyString(optarg);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -28,20 +28,20 @@
|
|||
#include "linked_list.h"
|
||||
|
||||
char*
|
||||
copyString(const char* string);
|
||||
StringUtils_copyString(const char* string);
|
||||
|
||||
char*
|
||||
copyStringToBuffer(const char* string, char* buffer);
|
||||
StringUtils_copyStringToBuffer(const char* string, char* buffer);
|
||||
|
||||
char*
|
||||
copySubString(char* startPos, char* endPos);
|
||||
StringUtils_copySubString(char* startPos, char* endPos);
|
||||
|
||||
/**
|
||||
* \brief Concatenate strings. count indicates the number of strings
|
||||
* to concatenate.
|
||||
*/
|
||||
char*
|
||||
createString(int count, ...);
|
||||
StringUtils_createString(int count, ...);
|
||||
|
||||
/**
|
||||
* \brief Concatenate strings in user provided buffer. count indicates the number of strings
|
||||
|
@ -51,7 +51,7 @@ char*
|
|||
StringUtils_createStringInBuffer(char* buffer, int count, ...);
|
||||
|
||||
char*
|
||||
createStringFromBuffer(const uint8_t* buf, int size);
|
||||
StringUtils_createStringFromBuffer(const uint8_t* buf, int size);
|
||||
|
||||
char*
|
||||
StringUtils_createStringFromBufferInBuffer(char* newString, const uint8_t* buf, int size);
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
#include "libiec61850_platform_includes.h"
|
||||
|
||||
char*
|
||||
copySubString(char* startPos, char* endPos)
|
||||
StringUtils_copySubString(char* startPos, char* endPos)
|
||||
{
|
||||
int newStringLength = endPos - startPos;
|
||||
|
||||
char* newString = (char*) GLOBAL_MALLOC(newStringLength) + 1;
|
||||
char* newString = (char*) GLOBAL_MALLOC(newStringLength + 1);
|
||||
|
||||
memcpy(newString, startPos, newStringLength);
|
||||
|
||||
|
@ -38,7 +38,7 @@ copySubString(char* startPos, char* endPos)
|
|||
}
|
||||
|
||||
char*
|
||||
copyString(const char* string)
|
||||
StringUtils_copyString(const char* string)
|
||||
{
|
||||
int newStringLength = strlen(string) + 1;
|
||||
|
||||
|
@ -50,7 +50,7 @@ copyString(const char* string)
|
|||
}
|
||||
|
||||
char*
|
||||
copyStringToBuffer(const char* string, char* buffer)
|
||||
StringUtils_copyStringToBuffer(const char* string, char* buffer)
|
||||
{
|
||||
int newStringLength = strlen(string) + 1;
|
||||
|
||||
|
@ -61,7 +61,7 @@ copyStringToBuffer(const char* string, char* buffer)
|
|||
|
||||
|
||||
char*
|
||||
createStringFromBuffer(const uint8_t* buf, int size)
|
||||
StringUtils_createStringFromBuffer(const uint8_t* buf, int size)
|
||||
{
|
||||
char* newStr = (char*) GLOBAL_MALLOC(size + 1);
|
||||
|
||||
|
@ -102,7 +102,7 @@ StringUtils_createStringInBuffer(char* newStr, int count, ...)
|
|||
}
|
||||
|
||||
char*
|
||||
createString(int count, ...)
|
||||
StringUtils_createString(int count, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char* newStr;
|
||||
|
|
|
@ -101,19 +101,19 @@ GoosePublisher_destroy(GoosePublisher self)
|
|||
void
|
||||
GoosePublisher_setGoID(GoosePublisher self, char* goID)
|
||||
{
|
||||
self->goID = copyString(goID);
|
||||
self->goID = StringUtils_copyString(goID);
|
||||
}
|
||||
|
||||
void
|
||||
GoosePublisher_setGoCbRef(GoosePublisher self, char* goCbRef)
|
||||
{
|
||||
self->goCBRef = copyString(goCbRef);
|
||||
self->goCBRef = StringUtils_copyString(goCbRef);
|
||||
}
|
||||
|
||||
void
|
||||
GoosePublisher_setDataSetRef(GoosePublisher self, char* dataSetRef)
|
||||
{
|
||||
self->dataSetRef = copyString(dataSetRef);
|
||||
self->dataSetRef = StringUtils_copyString(dataSetRef);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -90,7 +90,7 @@ GooseReceiver_setInterfaceId(GooseReceiver self, const char* interfaceId)
|
|||
if (self->interfaceId != NULL)
|
||||
GLOBAL_FREEMEM(self->interfaceId);
|
||||
|
||||
self->interfaceId = copyString(interfaceId);
|
||||
self->interfaceId = StringUtils_copyString(interfaceId);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -40,7 +40,7 @@ GooseSubscriber_create(char* goCbRef, MmsValue* dataSetValues)
|
|||
{
|
||||
GooseSubscriber self = (GooseSubscriber) GLOBAL_CALLOC(1, sizeof(struct sGooseSubscriber));
|
||||
|
||||
self->goCBRef = copyString(goCbRef);
|
||||
self->goCBRef = StringUtils_copyString(goCbRef);
|
||||
self->goCBRefLen = strlen(goCbRef);
|
||||
self->timestamp = MmsValue_newUtcTime(0);
|
||||
self->dataSetValues = dataSetValues;
|
||||
|
|
|
@ -125,7 +125,7 @@ FileSystem_openDirectory(char* directoryName)
|
|||
char*
|
||||
FileSystem_readDirectory(DirectoryHandle directory, bool* isDirectory)
|
||||
{
|
||||
struct dirent *dir;
|
||||
struct dirent* dir;
|
||||
|
||||
dir = readdir(directory->handle);
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ ControlObjectClient_create(const char* objectReference, IedConnection connection
|
|||
if (self == NULL)
|
||||
goto exit_function;
|
||||
|
||||
self->objectReference = copyString(objectReference);
|
||||
self->objectReference = StringUtils_copyString(objectReference);
|
||||
self->connection = connection;
|
||||
self->ctlModel = (ControlModel) ctlModel;
|
||||
self->hasTimeActivatedMode = hasTimeActivatedControl;
|
||||
|
@ -335,7 +335,7 @@ ControlObjectClient_create(const char* objectReference, IedConnection connection
|
|||
if (self == NULL)
|
||||
goto exit_function;
|
||||
|
||||
self->objectReference = copyString(objectReference);
|
||||
self->objectReference = StringUtils_copyString(objectReference);
|
||||
self->connection = connection;
|
||||
self->ctlModel = (ControlModel) ctlModelVal;
|
||||
self->hasTimeActivatedMode = hasTimeActivatedControl;
|
||||
|
@ -423,7 +423,7 @@ ControlObjectClient_setOrigin(ControlObjectClient self, const char* orIdent, int
|
|||
GLOBAL_FREEMEM(self->orIdent);
|
||||
|
||||
if (orIdent != NULL)
|
||||
self->orIdent = copyString(orIdent);
|
||||
self->orIdent = StringUtils_copyString(orIdent);
|
||||
else
|
||||
self->orIdent = NULL;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ ClientGooseControlBlock_create(const char* objectReference)
|
|||
{
|
||||
ClientGooseControlBlock self = (ClientGooseControlBlock) GLOBAL_CALLOC(1, sizeof(struct sClientGooseControlBlock));
|
||||
|
||||
self->objectReference = copyString(objectReference);
|
||||
self->objectReference = StringUtils_copyString(objectReference);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -414,56 +414,56 @@ IedConnection_setGoCBValues(IedConnection self, IedClientError* error, ClientGoo
|
|||
if (parametersMask & GOCB_ELEMENT_GO_ID) {
|
||||
strcpy(itemId + itemIdLen, "$GoID");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, goCB->goID);
|
||||
}
|
||||
|
||||
if (parametersMask & GOCB_ELEMENT_DATSET) {
|
||||
strcpy(itemId + itemIdLen, "$DatSet");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, goCB->datSet);
|
||||
}
|
||||
|
||||
if (parametersMask & GOCB_ELEMENT_CONF_REV) {
|
||||
strcpy(itemId + itemIdLen, "$ConfRev");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, goCB->confRev);
|
||||
}
|
||||
|
||||
if (parametersMask & GOCB_ELEMENT_NDS_COMM) {
|
||||
strcpy(itemId + itemIdLen, "$NdsCom");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, goCB->ndsCom);
|
||||
}
|
||||
|
||||
if (parametersMask & GOCB_ELEMENT_DST_ADDRESS) {
|
||||
strcpy(itemId + itemIdLen, "$DstAddress");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, goCB->dstAddress);
|
||||
}
|
||||
|
||||
if (parametersMask & GOCB_ELEMENT_MIN_TIME) {
|
||||
strcpy(itemId + itemIdLen, "$MinTime");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, goCB->minTime);
|
||||
}
|
||||
|
||||
if (parametersMask & GOCB_ELEMENT_MAX_TIME) {
|
||||
strcpy(itemId + itemIdLen, "$MaxTime");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, goCB->maxTime);
|
||||
}
|
||||
|
||||
if (parametersMask & GOCB_ELEMENT_FIXED_OFFS) {
|
||||
strcpy(itemId + itemIdLen, "$FixedOffs");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, goCB->fixedOffs);
|
||||
}
|
||||
|
||||
|
@ -471,7 +471,7 @@ IedConnection_setGoCBValues(IedConnection self, IedClientError* error, ClientGoo
|
|||
if (parametersMask & GOCB_ELEMENT_GO_ENA) {
|
||||
strcpy(itemId + itemIdLen, "$GoEna");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, goCB->goEna);
|
||||
}
|
||||
|
||||
|
|
|
@ -275,10 +275,10 @@ IedConnection_installReportHandler(IedConnection self, const char* rcbReference,
|
|||
report = ClientReport_create();
|
||||
report->callback = handler;
|
||||
report->callbackParameter = handlerParameter;
|
||||
report->rcbReference = copyString(rcbReference);
|
||||
report->rcbReference = StringUtils_copyString(rcbReference);
|
||||
|
||||
if (rptId != NULL)
|
||||
report->rptId = copyString(rptId);
|
||||
report->rptId = StringUtils_copyString(rptId);
|
||||
else
|
||||
report->rptId = NULL;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ ClientReportControlBlock_create(const char* objectReference)
|
|||
|
||||
//TODO check validity of object reference?!
|
||||
|
||||
self->objectReference = copyString(objectReference);
|
||||
self->objectReference = StringUtils_copyString(objectReference);
|
||||
self->isBuffered = isBufferedRcb(objectReference);
|
||||
|
||||
return self;
|
||||
|
@ -530,7 +530,7 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
|
|||
|
||||
strcpy(itemId + itemIdLen, "$Resv");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->resv);
|
||||
}
|
||||
|
||||
|
@ -540,56 +540,56 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
|
|||
|
||||
strcpy(itemId + itemIdLen, "$ResvTms");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->resvTms);
|
||||
}
|
||||
|
||||
if (parametersMask & RCB_ELEMENT_RPT_ID) {
|
||||
strcpy(itemId + itemIdLen, "$RptID");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->rptId);
|
||||
}
|
||||
|
||||
if (parametersMask & RCB_ELEMENT_DATSET) {
|
||||
strcpy(itemId + itemIdLen, "$DatSet");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->datSet);
|
||||
}
|
||||
|
||||
if (parametersMask & RCB_ELEMENT_ENTRY_ID) {
|
||||
strcpy(itemId + itemIdLen, "$EntryID");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->entryId);
|
||||
}
|
||||
|
||||
if (parametersMask & RCB_ELEMENT_OPT_FLDS) {
|
||||
strcpy(itemId + itemIdLen, "$OptFlds");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->optFlds);
|
||||
}
|
||||
|
||||
if (parametersMask & RCB_ELEMENT_BUF_TM) {
|
||||
strcpy(itemId + itemIdLen, "$BufTm");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->bufTm);
|
||||
}
|
||||
|
||||
if (parametersMask & RCB_ELEMENT_TRG_OPS) {
|
||||
strcpy(itemId + itemIdLen, "$TrgOps");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->trgOps);
|
||||
}
|
||||
|
||||
if (parametersMask & RCB_ELEMENT_INTG_PD) {
|
||||
strcpy(itemId + itemIdLen, "$IntgPd");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->intgPd);
|
||||
}
|
||||
|
||||
|
@ -603,7 +603,7 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
|
|||
if (sendGILast == false) {
|
||||
strcpy(itemId + itemIdLen, "$GI");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->gi);
|
||||
}
|
||||
}
|
||||
|
@ -614,7 +614,7 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
|
|||
|
||||
strcpy(itemId + itemIdLen, "$PurgeBuf");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->purgeBuf);
|
||||
}
|
||||
|
||||
|
@ -624,21 +624,21 @@ IedConnection_setRCBValues(IedConnection self, IedClientError* error, ClientRepo
|
|||
|
||||
strcpy(itemId + itemIdLen, "$TimeofEntry");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->timeOfEntry);
|
||||
}
|
||||
|
||||
if (parametersMask & RCB_ELEMENT_RPT_ENA) {
|
||||
strcpy(itemId + itemIdLen, "$RptEna");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->rptEna);
|
||||
}
|
||||
|
||||
if (sendGILast) {
|
||||
strcpy(itemId + itemIdLen, "$GI");
|
||||
|
||||
LinkedList_add(itemIds, copyString(itemId));
|
||||
LinkedList_add(itemIds, StringUtils_copyString(itemId));
|
||||
LinkedList_add(values, rcb->gi);
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ ClientSVControlBlock_create(IedConnection connection, const char* reference)
|
|||
|
||||
if (self) {
|
||||
self->connection = connection;
|
||||
self->reference = copyString(reference);
|
||||
self->reference = StringUtils_copyString(reference);
|
||||
self->isMulticast = isMulticast;
|
||||
}
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ ICLogicalDevice_create(char* name)
|
|||
{
|
||||
ICLogicalDevice* self = (ICLogicalDevice*) GLOBAL_CALLOC(1, sizeof(struct sICLogicalDevice));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ ClientDataSet_create(const char* dataSetReference)
|
|||
{
|
||||
ClientDataSet self = (ClientDataSet) GLOBAL_CALLOC(1, sizeof(struct sClientDataSet));
|
||||
|
||||
self->dataSetReference = copyString(dataSetReference);
|
||||
self->dataSetReference = StringUtils_copyString(dataSetReference);
|
||||
StringUtils_replace(self->dataSetReference, '.', '$');
|
||||
|
||||
self->dataSetValues = NULL;
|
||||
|
@ -743,7 +743,7 @@ IedConnection_readStringValue(IedConnection self, IedClientError* error, const c
|
|||
|
||||
if (value != NULL) {
|
||||
if ((MmsValue_getType(value) == MMS_VISIBLE_STRING) || (MmsValue_getType(value) == MMS_STRING))
|
||||
retVal = copyString(MmsValue_toString(value));
|
||||
retVal = StringUtils_copyString(MmsValue_toString(value));
|
||||
else {
|
||||
if (MmsValue_getType(value) == MMS_DATA_ACCESS_ERROR)
|
||||
*error = iedConnection_mapDataAccessErrorToIedError(MmsValue_getDataAccessError(value));
|
||||
|
@ -1067,7 +1067,7 @@ IedConnection_getLogicalDeviceList(IedConnection self, IedClientError* error)
|
|||
while (logicalDevice != NULL) {
|
||||
ICLogicalDevice* icLogicalDevice = (ICLogicalDevice*) logicalDevice->data;
|
||||
|
||||
char* logicalDeviceName = copyString(icLogicalDevice->name);
|
||||
char* logicalDeviceName = StringUtils_copyString(icLogicalDevice->name);
|
||||
|
||||
LinkedList_add(logicalDeviceList, logicalDeviceName);
|
||||
|
||||
|
@ -1267,7 +1267,7 @@ IedConnection_getLogicalDeviceDirectory(IedConnection self, IedClientError* erro
|
|||
char* variableName = (char*) variable->data;
|
||||
|
||||
if (strchr(variableName, '$') == NULL)
|
||||
LinkedList_add(logicalNodeNames, copyString((char*) variable->data));
|
||||
LinkedList_add(logicalNodeNames, StringUtils_copyString((char*) variable->data));
|
||||
|
||||
variable = LinkedList_getNext(variable);
|
||||
}
|
||||
|
@ -1322,7 +1322,7 @@ addVariablesWithFc(char* fc, char* lnName, LinkedList variables, LinkedList lnDi
|
|||
char* nameEndPos = strchr(fcEndPos + 1, '$');
|
||||
|
||||
if (nameEndPos == NULL)
|
||||
addToStringSet(lnDirectory, copyString(fcEndPos + 1));
|
||||
addToStringSet(lnDirectory, StringUtils_copyString(fcEndPos + 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1363,7 +1363,7 @@ getLogicalNodeDirectoryLogs(IedConnection self, IedClientError* error, const cha
|
|||
logName += 1;
|
||||
|
||||
if (strcmp(journalName, logicalNodeName) == 0) {
|
||||
char* log = copyString(logName);
|
||||
char* log = StringUtils_copyString(logName);
|
||||
LinkedList_add(logs, (void*) log);
|
||||
}
|
||||
}
|
||||
|
@ -1405,7 +1405,7 @@ getLogicalNodeDirectoryDataSets(IedConnection self, IedClientError* error, const
|
|||
lnDataSetName += 1;
|
||||
|
||||
if (strcmp(dataSetName, logicalNodeName) == 0) {
|
||||
char* lnDataSet = copyString(lnDataSetName);
|
||||
char* lnDataSet = StringUtils_copyString(lnDataSetName);
|
||||
LinkedList_add(lnDataSets, (void*) lnDataSet);
|
||||
}
|
||||
}
|
||||
|
@ -1515,7 +1515,7 @@ IedConnection_getLogicalNodeDirectory(IedConnection self, IedClientError* error,
|
|||
char* nameEndPos = strchr(fcEndPos + 1, '$');
|
||||
|
||||
if (nameEndPos == NULL) {
|
||||
char* dataObjectName = copyString(fcEndPos + 1);
|
||||
char* dataObjectName = StringUtils_copyString(fcEndPos + 1);
|
||||
|
||||
if (!addToStringSet(lnDirectory, dataObjectName))
|
||||
GLOBAL_FREEMEM(dataObjectName);
|
||||
|
@ -1539,7 +1539,7 @@ IedConnection_getLogicalNodeDirectory(IedConnection self, IedClientError* error,
|
|||
char* variableName = (char*) variable->data;
|
||||
|
||||
if (strcmp(variableName, "LLN0$SP$SGCB") == 0)
|
||||
LinkedList_add(lnDirectory, (void*) copyString("SGCB"));
|
||||
LinkedList_add(lnDirectory, (void*) StringUtils_copyString("SGCB"));
|
||||
|
||||
variable = LinkedList_getNext(variable);
|
||||
}
|
||||
|
@ -1647,7 +1647,7 @@ IedConnection_getLogicalNodeVariables(IedConnection self, IedClientError* error,
|
|||
int lnNameLen = fcPos - variableName;
|
||||
|
||||
if (strncmp(variableName, logicalNodeName, lnNameLen) == 0) {
|
||||
LinkedList_add(lnDirectory, copyString(fcPos + 1));
|
||||
LinkedList_add(lnDirectory, StringUtils_copyString(fcPos + 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1788,7 +1788,7 @@ getDataDirectory(IedConnection self, IedClientError* error,
|
|||
elementName[elementNameLen + 4] = 0;
|
||||
}
|
||||
else
|
||||
elementName = copyString(subElementName);
|
||||
elementName = StringUtils_copyString(subElementName);
|
||||
|
||||
if (!addToStringSet(dataDirectory, elementName))
|
||||
GLOBAL_FREEMEM(elementName);
|
||||
|
@ -2018,7 +2018,7 @@ IedConnection_createDataSet(IedConnection self, IedClientError* error, const cha
|
|||
goto exit_function;
|
||||
}
|
||||
|
||||
char* itemIdRef = copyStringToBuffer(dataSetReference + domainIdLength + 1, itemIdBuffer);
|
||||
char* itemIdRef = StringUtils_copyStringToBuffer(dataSetReference + domainIdLength + 1, itemIdBuffer);
|
||||
StringUtils_replace(itemIdRef, '.', '$');
|
||||
itemId = itemIdRef;
|
||||
}
|
||||
|
@ -2100,7 +2100,7 @@ IedConnection_deleteDataSet(IedConnection self, IedClientError* error, const cha
|
|||
goto exit_function;
|
||||
}
|
||||
|
||||
copyStringToBuffer(itemIdString, itemId);
|
||||
StringUtils_copyStringToBuffer(itemIdString, itemId);
|
||||
|
||||
StringUtils_replace(itemId, '.', '$');
|
||||
}
|
||||
|
@ -2168,7 +2168,7 @@ IedConnection_getDataSetDirectory(IedConnection self, IedClientError* error, con
|
|||
goto exit_function;
|
||||
}
|
||||
|
||||
char* itemIdRefInBuffer = copyStringToBuffer(itemIdRef, itemIdBuffer);
|
||||
char* itemIdRefInBuffer = StringUtils_copyStringToBuffer(itemIdRef, itemIdBuffer);
|
||||
StringUtils_replace(itemIdRefInBuffer, '.', '$');
|
||||
itemId = itemIdRefInBuffer;
|
||||
}
|
||||
|
@ -2254,7 +2254,7 @@ IedConnection_readDataSetValues(IedConnection self, IedClientError* error, const
|
|||
goto exit_function;
|
||||
}
|
||||
|
||||
char* itemIdRef = copyStringToBuffer(itemIdRefOrig, itemIdBuffer);
|
||||
char* itemIdRef = StringUtils_copyStringToBuffer(itemIdRefOrig, itemIdBuffer);
|
||||
|
||||
StringUtils_replace(itemIdRef, '.', '$');
|
||||
itemId = itemIdRef;
|
||||
|
@ -2412,7 +2412,7 @@ FileDirectoryEntry_create(const char* fileName, uint32_t fileSize, uint64_t last
|
|||
{
|
||||
FileDirectoryEntry self = (FileDirectoryEntry) GLOBAL_CALLOC(1, sizeof(struct sFileDirectoryEntry));
|
||||
|
||||
self->fileName = copyString(fileName);
|
||||
self->fileName = StringUtils_copyString(fileName);
|
||||
self->fileSize = fileSize;
|
||||
self->lastModified = lastModified;
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ createMmsServerCache(IedServer self)
|
|||
|
||||
)
|
||||
{
|
||||
char* variableName = createString(3, lnName, "$", fcName);
|
||||
char* variableName = StringUtils_createString(3, lnName, "$", fcName);
|
||||
|
||||
if (variableName == NULL) goto exit_function;
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ initialize(ControlObject* self)
|
|||
|
||||
self->emptyString = MmsValue_newVisibleString(NULL);
|
||||
|
||||
char* ctlModelName = createString(4, self->lnName, "$CF$", self->name, "$ctlModel");
|
||||
char* ctlModelName = StringUtils_createString(4, self->lnName, "$CF$", self->name, "$ctlModel");
|
||||
|
||||
if (DEBUG_IED_SERVER)
|
||||
printf("initialize control for %s\n", ctlModelName);
|
||||
|
@ -204,7 +204,7 @@ initialize(ControlObject* self)
|
|||
|
||||
GLOBAL_FREEMEM(ctlModelName);
|
||||
|
||||
char* sboClassName = createString(4, self->lnName, "$CF$", self->name, "$sboClass");
|
||||
char* sboClassName = StringUtils_createString(4, self->lnName, "$CF$", self->name, "$sboClass");
|
||||
|
||||
self->sboClass = MmsServer_getValueFromCache(mmsServer, self->mmsDomain, sboClassName);
|
||||
|
||||
|
@ -227,9 +227,9 @@ initialize(ControlObject* self)
|
|||
printf(" ctlModel: %i\n", ctlModelVal);
|
||||
|
||||
if ((ctlModelVal == 2) || (ctlModelVal == 4)) { /* SBO */
|
||||
char* sboTimeoutName = createString(4, self->lnName, "$CF$", self->name, "$sboTimeout");
|
||||
char* sboTimeoutName = StringUtils_createString(4, self->lnName, "$CF$", self->name, "$sboTimeout");
|
||||
|
||||
char* controlObjectReference = createString(6, self->mmsDomain->domainName, "/", self->lnName, "$",
|
||||
char* controlObjectReference = StringUtils_createString(6, self->mmsDomain->domainName, "/", self->lnName, "$",
|
||||
self->name, "$SBO");
|
||||
|
||||
self->sbo = MmsValue_newVisibleString(controlObjectReference);
|
||||
|
@ -451,7 +451,7 @@ ControlObject_create(IedServer iedServer, MmsDomain* domain, char* lnName, char*
|
|||
}
|
||||
#endif
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
|
||||
if (self->name == NULL) {
|
||||
ControlObject_destroy(self);
|
||||
|
|
|
@ -44,7 +44,7 @@ LogInstance_create(LogicalNode* parentLN, const char* name)
|
|||
{
|
||||
LogInstance* self = (LogInstance*) GLOBAL_MALLOC(sizeof(LogInstance));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->parentLN = parentLN;
|
||||
self->logStorage = NULL;
|
||||
self->locked = false;
|
||||
|
@ -613,7 +613,7 @@ createDataSetReferenceForDefaultDataSet(LogControlBlock* lcb, LogControl* logCon
|
|||
char* domainName = MmsDomain_getName(logControl->domain);
|
||||
char* lnName = lcb->parent->name;
|
||||
|
||||
dataSetReference = createString(5, domainName, "/", lnName, "$", lcb->dataSetName);
|
||||
dataSetReference = StringUtils_createString(5, domainName, "/", lnName, "$", lcb->dataSetName);
|
||||
|
||||
return dataSetReference;
|
||||
}
|
||||
|
@ -647,7 +647,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
LogControl* logControl)
|
||||
{
|
||||
MmsVariableSpecification* lcb = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
lcb->name = copyString(logControlBlock->name);
|
||||
lcb->name = StringUtils_copyString(logControlBlock->name);
|
||||
lcb->type = MMS_STRUCTURE;
|
||||
|
||||
MmsValue* mmsValue = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
||||
|
@ -668,7 +668,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
MmsVariableSpecification* namedVariable =
|
||||
(MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
|
||||
namedVariable->name = copyString("LogEna");
|
||||
namedVariable->name = StringUtils_copyString("LogEna");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
|
||||
lcb->typeSpec.structure.elements[0] = namedVariable;
|
||||
|
@ -676,7 +676,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
|
||||
/* LogRef */
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("LogRef");
|
||||
namedVariable->name = StringUtils_copyString("LogRef");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
lcb->typeSpec.structure.elements[1] = namedVariable;
|
||||
|
@ -692,7 +692,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
mmsValue->value.structure.components[1] = MmsValue_newVisibleString(logRef);
|
||||
}
|
||||
else {
|
||||
char* logRef = createString(4, logControl->domain->domainName, "/", logControlBlock->parent->name,
|
||||
char* logRef = StringUtils_createString(4, logControl->domain->domainName, "/", logControlBlock->parent->name,
|
||||
"$GeneralLog");
|
||||
|
||||
mmsValue->value.structure.components[1] = MmsValue_newVisibleString(logRef);
|
||||
|
@ -702,7 +702,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
|
||||
/* DatSet */
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("DatSet");
|
||||
namedVariable->name = StringUtils_copyString("DatSet");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
lcb->typeSpec.structure.elements[2] = namedVariable;
|
||||
|
@ -719,7 +719,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
|
||||
/* OldEntrTm */
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("OldEntrTm");
|
||||
namedVariable->name = StringUtils_copyString("OldEntrTm");
|
||||
namedVariable->type = MMS_BINARY_TIME;
|
||||
namedVariable->typeSpec.binaryTime = 6;
|
||||
lcb->typeSpec.structure.elements[3] = namedVariable;
|
||||
|
@ -730,7 +730,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
|
||||
/* NewEntrTm */
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("NewEntrTm");
|
||||
namedVariable->name = StringUtils_copyString("NewEntrTm");
|
||||
namedVariable->type = MMS_BINARY_TIME;
|
||||
namedVariable->typeSpec.binaryTime = 6;
|
||||
lcb->typeSpec.structure.elements[4] = namedVariable;
|
||||
|
@ -741,7 +741,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
|
||||
/* OldEntr */
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("OldEntr");
|
||||
namedVariable->name = StringUtils_copyString("OldEntr");
|
||||
namedVariable->type = MMS_OCTET_STRING;
|
||||
namedVariable->typeSpec.octetString = 8;
|
||||
|
||||
|
@ -753,7 +753,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
|
||||
/* NewEntr */
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("NewEntr");
|
||||
namedVariable->name = StringUtils_copyString("NewEntr");
|
||||
namedVariable->type = MMS_OCTET_STRING;
|
||||
namedVariable->typeSpec.octetString = 8;
|
||||
|
||||
|
@ -765,7 +765,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
|
||||
/* TrgOps */
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("TrgOps");
|
||||
namedVariable->name = StringUtils_copyString("TrgOps");
|
||||
namedVariable->type = MMS_BIT_STRING;
|
||||
namedVariable->typeSpec.bitString = -6;
|
||||
lcb->typeSpec.structure.elements[7] = namedVariable;
|
||||
|
@ -773,7 +773,7 @@ createLogControlBlock(MmsMapping* self, LogControlBlock* logControlBlock,
|
|||
|
||||
/* IntgPd */
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("IntgPd");
|
||||
namedVariable->name = StringUtils_copyString("IntgPd");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
lcb->typeSpec.structure.elements[8] = namedVariable;
|
||||
|
@ -800,7 +800,7 @@ Logging_createLCBs(MmsMapping* self, MmsDomain* domain, LogicalNode* logicalNode
|
|||
{
|
||||
MmsVariableSpecification* namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1,
|
||||
sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("LG");
|
||||
namedVariable->name = StringUtils_copyString("LG");
|
||||
namedVariable->type = MMS_STRUCTURE;
|
||||
|
||||
namedVariable->typeSpec.structure.elementCount = lcbCount;
|
||||
|
@ -815,7 +815,7 @@ Logging_createLCBs(MmsMapping* self, MmsDomain* domain, LogicalNode* logicalNode
|
|||
|
||||
LogControlBlock* logControlBlock = getLCBForLogicalNodeWithIndex(self, logicalNode, currentLcb);
|
||||
|
||||
logControl->name = createString(3, logicalNode->name, "$LG$", logControlBlock->name);
|
||||
logControl->name = StringUtils_createString(3, logicalNode->name, "$LG$", logControlBlock->name);
|
||||
logControl->domain = domain;
|
||||
|
||||
namedVariable->typeSpec.structure.elements[currentLcb] =
|
||||
|
|
|
@ -191,7 +191,7 @@ MmsGooseControlBlock_enable(MmsGooseControlBlock self)
|
|||
|
||||
if (dataSetRef != NULL) {
|
||||
|
||||
self->dataSetRef = copyString(dataSetRef);
|
||||
self->dataSetRef = StringUtils_copyString(dataSetRef);
|
||||
|
||||
self->dataSet = IedModel_lookupDataSet(self->mmsMapping->model, self->dataSetRef);
|
||||
|
||||
|
@ -363,7 +363,7 @@ static MmsVariableSpecification*
|
|||
createMmsGooseControlBlock(char* gcbName)
|
||||
{
|
||||
MmsVariableSpecification* gcb = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
gcb->name = copyString(gcbName);
|
||||
gcb->name = StringUtils_copyString(gcbName);
|
||||
gcb->type = MMS_STRUCTURE;
|
||||
gcb->typeSpec.structure.elementCount = 9;
|
||||
gcb->typeSpec.structure.elements = (MmsVariableSpecification**) GLOBAL_CALLOC(9, sizeof(MmsVariableSpecification*));
|
||||
|
@ -371,60 +371,60 @@ createMmsGooseControlBlock(char* gcbName)
|
|||
MmsVariableSpecification* namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("GoEna");
|
||||
namedVariable->name = StringUtils_copyString("GoEna");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
|
||||
gcb->typeSpec.structure.elements[0] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("GoID");
|
||||
namedVariable->name = StringUtils_copyString("GoID");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
|
||||
gcb->typeSpec.structure.elements[1] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("DatSet");
|
||||
namedVariable->name = StringUtils_copyString("DatSet");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
|
||||
gcb->typeSpec.structure.elements[2] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("ConfRev");
|
||||
namedVariable->name = StringUtils_copyString("ConfRev");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
|
||||
gcb->typeSpec.structure.elements[3] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("NdsCom");
|
||||
namedVariable->name = StringUtils_copyString("NdsCom");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
|
||||
gcb->typeSpec.structure.elements[4] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("DstAddress");
|
||||
namedVariable->name = StringUtils_copyString("DstAddress");
|
||||
MmsMapping_createPhyComAddrStructure(namedVariable);
|
||||
|
||||
gcb->typeSpec.structure.elements[5] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("MinTime");
|
||||
namedVariable->name = StringUtils_copyString("MinTime");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
|
||||
gcb->typeSpec.structure.elements[6] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("MaxTime");
|
||||
namedVariable->name = StringUtils_copyString("MaxTime");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
|
||||
gcb->typeSpec.structure.elements[7] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("FixedOffs");
|
||||
namedVariable->name = StringUtils_copyString("FixedOffs");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
|
||||
gcb->typeSpec.structure.elements[8] = namedVariable;
|
||||
|
@ -459,7 +459,7 @@ createDataSetReference(char* domainName, char* lnName, char* dataSetName)
|
|||
{
|
||||
char* dataSetReference;
|
||||
|
||||
dataSetReference = createString(5, domainName, "/", lnName, "$", dataSetName);
|
||||
dataSetReference = StringUtils_createString(5, domainName, "/", lnName, "$", dataSetName);
|
||||
|
||||
return dataSetReference;
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ GOOSE_createGOOSEControlBlocks(MmsMapping* self, MmsDomain* domain,
|
|||
{
|
||||
MmsVariableSpecification* namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1,
|
||||
sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("GO");
|
||||
namedVariable->name = StringUtils_copyString("GO");
|
||||
namedVariable->type = MMS_STRUCTURE;
|
||||
|
||||
namedVariable->typeSpec.structure.elementCount = gseCount;
|
||||
|
@ -492,7 +492,7 @@ GOOSE_createGOOSEControlBlocks(MmsMapping* self, MmsDomain* domain,
|
|||
MmsGooseControlBlock mmsGCB = MmsGooseControlBlock_create();
|
||||
|
||||
|
||||
mmsGCB->goCBRef = createString(5, MmsDomain_getName(domain), "/", logicalNode->name,
|
||||
mmsGCB->goCBRef = StringUtils_createString(5, MmsDomain_getName(domain), "/", logicalNode->name,
|
||||
"$GO$", gooseControlBlock->name);
|
||||
|
||||
if (gooseControlBlock->appId != NULL) {
|
||||
|
@ -500,7 +500,7 @@ GOOSE_createGOOSEControlBlocks(MmsMapping* self, MmsDomain* domain,
|
|||
|
||||
MmsValue_setVisibleString(goID, gooseControlBlock->appId);
|
||||
|
||||
mmsGCB->goId = copyString(gooseControlBlock->appId);
|
||||
mmsGCB->goId = StringUtils_copyString(gooseControlBlock->appId);
|
||||
}
|
||||
|
||||
if (gooseControlBlock->dataSetName != NULL)
|
||||
|
|
|
@ -92,25 +92,25 @@ MmsMapping_createPhyComAddrStructure(MmsVariableSpecification* namedVariable)
|
|||
MmsVariableSpecification* element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("Addr");
|
||||
element->name = StringUtils_copyString("Addr");
|
||||
element->type = MMS_OCTET_STRING;
|
||||
element->typeSpec.octetString = 6;
|
||||
namedVariable->typeSpec.structure.elements[0] = element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("PRIORITY");
|
||||
element->name = StringUtils_copyString("PRIORITY");
|
||||
element->type = MMS_UNSIGNED;
|
||||
element->typeSpec.unsignedInteger = 8;
|
||||
namedVariable->typeSpec.structure.elements[1] = element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("VID");
|
||||
element->name = StringUtils_copyString("VID");
|
||||
element->type = MMS_UNSIGNED;
|
||||
element->typeSpec.unsignedInteger = 16;
|
||||
namedVariable->typeSpec.structure.elements[2] = element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("APPID");
|
||||
element->name = StringUtils_copyString("APPID");
|
||||
element->type = MMS_UNSIGNED;
|
||||
element->typeSpec.unsignedInteger = 16;
|
||||
namedVariable->typeSpec.structure.elements[3] = element;
|
||||
|
@ -121,7 +121,7 @@ createNamedVariableFromDataAttribute(DataAttribute* attribute)
|
|||
{
|
||||
MmsVariableSpecification* origNamedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1,
|
||||
sizeof(MmsVariableSpecification));
|
||||
origNamedVariable->name = copyString(attribute->name);
|
||||
origNamedVariable->name = StringUtils_copyString(attribute->name);
|
||||
|
||||
MmsVariableSpecification* namedVariable = origNamedVariable;
|
||||
|
||||
|
@ -316,7 +316,7 @@ createFCNamedVariableFromDataObject(DataObject* dataObject,
|
|||
|
||||
MmsVariableSpecification* completeNamedVariable = namedVariable;
|
||||
|
||||
namedVariable->name = copyString(dataObject->name);
|
||||
namedVariable->name = StringUtils_copyString(dataObject->name);
|
||||
|
||||
if (dataObject->elementCount > 0) {
|
||||
namedVariable->type = MMS_ARRAY;
|
||||
|
@ -371,7 +371,7 @@ createFCNamedVariable(LogicalNode* logicalNode, FunctionalConstraint fc)
|
|||
{
|
||||
MmsVariableSpecification* namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1,
|
||||
sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString(FunctionalConstraint_toString(fc));
|
||||
namedVariable->name = StringUtils_copyString(FunctionalConstraint_toString(fc));
|
||||
namedVariable->type = MMS_STRUCTURE;
|
||||
|
||||
int dataObjectCount = 0;
|
||||
|
@ -415,7 +415,7 @@ createSGCB(void)
|
|||
{
|
||||
MmsVariableSpecification* namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1,
|
||||
sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("SGCB");
|
||||
namedVariable->name = StringUtils_copyString("SGCB");
|
||||
namedVariable->type = MMS_STRUCTURE;
|
||||
|
||||
namedVariable->typeSpec.structure.elementCount = 6;
|
||||
|
@ -425,35 +425,35 @@ createSGCB(void)
|
|||
MmsVariableSpecification* element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("NumOfSG");
|
||||
element->name = StringUtils_copyString("NumOfSG");
|
||||
element->type = MMS_UNSIGNED;
|
||||
element->typeSpec.integer = 8;
|
||||
namedVariable->typeSpec.structure.elements[0] = element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("ActSG");
|
||||
element->name = StringUtils_copyString("ActSG");
|
||||
element->type = MMS_UNSIGNED;
|
||||
element->typeSpec.integer = 8;
|
||||
namedVariable->typeSpec.structure.elements[1] = element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("EditSG");
|
||||
element->name = StringUtils_copyString("EditSG");
|
||||
element->type = MMS_UNSIGNED;
|
||||
element->typeSpec.integer = 8;
|
||||
namedVariable->typeSpec.structure.elements[2] = element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("CnfEdit");
|
||||
element->name = StringUtils_copyString("CnfEdit");
|
||||
element->type = MMS_BOOLEAN;
|
||||
namedVariable->typeSpec.structure.elements[3] = element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("LActTm");
|
||||
element->name = StringUtils_copyString("LActTm");
|
||||
element->type = MMS_UTC_TIME;
|
||||
namedVariable->typeSpec.structure.elements[4] = element;
|
||||
|
||||
element = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
element->name = copyString("ResvTms");
|
||||
element->name = StringUtils_copyString("ResvTms");
|
||||
element->type = MMS_UNSIGNED;
|
||||
element->typeSpec.integer = 16;
|
||||
namedVariable->typeSpec.structure.elements[5] = element;
|
||||
|
@ -467,7 +467,7 @@ createFCNamedVariableSPWithSGCB(LogicalNode* logicalNode)
|
|||
{
|
||||
MmsVariableSpecification* namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1,
|
||||
sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("SP");
|
||||
namedVariable->name = StringUtils_copyString("SP");
|
||||
namedVariable->type = MMS_STRUCTURE;
|
||||
|
||||
int dataObjectCount = 1;
|
||||
|
@ -839,7 +839,7 @@ createNamedVariableFromLogicalNode(MmsMapping* self, MmsDomain* domain,
|
|||
MmsVariableSpecification* namedVariable = (MmsVariableSpecification*)
|
||||
GLOBAL_MALLOC(sizeof(MmsVariableSpecification));
|
||||
|
||||
namedVariable->name = copyString(logicalNode->name);
|
||||
namedVariable->name = StringUtils_copyString(logicalNode->name);
|
||||
|
||||
namedVariable->type = MMS_STRUCTURE;
|
||||
|
||||
|
@ -3211,7 +3211,7 @@ MmsMapping_ObjectReferenceToVariableAccessSpec(char* objectReference)
|
|||
MmsVariableAccessSpecification* accessSpec =
|
||||
(MmsVariableAccessSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableAccessSpecification));
|
||||
|
||||
accessSpec->domainId = createStringFromBuffer((uint8_t*) objectReference, domainIdLen);
|
||||
accessSpec->domainId = StringUtils_createStringFromBuffer((uint8_t*) objectReference, domainIdLen);
|
||||
|
||||
char* indexBrace = strchr(domainIdEnd, '(');
|
||||
|
||||
|
@ -3249,7 +3249,7 @@ MmsMapping_ObjectReferenceToVariableAccessSpec(char* objectReference)
|
|||
int componentNameLen = objRefLen - ((indexEnd + 2) - objectReference) - 4;
|
||||
|
||||
if (componentNameLen > 0) {
|
||||
accessSpec->componentName = createStringFromBuffer((uint8_t*) (indexEnd + 2), componentNameLen);
|
||||
accessSpec->componentName = StringUtils_createStringFromBuffer((uint8_t*) (indexEnd + 2), componentNameLen);
|
||||
StringUtils_replace(accessSpec->componentName, '.', '$');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ static MmsVariableSpecification*
|
|||
createSVControlBlockMmsStructure(char* gcbName, bool isUnicast)
|
||||
{
|
||||
MmsVariableSpecification* gcb = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
gcb->name = copyString(gcbName);
|
||||
gcb->name = StringUtils_copyString(gcbName);
|
||||
gcb->type = MMS_STRUCTURE;
|
||||
|
||||
int elementCount;
|
||||
|
@ -295,14 +295,14 @@ createSVControlBlockMmsStructure(char* gcbName, bool isUnicast)
|
|||
MmsVariableSpecification* namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("SvEna");
|
||||
namedVariable->name = StringUtils_copyString("SvEna");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
|
||||
gcb->typeSpec.structure.elements[currentElement++] = namedVariable;
|
||||
|
||||
if (isUnicast) {
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("Resv");
|
||||
namedVariable->name = StringUtils_copyString("Resv");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
|
||||
gcb->typeSpec.structure.elements[currentElement++] = namedVariable;
|
||||
|
@ -310,57 +310,57 @@ createSVControlBlockMmsStructure(char* gcbName, bool isUnicast)
|
|||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
if (isUnicast)
|
||||
namedVariable->name = copyString("UsvID");
|
||||
namedVariable->name = StringUtils_copyString("UsvID");
|
||||
else
|
||||
namedVariable->name = copyString("MsvID");
|
||||
namedVariable->name = StringUtils_copyString("MsvID");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
|
||||
gcb->typeSpec.structure.elements[currentElement++] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("DatSet");
|
||||
namedVariable->name = StringUtils_copyString("DatSet");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
|
||||
gcb->typeSpec.structure.elements[currentElement++] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("ConfRev");
|
||||
namedVariable->name = StringUtils_copyString("ConfRev");
|
||||
namedVariable->type = MMS_INTEGER;
|
||||
namedVariable->typeSpec.integer = 32;
|
||||
|
||||
gcb->typeSpec.structure.elements[currentElement++] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("SmpRate");
|
||||
namedVariable->name = StringUtils_copyString("SmpRate");
|
||||
namedVariable->type = MMS_INTEGER;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
|
||||
gcb->typeSpec.structure.elements[currentElement++] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("OptFlds");
|
||||
namedVariable->name = StringUtils_copyString("OptFlds");
|
||||
namedVariable->type = MMS_BIT_STRING;
|
||||
namedVariable->typeSpec.bitString = 5;
|
||||
|
||||
gcb->typeSpec.structure.elements[currentElement++] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("SmpMod");
|
||||
namedVariable->name = StringUtils_copyString("SmpMod");
|
||||
namedVariable->type = MMS_INTEGER;
|
||||
namedVariable->typeSpec.integer = 8;
|
||||
|
||||
gcb->typeSpec.structure.elements[currentElement++] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("DstAddress");
|
||||
namedVariable->name = StringUtils_copyString("DstAddress");
|
||||
MmsMapping_createPhyComAddrStructure(namedVariable);
|
||||
|
||||
gcb->typeSpec.structure.elements[currentElement++] = namedVariable;
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("noASDU");
|
||||
namedVariable->name = StringUtils_copyString("noASDU");
|
||||
namedVariable->type = MMS_INTEGER;
|
||||
namedVariable->typeSpec.integer = 32;
|
||||
|
||||
|
@ -406,9 +406,9 @@ LIBIEC61850_SV_createSVControlBlocks(MmsMapping* self, MmsDomain* domain,
|
|||
sizeof(MmsVariableSpecification));
|
||||
|
||||
if (unicast)
|
||||
namedVariable->name = copyString("US");
|
||||
namedVariable->name = StringUtils_copyString("US");
|
||||
else
|
||||
namedVariable->name = copyString("MS");
|
||||
namedVariable->name = StringUtils_copyString("MS");
|
||||
|
||||
namedVariable->type = MMS_STRUCTURE;
|
||||
|
||||
|
|
|
@ -617,7 +617,7 @@ createDataSetReferenceForDefaultDataSet(ReportControlBlock* rcb, ReportControl*
|
|||
char* domainName = MmsDomain_getName(reportControl->domain);
|
||||
char* lnName = rcb->parent->name;
|
||||
|
||||
dataSetReference = createString(5, domainName, "/", lnName, "$", rcb->dataSetName);
|
||||
dataSetReference = StringUtils_createString(5, domainName, "/", lnName, "$", rcb->dataSetName);
|
||||
|
||||
return dataSetReference;
|
||||
}
|
||||
|
@ -750,7 +750,7 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
ReportControl* reportControl)
|
||||
{
|
||||
MmsVariableSpecification* rcb = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
rcb->name = copyString(reportControlBlock->name);
|
||||
rcb->name = StringUtils_copyString(reportControlBlock->name);
|
||||
rcb->type = MMS_STRUCTURE;
|
||||
|
||||
MmsValue* mmsValue = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
||||
|
@ -773,7 +773,7 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
|
||||
MmsVariableSpecification* namedVariable =
|
||||
(MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("RptID");
|
||||
namedVariable->name = StringUtils_copyString("RptID");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
rcb->typeSpec.structure.elements[0] = namedVariable;
|
||||
|
@ -784,19 +784,19 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
mmsValue->value.structure.components[0] = createDefaultRptId(reportControl);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("RptEna");
|
||||
namedVariable->name = StringUtils_copyString("RptEna");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
rcb->typeSpec.structure.elements[1] = namedVariable;
|
||||
mmsValue->value.structure.components[1] = MmsValue_newBoolean(false);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("Resv");
|
||||
namedVariable->name = StringUtils_copyString("Resv");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
rcb->typeSpec.structure.elements[2] = namedVariable;
|
||||
mmsValue->value.structure.components[2] = MmsValue_newBoolean(false);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("DatSet");
|
||||
namedVariable->name = StringUtils_copyString("DatSet");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
rcb->typeSpec.structure.elements[3] = namedVariable;
|
||||
|
@ -811,7 +811,7 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
mmsValue->value.structure.components[3] = MmsValue_newVisibleString("");
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("ConfRev");
|
||||
namedVariable->name = StringUtils_copyString("ConfRev");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
rcb->typeSpec.structure.elements[4] = namedVariable;
|
||||
|
@ -821,14 +821,14 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
reportControl->confRev = mmsValue->value.structure.components[4];
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("OptFlds");
|
||||
namedVariable->name = StringUtils_copyString("OptFlds");
|
||||
namedVariable->type = MMS_BIT_STRING;
|
||||
namedVariable->typeSpec.bitString = -10;
|
||||
rcb->typeSpec.structure.elements[5] = namedVariable;
|
||||
mmsValue->value.structure.components[5] = createOptFlds(reportControlBlock);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("BufTm");
|
||||
namedVariable->name = StringUtils_copyString("BufTm");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
rcb->typeSpec.structure.elements[6] = namedVariable;
|
||||
|
@ -836,21 +836,21 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
MmsValue_newUnsignedFromUint32(reportControlBlock->bufferTime);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("SqNum");
|
||||
namedVariable->name = StringUtils_copyString("SqNum");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 8;
|
||||
rcb->typeSpec.structure.elements[7] = namedVariable;
|
||||
mmsValue->value.structure.components[7] = MmsValue_newUnsigned(8);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("TrgOps");
|
||||
namedVariable->name = StringUtils_copyString("TrgOps");
|
||||
namedVariable->type = MMS_BIT_STRING;
|
||||
namedVariable->typeSpec.bitString = -6;
|
||||
rcb->typeSpec.structure.elements[8] = namedVariable;
|
||||
mmsValue->value.structure.components[8] = createTrgOps(reportControlBlock);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("IntgPd");
|
||||
namedVariable->name = StringUtils_copyString("IntgPd");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
rcb->typeSpec.structure.elements[9] = namedVariable;
|
||||
|
@ -858,14 +858,14 @@ createUnbufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
MmsValue_newUnsignedFromUint32(reportControlBlock->intPeriod);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("GI");
|
||||
namedVariable->name = StringUtils_copyString("GI");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
rcb->typeSpec.structure.elements[10] = namedVariable;
|
||||
mmsValue->value.structure.components[10] = MmsValue_newBoolean(false);
|
||||
|
||||
#if (CONFIG_REPORTING_SUPPORTS_OWNER == 1)
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("Owner");
|
||||
namedVariable->name = StringUtils_copyString("Owner");
|
||||
namedVariable->type = MMS_OCTET_STRING;
|
||||
namedVariable->typeSpec.octetString = -64;
|
||||
rcb->typeSpec.structure.elements[11] = namedVariable;
|
||||
|
@ -888,7 +888,7 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
ReportControl* reportControl, MmsMapping* mmsMapping)
|
||||
{
|
||||
MmsVariableSpecification* rcb = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
rcb->name = copyString(reportControlBlock->name);
|
||||
rcb->name = StringUtils_copyString(reportControlBlock->name);
|
||||
rcb->type = MMS_STRUCTURE;
|
||||
|
||||
int brcbElementCount = 13;
|
||||
|
@ -913,7 +913,7 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
|
||||
MmsVariableSpecification* namedVariable =
|
||||
(MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("RptID");
|
||||
namedVariable->name = StringUtils_copyString("RptID");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
rcb->typeSpec.structure.elements[0] = namedVariable;
|
||||
|
@ -925,13 +925,13 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
mmsValue->value.structure.components[0] = createDefaultRptId(reportControl);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("RptEna");
|
||||
namedVariable->name = StringUtils_copyString("RptEna");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
rcb->typeSpec.structure.elements[1] = namedVariable;
|
||||
mmsValue->value.structure.components[1] = MmsValue_newBoolean(false);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("DatSet");
|
||||
namedVariable->name = StringUtils_copyString("DatSet");
|
||||
namedVariable->typeSpec.visibleString = -129;
|
||||
namedVariable->type = MMS_VISIBLE_STRING;
|
||||
rcb->typeSpec.structure.elements[2] = namedVariable;
|
||||
|
@ -947,7 +947,7 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
mmsValue->value.structure.components[2] = MmsValue_newVisibleString("");
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("ConfRev");
|
||||
namedVariable->name = StringUtils_copyString("ConfRev");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
rcb->typeSpec.structure.elements[3] = namedVariable;
|
||||
|
@ -957,14 +957,14 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
reportControl->confRev = mmsValue->value.structure.components[3];
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("OptFlds");
|
||||
namedVariable->name = StringUtils_copyString("OptFlds");
|
||||
namedVariable->type = MMS_BIT_STRING;
|
||||
namedVariable->typeSpec.bitString = -10;
|
||||
rcb->typeSpec.structure.elements[4] = namedVariable;
|
||||
mmsValue->value.structure.components[4] = createOptFlds(reportControlBlock);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("BufTm");
|
||||
namedVariable->name = StringUtils_copyString("BufTm");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
rcb->typeSpec.structure.elements[5] = namedVariable;
|
||||
|
@ -972,21 +972,21 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
MmsValue_newUnsignedFromUint32(reportControlBlock->bufferTime);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("SqNum");
|
||||
namedVariable->name = StringUtils_copyString("SqNum");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 16;
|
||||
rcb->typeSpec.structure.elements[6] = namedVariable;
|
||||
mmsValue->value.structure.components[6] = MmsValue_newUnsigned(16);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("TrgOps");
|
||||
namedVariable->name = StringUtils_copyString("TrgOps");
|
||||
namedVariable->type = MMS_BIT_STRING;
|
||||
namedVariable->typeSpec.bitString = -6;
|
||||
rcb->typeSpec.structure.elements[7] = namedVariable;
|
||||
mmsValue->value.structure.components[7] = createTrgOps(reportControlBlock);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("IntgPd");
|
||||
namedVariable->name = StringUtils_copyString("IntgPd");
|
||||
namedVariable->type = MMS_UNSIGNED;
|
||||
namedVariable->typeSpec.unsignedInteger = 32;
|
||||
rcb->typeSpec.structure.elements[8] = namedVariable;
|
||||
|
@ -994,26 +994,26 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
MmsValue_newUnsignedFromUint32(reportControlBlock->intPeriod);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("GI");
|
||||
namedVariable->name = StringUtils_copyString("GI");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
rcb->typeSpec.structure.elements[9] = namedVariable;
|
||||
mmsValue->value.structure.components[9] = MmsValue_newBoolean(false);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("PurgeBuf");
|
||||
namedVariable->name = StringUtils_copyString("PurgeBuf");
|
||||
namedVariable->type = MMS_BOOLEAN;
|
||||
rcb->typeSpec.structure.elements[10] = namedVariable;
|
||||
mmsValue->value.structure.components[10] = MmsValue_newBoolean(false);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("EntryID");
|
||||
namedVariable->name = StringUtils_copyString("EntryID");
|
||||
namedVariable->type = MMS_OCTET_STRING;
|
||||
namedVariable->typeSpec.octetString = 8;
|
||||
rcb->typeSpec.structure.elements[11] = namedVariable;
|
||||
mmsValue->value.structure.components[11] = MmsValue_newOctetString(8, 8);
|
||||
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("TimeofEntry");
|
||||
namedVariable->name = StringUtils_copyString("TimeofEntry");
|
||||
namedVariable->type = MMS_BINARY_TIME;
|
||||
namedVariable->typeSpec.binaryTime = 6;
|
||||
rcb->typeSpec.structure.elements[12] = namedVariable;
|
||||
|
@ -1027,7 +1027,7 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
|
||||
#if (CONFIG_IEC61850_BRCB_WITH_RESVTMS == 1)
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("ResvTms");
|
||||
namedVariable->name = StringUtils_copyString("ResvTms");
|
||||
namedVariable->type = MMS_INTEGER;
|
||||
namedVariable->typeSpec.integer = 16;
|
||||
rcb->typeSpec.structure.elements[currentIndex] = namedVariable;
|
||||
|
@ -1037,7 +1037,7 @@ createBufferedReportControlBlock(ReportControlBlock* reportControlBlock,
|
|||
|
||||
#if (CONFIG_REPORTING_SUPPORTS_OWNER == 1)
|
||||
namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1, sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("Owner");
|
||||
namedVariable->name = StringUtils_copyString("Owner");
|
||||
namedVariable->type = MMS_OCTET_STRING;
|
||||
namedVariable->typeSpec.octetString = -64;
|
||||
rcb->typeSpec.structure.elements[currentIndex] = namedVariable;
|
||||
|
@ -1086,7 +1086,7 @@ Reporting_createMmsBufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|||
{
|
||||
MmsVariableSpecification* namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1,
|
||||
sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("BR");
|
||||
namedVariable->name = StringUtils_copyString("BR");
|
||||
namedVariable->type = MMS_STRUCTURE;
|
||||
|
||||
namedVariable->typeSpec.structure.elementCount = reportsCount;
|
||||
|
@ -1103,7 +1103,7 @@ Reporting_createMmsBufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|||
ReportControlBlock* reportControlBlock = getRCBForLogicalNodeWithIndex(
|
||||
self, logicalNode, currentReport, true);
|
||||
|
||||
rc->name = createString(3, logicalNode->name, "$BR$",
|
||||
rc->name = StringUtils_createString(3, logicalNode->name, "$BR$",
|
||||
reportControlBlock->name);
|
||||
|
||||
namedVariable->typeSpec.structure.elements[currentReport] =
|
||||
|
@ -1123,7 +1123,7 @@ Reporting_createMmsUnbufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|||
{
|
||||
MmsVariableSpecification* namedVariable = (MmsVariableSpecification*) GLOBAL_CALLOC(1,
|
||||
sizeof(MmsVariableSpecification));
|
||||
namedVariable->name = copyString("RP");
|
||||
namedVariable->name = StringUtils_copyString("RP");
|
||||
namedVariable->type = MMS_STRUCTURE;
|
||||
|
||||
namedVariable->typeSpec.structure.elementCount = reportsCount;
|
||||
|
@ -1140,7 +1140,7 @@ Reporting_createMmsUnbufferedRCBs(MmsMapping* self, MmsDomain* domain,
|
|||
ReportControlBlock* reportControlBlock = getRCBForLogicalNodeWithIndex(
|
||||
self, logicalNode, currentReport, false);
|
||||
|
||||
rc->name = createString(3, logicalNode->name, "$RP$",
|
||||
rc->name = StringUtils_createString(3, logicalNode->name, "$RP$",
|
||||
reportControlBlock->name);
|
||||
|
||||
namedVariable->typeSpec.structure.elements[currentReport] =
|
||||
|
|
|
@ -37,7 +37,7 @@ IedModel_setIedNameForDynamicModel(IedModel* self, const char* name)
|
|||
if (self->name != NULL)
|
||||
GLOBAL_FREEMEM(self->name);
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
}
|
||||
|
||||
IedModel*
|
||||
|
@ -46,7 +46,7 @@ IedModel_create(const char* name/*, MemoryAllocator allocator*/)
|
|||
IedModel* self = (IedModel*) GLOBAL_CALLOC(1, sizeof(IedModel));
|
||||
|
||||
if (name)
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
else
|
||||
self->name = NULL;
|
||||
|
||||
|
@ -184,7 +184,7 @@ LogicalDevice_create(const char* name, IedModel* parent)
|
|||
{
|
||||
LogicalDevice* self = (LogicalDevice*) GLOBAL_CALLOC(1, sizeof(LogicalDevice));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->modelType = LogicalDeviceModelType;
|
||||
self->parent = (ModelNode*) parent;
|
||||
self->sibling = NULL;
|
||||
|
@ -226,7 +226,7 @@ LogicalNode_create(const char* name, LogicalDevice* parent)
|
|||
{
|
||||
LogicalNode* self = (LogicalNode*) GLOBAL_MALLOC(sizeof(LogicalNode));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->parent = (ModelNode*) parent;
|
||||
self->modelType = LogicalNodeModelType;
|
||||
self->firstChild = NULL;
|
||||
|
@ -278,7 +278,7 @@ Log_create(const char* name, LogicalNode* parent)
|
|||
{
|
||||
Log* self = (Log*) GLOBAL_MALLOC(sizeof(Log));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->parent = parent;
|
||||
self->sibling = NULL;
|
||||
|
||||
|
@ -301,17 +301,17 @@ LogControlBlock_create(const char* name, LogicalNode* parent, char* dataSetName,
|
|||
{
|
||||
LogControlBlock* self = (LogControlBlock*) GLOBAL_MALLOC(sizeof(LogControlBlock));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->parent = parent;
|
||||
self->sibling = NULL;
|
||||
|
||||
if (dataSetName)
|
||||
self->dataSetName = copyString(dataSetName);
|
||||
self->dataSetName = StringUtils_copyString(dataSetName);
|
||||
else
|
||||
self->dataSetName = NULL;
|
||||
|
||||
if (logRef)
|
||||
self->logRef = copyString(logRef);
|
||||
self->logRef = StringUtils_copyString(logRef);
|
||||
else
|
||||
self->logRef = NULL;
|
||||
|
||||
|
@ -339,18 +339,18 @@ ReportControlBlock_create(const char* name, LogicalNode* parent, char* rptId, bo
|
|||
{
|
||||
ReportControlBlock* self = (ReportControlBlock*) GLOBAL_MALLOC(sizeof(ReportControlBlock));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->parent = parent;
|
||||
|
||||
if (rptId)
|
||||
self->rptId = copyString(rptId);
|
||||
self->rptId = StringUtils_copyString(rptId);
|
||||
else
|
||||
self->rptId = NULL;
|
||||
|
||||
self->buffered = isBuffered;
|
||||
|
||||
if (dataSetName)
|
||||
self->dataSetName = copyString(dataSetName);
|
||||
self->dataSetName = StringUtils_copyString(dataSetName);
|
||||
else
|
||||
self->dataSetName = NULL;
|
||||
|
||||
|
@ -409,16 +409,16 @@ GSEControlBlock_create(const char* name, LogicalNode* parent, char* appId, char*
|
|||
{
|
||||
GSEControlBlock* self = (GSEControlBlock*) GLOBAL_MALLOC(sizeof(GSEControlBlock));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->parent = parent;
|
||||
|
||||
if (appId)
|
||||
self->appId = copyString(appId);
|
||||
self->appId = StringUtils_copyString(appId);
|
||||
else
|
||||
self->appId = NULL;
|
||||
|
||||
if (dataSet)
|
||||
self->dataSetName = copyString(dataSet);
|
||||
self->dataSetName = StringUtils_copyString(dataSet);
|
||||
else
|
||||
self->dataSetName = NULL;
|
||||
|
||||
|
@ -443,13 +443,13 @@ SVControlBlock_create(const char* name, LogicalNode* parent, char* svID, char* d
|
|||
{
|
||||
SVControlBlock* self = (SVControlBlock*) GLOBAL_MALLOC(sizeof(SVControlBlock));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->parent = parent;
|
||||
|
||||
self->svId = copyString(svID); /* Is there a default value? */
|
||||
self->svId = StringUtils_copyString(svID); /* Is there a default value? */
|
||||
|
||||
if (dataSet)
|
||||
self->dataSetName = copyString(dataSet);
|
||||
self->dataSetName = StringUtils_copyString(dataSet);
|
||||
else
|
||||
self->dataSetName = NULL;
|
||||
|
||||
|
@ -522,7 +522,7 @@ DataObject_create(const char* name, ModelNode* parent, int arrayElements)
|
|||
{
|
||||
DataObject* self = (DataObject*) GLOBAL_MALLOC(sizeof(DataObject));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->modelType = DataObjectModelType;
|
||||
self->elementCount = arrayElements;
|
||||
self->firstChild = NULL;
|
||||
|
@ -570,7 +570,7 @@ DataAttribute_create(const char* name, ModelNode* parent, DataAttributeType type
|
|||
{
|
||||
DataAttribute* self = (DataAttribute*) GLOBAL_MALLOC(sizeof(DataAttribute));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->elementCount = arrayElements;
|
||||
self->modelType = DataAttributeModelType;
|
||||
self->type = type;
|
||||
|
@ -597,7 +597,7 @@ DataSet_create(const char* name, LogicalNode* parent)
|
|||
|
||||
LogicalDevice* ld = (LogicalDevice*) parent->parent;
|
||||
|
||||
self->name = createString(3, parent->name, "$", name);
|
||||
self->name = StringUtils_createString(3, parent->name, "$", name);
|
||||
self->elementCount = 0;
|
||||
self->sibling = NULL;
|
||||
self->logicalDeviceName = ld->name;
|
||||
|
@ -662,18 +662,18 @@ DataSetEntry_create(DataSet* dataSet, const char* variable, int index, const cha
|
|||
if (separator != NULL) {
|
||||
*separator = 0;
|
||||
|
||||
self->variableName = copyString(separator + 1);
|
||||
self->logicalDeviceName = copyString(variableName);
|
||||
self->variableName = StringUtils_copyString(separator + 1);
|
||||
self->logicalDeviceName = StringUtils_copyString(variableName);
|
||||
self->isLDNameDynamicallyAllocated = true;
|
||||
}
|
||||
else {
|
||||
self->variableName = copyString(variable);
|
||||
self->variableName = StringUtils_copyString(variable);
|
||||
self->logicalDeviceName = dataSet->logicalDeviceName;
|
||||
self->isLDNameDynamicallyAllocated = false;
|
||||
}
|
||||
|
||||
if (component != NULL)
|
||||
self->componentName = copyString(component);
|
||||
self->componentName = StringUtils_copyString(component);
|
||||
else
|
||||
self->componentName = NULL;
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ AcseAuthenticationParameter_destroy(AcseAuthenticationParameter self)
|
|||
void
|
||||
AcseAuthenticationParameter_setPassword(AcseAuthenticationParameter self, char* password)
|
||||
{
|
||||
self->value.password.octetString = (uint8_t*) copyString(password);
|
||||
self->value.password.octetString = (uint8_t*) StringUtils_copyString(password);
|
||||
self->value.password.passwordLength = strlen(password);
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ handleUnconfirmedMmsPdu(MmsConnection self, ByteBuffer* message)
|
|||
uint8_t* buffer =
|
||||
report->variableAccessSpecification.choice.variableListName.choice.vmdspecific.buf;
|
||||
|
||||
char* variableListName = createStringFromBuffer(buffer, nameSize);
|
||||
char* variableListName = StringUtils_createStringFromBuffer(buffer, nameSize);
|
||||
|
||||
int listSize = report->listOfAccessResult.list.count;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ mmsClient_createMmsGetNameListRequestVMDspecific(long invokeId, ByteBuffer* writ
|
|||
|
||||
if (continueAfter != NULL) {
|
||||
request->continueAfter = (Identifier_t*) GLOBAL_CALLOC(1, sizeof(Identifier_t));
|
||||
request->continueAfter->buf = (uint8_t*) copyString(continueAfter);
|
||||
request->continueAfter->buf = (uint8_t*) StringUtils_copyString(continueAfter);
|
||||
request->continueAfter->size = strlen(continueAfter);
|
||||
}
|
||||
else
|
||||
|
@ -84,7 +84,7 @@ mmsClient_createMmsGetNameListRequestAssociationSpecific(long invokeId, ByteBuff
|
|||
|
||||
if (continueAfter != NULL) {
|
||||
request->continueAfter = (Identifier_t*) GLOBAL_CALLOC(1, sizeof(Identifier_t));
|
||||
request->continueAfter->buf = (uint8_t*) copyString(continueAfter);
|
||||
request->continueAfter->buf = (uint8_t*) StringUtils_copyString(continueAfter);
|
||||
request->continueAfter->size = strlen(continueAfter);
|
||||
}
|
||||
else
|
||||
|
@ -166,7 +166,7 @@ mmsClient_parseGetNameListResponse(LinkedList* nameList, ByteBuffer* message, ui
|
|||
bufPos = BerDecoder_decodeLength(buffer, &length, bufPos, maxBufPos);
|
||||
if (bufPos < 0) goto exit_error;
|
||||
|
||||
char* variableName = createStringFromBuffer(buffer + bufPos, length);
|
||||
char* variableName = StringUtils_createStringFromBuffer(buffer + bufPos, length);
|
||||
|
||||
element = LinkedList_insertAfter(element, variableName);
|
||||
|
||||
|
@ -211,7 +211,7 @@ mmsClient_createGetNameListRequestDomainOrVMDSpecific(long invokeId, const char*
|
|||
|
||||
if (continueAfter != NULL) {
|
||||
request->continueAfter = (Identifier_t*) GLOBAL_CALLOC(1, sizeof(Identifier_t));
|
||||
request->continueAfter->buf = (uint8_t*) copyString(continueAfter);
|
||||
request->continueAfter->buf = (uint8_t*) StringUtils_copyString(continueAfter);
|
||||
request->continueAfter->size = strlen(continueAfter);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -50,7 +50,7 @@ createTypeSpecification(TypeSpecification_t* asnTypeSpec) {
|
|||
|
||||
for (i = 0; i < elementCount; i++) {
|
||||
|
||||
char* name = createStringFromBuffer(
|
||||
char* name = StringUtils_createStringFromBuffer(
|
||||
asnTypeSpec->choice.structure.components.list.array[i]->componentName->buf,
|
||||
asnTypeSpec->choice.structure.components.list.array[i]->componentName->size);
|
||||
|
||||
|
|
|
@ -84,15 +84,15 @@ mmsClient_parseIdentifyResponse(MmsConnection self)
|
|||
|
||||
switch (tag) {
|
||||
case 0x80: /* vendorName */
|
||||
vendorName = createStringFromBuffer(buffer + bufPos, length);
|
||||
vendorName = StringUtils_createStringFromBuffer(buffer + bufPos, length);
|
||||
bufPos += length;
|
||||
break;
|
||||
case 0x81: /* modelName */
|
||||
modelName = createStringFromBuffer(buffer + bufPos, length);
|
||||
modelName = StringUtils_createStringFromBuffer(buffer + bufPos, length);
|
||||
bufPos += length;
|
||||
break;
|
||||
case 0x82: /* revision */
|
||||
revision = createStringFromBuffer(buffer + bufPos, length);
|
||||
revision = StringUtils_createStringFromBuffer(buffer + bufPos, length);
|
||||
bufPos += length;
|
||||
break;
|
||||
case 0x83: /* list of abstract syntaxes */
|
||||
|
|
|
@ -57,14 +57,14 @@ mmsClient_createDeleteNamedVariableListRequest(long invokeId, ByteBuffer* writeB
|
|||
if (domainId != NULL) {
|
||||
request->listOfVariableListName->list.array[0]->present = ObjectName_PR_domainspecific;
|
||||
request->listOfVariableListName->list.array[0]->choice.domainspecific.domainId.size = strlen(domainId);
|
||||
request->listOfVariableListName->list.array[0]->choice.domainspecific.domainId.buf = (uint8_t*) copyString(domainId);
|
||||
request->listOfVariableListName->list.array[0]->choice.domainspecific.domainId.buf = (uint8_t*) StringUtils_copyString(domainId);
|
||||
request->listOfVariableListName->list.array[0]->choice.domainspecific.itemId.size = strlen(listNameId);
|
||||
request->listOfVariableListName->list.array[0]->choice.domainspecific.itemId.buf = (uint8_t*) copyString(listNameId);
|
||||
request->listOfVariableListName->list.array[0]->choice.domainspecific.itemId.buf = (uint8_t*) StringUtils_copyString(listNameId);
|
||||
}
|
||||
else {
|
||||
request->listOfVariableListName->list.array[0]->present = ObjectName_PR_vmdspecific;
|
||||
request->listOfVariableListName->list.array[0]->choice.vmdspecific.size = strlen(listNameId);
|
||||
request->listOfVariableListName->list.array[0]->choice.vmdspecific.buf = (uint8_t*) copyString(listNameId);
|
||||
request->listOfVariableListName->list.array[0]->choice.vmdspecific.buf = (uint8_t*) StringUtils_copyString(listNameId);
|
||||
}
|
||||
|
||||
request->scopeOfDelete = (INTEGER_t*) GLOBAL_CALLOC(1, sizeof(INTEGER_t));
|
||||
|
@ -102,7 +102,7 @@ mmsClient_createDeleteAssociationSpecificNamedVariableListRequest(
|
|||
request->listOfVariableListName->list.array[0]->present = ObjectName_PR_aaspecific;
|
||||
|
||||
request->listOfVariableListName->list.array[0]->choice.aaspecific.size = strlen(listNameId);
|
||||
request->listOfVariableListName->list.array[0]->choice.aaspecific.buf = (uint8_t*) copyString(listNameId);
|
||||
request->listOfVariableListName->list.array[0]->choice.aaspecific.buf = (uint8_t*) StringUtils_copyString(listNameId);
|
||||
|
||||
request->scopeOfDelete = (INTEGER_t*) GLOBAL_CALLOC(1, sizeof(INTEGER_t));
|
||||
asn_long2INTEGER(request->scopeOfDelete, DeleteNamedVariableListRequest__scopeOfDelete_specific);
|
||||
|
@ -167,16 +167,16 @@ mmsClient_createGetNamedVariableListAttributesRequest(uint32_t invokeId, ByteBuf
|
|||
request->present = ObjectName_PR_domainspecific;
|
||||
|
||||
request->choice.domainspecific.domainId.size = strlen(domainId);
|
||||
request->choice.domainspecific.domainId.buf = (uint8_t*) copyString(domainId);
|
||||
request->choice.domainspecific.domainId.buf = (uint8_t*) StringUtils_copyString(domainId);
|
||||
|
||||
request->choice.domainspecific.itemId.size = strlen(listNameId);
|
||||
request->choice.domainspecific.itemId.buf = (uint8_t*) copyString(listNameId);
|
||||
request->choice.domainspecific.itemId.buf = (uint8_t*) StringUtils_copyString(listNameId);
|
||||
}
|
||||
else {
|
||||
request->present = ObjectName_PR_vmdspecific;
|
||||
|
||||
request->choice.vmdspecific.size = strlen(listNameId);
|
||||
request->choice.vmdspecific.buf = (uint8_t*) copyString(listNameId);
|
||||
request->choice.vmdspecific.buf = (uint8_t*) StringUtils_copyString(listNameId);
|
||||
}
|
||||
|
||||
der_encode(&asn_DEF_MmsPdu, mmsPdu,
|
||||
|
@ -200,7 +200,7 @@ mmsClient_createGetNamedVariableListAttributesRequestAssociationSpecific(uint32_
|
|||
request->present = ObjectName_PR_aaspecific;
|
||||
|
||||
request->choice.aaspecific.size = strlen(listNameId);
|
||||
request->choice.aaspecific.buf = (uint8_t*) copyString(listNameId);
|
||||
request->choice.aaspecific.buf = (uint8_t*) StringUtils_copyString(listNameId);
|
||||
|
||||
der_encode(&asn_DEF_MmsPdu, mmsPdu,
|
||||
(asn_app_consume_bytes_f*) mmsClient_write_out, (void*) writeBuffer);
|
||||
|
@ -289,23 +289,23 @@ mmsClient_createDefineNamedVariableListRequest(
|
|||
request->variableListName.present = ObjectName_PR_aaspecific;
|
||||
|
||||
request->variableListName.choice.aaspecific.size = strlen(listNameId);
|
||||
request->variableListName.choice.aaspecific.buf = (uint8_t*) copyString(listNameId);
|
||||
request->variableListName.choice.aaspecific.buf = (uint8_t*) StringUtils_copyString(listNameId);
|
||||
}
|
||||
else {
|
||||
if (domainId != NULL) { /* domain scope */
|
||||
request->variableListName.present = ObjectName_PR_domainspecific;
|
||||
|
||||
request->variableListName.choice.domainspecific.domainId.size = strlen(domainId);
|
||||
request->variableListName.choice.domainspecific.domainId.buf = (uint8_t*) copyString(domainId);
|
||||
request->variableListName.choice.domainspecific.domainId.buf = (uint8_t*) StringUtils_copyString(domainId);
|
||||
|
||||
request->variableListName.choice.domainspecific.itemId.size = strlen(listNameId);
|
||||
request->variableListName.choice.domainspecific.itemId.buf = (uint8_t*) copyString(listNameId);
|
||||
request->variableListName.choice.domainspecific.itemId.buf = (uint8_t*) StringUtils_copyString(listNameId);
|
||||
}
|
||||
else { /* VMD scope */
|
||||
request->variableListName.present = ObjectName_PR_vmdspecific;
|
||||
|
||||
request->variableListName.choice.vmdspecific.size = strlen(listNameId);
|
||||
request->variableListName.choice.vmdspecific.buf = (uint8_t*) copyString(listNameId);
|
||||
request->variableListName.choice.vmdspecific.buf = (uint8_t*) StringUtils_copyString(listNameId);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -336,13 +336,13 @@ mmsClient_createDefineNamedVariableListRequest(
|
|||
domainspecific.domainId.size = strlen(variableSpec->domainId);
|
||||
|
||||
request->listOfVariable.list.array[i]->variableSpecification.choice.name.choice.
|
||||
domainspecific.domainId.buf = (uint8_t*) copyString(variableSpec->domainId);
|
||||
domainspecific.domainId.buf = (uint8_t*) StringUtils_copyString(variableSpec->domainId);
|
||||
|
||||
request->listOfVariable.list.array[i]->variableSpecification.choice.name.choice.
|
||||
domainspecific.itemId.size = strlen(variableSpec->itemId);
|
||||
|
||||
request->listOfVariable.list.array[i]->variableSpecification.choice.name.choice.
|
||||
domainspecific.itemId.buf = (uint8_t*) copyString(variableSpec->itemId);
|
||||
domainspecific.itemId.buf = (uint8_t*) StringUtils_copyString(variableSpec->itemId);
|
||||
|
||||
//TODO add alternate access
|
||||
if (variableSpec->arrayIndex != -1) {
|
||||
|
@ -384,7 +384,7 @@ mmsClient_createDefineNamedVariableListRequest(
|
|||
&(componentAccess->list.array[0]->choice.unnamed->choice.selectAccess.choice.component);
|
||||
|
||||
componentIdentifier->size = strlen(variableSpec->componentName);
|
||||
componentIdentifier->buf = (uint8_t*) copyString(variableSpec->componentName);
|
||||
componentIdentifier->buf = (uint8_t*) StringUtils_copyString(variableSpec->componentName);
|
||||
|
||||
alternateAccess->list.array[0]->choice.unnamed->choice.selectAlternateAccess.alternateAccess
|
||||
= componentAccess;
|
||||
|
|
|
@ -311,16 +311,16 @@ mmsClient_createReadNamedVariableListRequest(uint32_t invokeId, const char* doma
|
|||
if (domainId != NULL) {
|
||||
objectName->present = ObjectName_PR_domainspecific;
|
||||
|
||||
objectName->choice.domainspecific.domainId.buf = (uint8_t*) copyString(domainId);
|
||||
objectName->choice.domainspecific.domainId.buf = (uint8_t*) StringUtils_copyString(domainId);
|
||||
objectName->choice.domainspecific.domainId.size = strlen(domainId);
|
||||
|
||||
objectName->choice.domainspecific.itemId.buf = (uint8_t*) copyString(itemId);
|
||||
objectName->choice.domainspecific.itemId.buf = (uint8_t*) StringUtils_copyString(itemId);
|
||||
objectName->choice.domainspecific.itemId.size = strlen(itemId);
|
||||
}
|
||||
else {
|
||||
objectName->present = ObjectName_PR_vmdspecific;
|
||||
|
||||
objectName->choice.vmdspecific.buf = (uint8_t*) copyString(itemId);
|
||||
objectName->choice.vmdspecific.buf = (uint8_t*) StringUtils_copyString(itemId);
|
||||
objectName->choice.vmdspecific.size = strlen(itemId);
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,7 @@ mmsClient_createReadAssociationSpecificNamedVariableListRequest(
|
|||
|
||||
objectName->present = ObjectName_PR_aaspecific;
|
||||
|
||||
objectName->choice.aaspecific.buf = (uint8_t*) copyString(itemId);
|
||||
objectName->choice.aaspecific.buf = (uint8_t*) StringUtils_copyString(itemId);
|
||||
objectName->choice.aaspecific.size = strlen(itemId);
|
||||
|
||||
asn_enc_rval_t rval;
|
||||
|
|
|
@ -321,7 +321,7 @@ mmsMsg_parseDataElement(Data_t* dataElement)
|
|||
char*
|
||||
mmsMsg_createStringFromAsnIdentifier(Identifier_t identifier)
|
||||
{
|
||||
char* str = createStringFromBuffer(identifier.buf, identifier.size);
|
||||
char* str = StringUtils_createStringFromBuffer(identifier.buf, identifier.size);
|
||||
|
||||
return str;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ MmsVariableSpecification_getStructureElements(MmsVariableSpecification* self)
|
|||
for (i = 0; i < self->typeSpec.structure.elementCount; i++) {
|
||||
MmsVariableSpecification* typeSpec = self->typeSpec.structure.elements[i];
|
||||
|
||||
LinkedList_add(elementNames, copyString(typeSpec->name));
|
||||
LinkedList_add(elementNames, StringUtils_copyString(typeSpec->name));
|
||||
}
|
||||
|
||||
return elementNames;
|
||||
|
|
|
@ -1718,7 +1718,7 @@ MmsValue_newStringFromByteArray(const uint8_t* byteArray, int size, MmsType type
|
|||
|
||||
self->value.visibleString.size = size;
|
||||
|
||||
self->value.visibleString.buf = createStringFromBuffer(byteArray, size);
|
||||
self->value.visibleString.buf = StringUtils_createStringFromBuffer(byteArray, size);
|
||||
|
||||
if (self->value.visibleString.buf == NULL) {
|
||||
GLOBAL_FREEMEM(self);
|
||||
|
|
|
@ -39,7 +39,7 @@ MmsDomain_create(char* domainName)
|
|||
{
|
||||
MmsDomain* self = (MmsDomain*) GLOBAL_CALLOC(1, sizeof(MmsDomain));
|
||||
|
||||
self->domainName = copyString(domainName);
|
||||
self->domainName = StringUtils_copyString(domainName);
|
||||
self->namedVariableLists = LinkedList_create();
|
||||
self->journals = NULL;
|
||||
|
||||
|
|
|
@ -234,9 +234,9 @@ getNameListDomainSpecific(MmsServerConnection connection, char* domainName)
|
|||
for (i = 0; i < domain->namedVariablesCount; i++) {
|
||||
|
||||
#if (CONFIG_MMS_SORT_NAME_LIST == 1)
|
||||
element = LinkedList_insertAfter(element, copyString(variables[index[i]]->name));
|
||||
element = LinkedList_insertAfter(element, StringUtils_copyString(variables[index[i]]->name));
|
||||
#else
|
||||
element = LinkedList_insertAfter(element, copyString(variables[i]->name));
|
||||
element = LinkedList_insertAfter(element, StringUtils_copyString(variables[i]->name));
|
||||
#endif
|
||||
|
||||
#if (CONFIG_MMS_SUPPORT_FLATTED_NAME_SPACE == 1)
|
||||
|
@ -272,7 +272,7 @@ createStringsFromNamedVariableList(LinkedList nameList, LinkedList variableLists
|
|||
(MmsNamedVariableList) variableListsElement->data;
|
||||
|
||||
LinkedList_add(nameList,
|
||||
copyString(MmsNamedVariableList_getName(variableList)));
|
||||
StringUtils_copyString(MmsNamedVariableList_getName(variableList)));
|
||||
|
||||
variableListsElement = LinkedList_getNext(variableListsElement);
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ createTypeSpecification (
|
|||
(Identifier_t*) GLOBAL_CALLOC(1, sizeof(Identifier_t));
|
||||
|
||||
typeSpec->choice.structure.components.list.array[i]->componentName->buf =
|
||||
(uint8_t*) copyString(namedVariable->typeSpec.structure.elements[i]->name);
|
||||
(uint8_t*) StringUtils_copyString(namedVariable->typeSpec.structure.elements[i]->name);
|
||||
|
||||
typeSpec->choice.structure.components.list.array[i]->componentName->size =
|
||||
strlen(namedVariable->typeSpec.structure.elements[i]->name);
|
||||
|
@ -302,8 +302,8 @@ mmsServer_handleGetVariableAccessAttributesRequest(
|
|||
Identifier_t domainId = request->choice.name.choice.domainspecific.domainId;
|
||||
Identifier_t nameId = request->choice.name.choice.domainspecific.itemId;
|
||||
|
||||
char* domainIdStr = createStringFromBuffer(domainId.buf, domainId.size);
|
||||
char* nameIdStr = createStringFromBuffer(nameId.buf, nameId.size);
|
||||
char* domainIdStr = StringUtils_createStringFromBuffer(domainId.buf, domainId.size);
|
||||
char* nameIdStr = StringUtils_createStringFromBuffer(nameId.buf, nameId.size);
|
||||
|
||||
if (DEBUG_MMS_SERVER)
|
||||
printf("MMS_SERVER: getVariableAccessAttributes domainId: %s nameId: %s\n", domainIdStr, nameIdStr);
|
||||
|
@ -317,7 +317,7 @@ mmsServer_handleGetVariableAccessAttributesRequest(
|
|||
else if (request->choice.name.present == ObjectName_PR_vmdspecific) {
|
||||
Identifier_t nameId = request->choice.name.choice.vmdspecific;
|
||||
|
||||
char* nameIdStr = createStringFromBuffer(nameId.buf, nameId.size);
|
||||
char* nameIdStr = StringUtils_createStringFromBuffer(nameId.buf, nameId.size);
|
||||
|
||||
if (DEBUG_MMS_SERVER) printf("MMS_SERVER: getVariableAccessAttributes (VMD specific) nameId: %s\n", nameIdStr);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ MmsJournal_create(const char* name)
|
|||
|
||||
MmsJournal self = (MmsJournal) GLOBAL_MALLOC(sizeof(struct sMmsJournal));
|
||||
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
|
|
@ -31,11 +31,11 @@ MmsNamedVariableListEntry_create(MmsAccessSpecifier accessSpecifier)
|
|||
MmsNamedVariableListEntry listEntry = (MmsNamedVariableListEntry) GLOBAL_MALLOC(sizeof(MmsAccessSpecifier));
|
||||
|
||||
listEntry->domain = accessSpecifier.domain;
|
||||
listEntry->variableName = copyString(accessSpecifier.variableName);
|
||||
listEntry->variableName = StringUtils_copyString(accessSpecifier.variableName);
|
||||
listEntry->arrayIndex = accessSpecifier.arrayIndex;
|
||||
|
||||
if (accessSpecifier.componentName != NULL)
|
||||
listEntry->componentName = copyString(accessSpecifier.componentName);
|
||||
listEntry->componentName = StringUtils_copyString(accessSpecifier.componentName);
|
||||
else
|
||||
listEntry->componentName = NULL;
|
||||
|
||||
|
@ -67,7 +67,7 @@ MmsNamedVariableList_create(MmsDomain* domain, char* name, bool deletable)
|
|||
MmsNamedVariableList self = (MmsNamedVariableList) GLOBAL_MALLOC(sizeof(struct sMmsNamedVariableList));
|
||||
|
||||
self->deletable = deletable;
|
||||
self->name = copyString(name);
|
||||
self->name = StringUtils_copyString(name);
|
||||
self->listOfVariables = LinkedList_create();
|
||||
self->domain = domain;
|
||||
|
||||
|
|
|
@ -633,13 +633,13 @@ createGetNamedVariableListAttributesResponse(int invokeId, ByteBuffer* response,
|
|||
char* variableDomainName = MmsDomain_getName(variableEntry->domain);
|
||||
|
||||
varListResponse->listOfVariable.list.array[i]->variableSpecification.choice.name.choice.
|
||||
domainspecific.domainId.buf = (uint8_t*) copyString(variableDomainName);
|
||||
domainspecific.domainId.buf = (uint8_t*) StringUtils_copyString(variableDomainName);
|
||||
|
||||
varListResponse->listOfVariable.list.array[i]->variableSpecification.choice.name.choice.
|
||||
domainspecific.domainId.size = strlen(variableDomainName);
|
||||
|
||||
varListResponse->listOfVariable.list.array[i]->variableSpecification.choice.name.choice.
|
||||
domainspecific.itemId.buf = (uint8_t*) copyString(variableEntry->variableName);
|
||||
domainspecific.itemId.buf = (uint8_t*) StringUtils_copyString(variableEntry->variableName);
|
||||
|
||||
varListResponse->listOfVariable.list.array[i]->variableSpecification.choice.name.choice.
|
||||
domainspecific.itemId.size = strlen(variableEntry->variableName);
|
||||
|
|
|
@ -59,7 +59,7 @@ MmsValueCache_insertValue(MmsValueCache self, char* itemId, MmsValue* value)
|
|||
cacheEntry->value = value;
|
||||
cacheEntry->typeSpec = typeSpec;
|
||||
|
||||
Map_addEntry(self->map, copyString(itemId), cacheEntry);
|
||||
Map_addEntry(self->map, StringUtils_copyString(itemId), cacheEntry);
|
||||
}
|
||||
else
|
||||
if (DEBUG) printf("Cannot insert value into cache %s : no typeSpec found!\n", itemId);
|
||||
|
@ -127,7 +127,7 @@ MmsValueCache_lookupValue(MmsValueCache self, char* itemId)
|
|||
cacheEntry = (MmsValueCacheEntry*) Map_getEntry(self->map, itemId);
|
||||
|
||||
if (cacheEntry == NULL) {
|
||||
char* itemIdCopy = copyString(itemId);
|
||||
char* itemIdCopy = StringUtils_copyString(itemId);
|
||||
char* parentItemId = getParentSubString(itemIdCopy);
|
||||
|
||||
if (parentItemId != NULL) {
|
||||
|
|
|
@ -151,7 +151,7 @@ mmsServer_handleWriteRequest(
|
|||
|
||||
if (varSpec->variableSpecification.choice.name.present == ObjectName_PR_domainspecific) {
|
||||
Identifier_t domainId = varSpec->variableSpecification.choice.name.choice.domainspecific.domainId;
|
||||
char* domainIdStr = createStringFromBuffer(domainId.buf, domainId.size);
|
||||
char* domainIdStr = StringUtils_createStringFromBuffer(domainId.buf, domainId.size);
|
||||
|
||||
domain = MmsDevice_getDomain(device, domainIdStr);
|
||||
|
||||
|
@ -163,7 +163,7 @@ mmsServer_handleWriteRequest(
|
|||
}
|
||||
|
||||
Identifier_t nameId = varSpec->variableSpecification.choice.name.choice.domainspecific.itemId;
|
||||
nameIdStr = createStringFromBuffer(nameId.buf, nameId.size);
|
||||
nameIdStr = StringUtils_createStringFromBuffer(nameId.buf, nameId.size);
|
||||
|
||||
variable = MmsDomain_getNamedVariable(domain, nameIdStr);
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ mmsServer_handleWriteRequest(
|
|||
else if (varSpec->variableSpecification.choice.name.present == ObjectName_PR_vmdspecific) {
|
||||
|
||||
Identifier_t nameId = varSpec->variableSpecification.choice.name.choice.vmdspecific;
|
||||
nameIdStr = createStringFromBuffer(nameId.buf, nameId.size);
|
||||
nameIdStr = StringUtils_createStringFromBuffer(nameId.buf, nameId.size);
|
||||
|
||||
variable = MmsDevice_getNamedVariable(device, nameIdStr);
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ SVReceiver_setInterfaceId(SVReceiver self, const char* interfaceId)
|
|||
if (self->interfaceId != NULL)
|
||||
GLOBAL_FREEMEM(self->interfaceId);
|
||||
|
||||
self->interfaceId = copyString(interfaceId);
|
||||
self->interfaceId = StringUtils_copyString(interfaceId);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Reference in a new issue