|
|
@ -3,22 +3,22 @@
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Copyright 2013-2018 Michael Zillgith
|
|
|
|
* Copyright 2013-2018 Michael Zillgith
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This file is part of libIEC61850.
|
|
|
|
* This file is part of libIEC61850.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* libIEC61850 is free software: you can redistribute it and/or modify
|
|
|
|
* libIEC61850 is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* libIEC61850 is distributed in the hope that it will be useful,
|
|
|
|
* libIEC61850 is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* See COPYING file for the complete license text.
|
|
|
|
* See COPYING file for the complete license text.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "libiec61850_platform_includes.h"
|
|
|
|
#include "libiec61850_platform_includes.h"
|
|
|
@ -130,7 +130,7 @@ MmsValue_equals(const MmsValue* self, const MmsValue* otherValue)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
return Asn1PrimitivaValue_compare(self->value.integer, otherValue->value.integer);
|
|
|
|
return Asn1PrimitivaValue_compare(self->value.integer, otherValue->value.integer);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_UTC_TIME:
|
|
|
|
case MMS_UTC_TIME:
|
|
|
@ -162,7 +162,7 @@ MmsValue_equals(const MmsValue* self, const MmsValue* otherValue)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_STRING:
|
|
|
|
case MMS_STRING:
|
|
|
|
if (self->value.visibleString.buf != NULL) {
|
|
|
|
if (self->value.visibleString.buf != NULL) {
|
|
|
|
if (otherValue->value.visibleString.buf != NULL) {
|
|
|
|
if (otherValue->value.visibleString.buf != NULL) {
|
|
|
|
if (strcmp(self->value.visibleString.buf, otherValue->value.visibleString.buf) == 0)
|
|
|
|
if (strcmp(self->value.visibleString.buf, otherValue->value.visibleString.buf) == 0)
|
|
|
@ -315,7 +315,6 @@ MmsValue*
|
|
|
|
MmsValue_newBitString(int bitSize)
|
|
|
|
MmsValue_newBitString(int bitSize)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self == NULL)
|
|
|
|
if (self == NULL)
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
@ -524,7 +523,6 @@ MmsValue*
|
|
|
|
MmsValue_newFloat(float variable)
|
|
|
|
MmsValue_newFloat(float variable)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_MALLOC(sizeof(MmsValue));
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_MALLOC(sizeof(MmsValue));
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self == NULL)
|
|
|
|
if (self == NULL)
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
@ -587,7 +585,6 @@ MmsValue*
|
|
|
|
MmsValue_newIntegerFromInt8(int8_t integer)
|
|
|
|
MmsValue_newIntegerFromInt8(int8_t integer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self->type = MMS_INTEGER;
|
|
|
|
self->type = MMS_INTEGER;
|
|
|
|
self->value.integer = BerInteger_createFromInt32((int32_t) integer);
|
|
|
|
self->value.integer = BerInteger_createFromInt32((int32_t) integer);
|
|
|
@ -599,7 +596,6 @@ MmsValue*
|
|
|
|
MmsValue_newIntegerFromInt16(int16_t integer)
|
|
|
|
MmsValue_newIntegerFromInt16(int16_t integer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self->type = MMS_INTEGER;
|
|
|
|
self->type = MMS_INTEGER;
|
|
|
|
self->value.integer = BerInteger_createFromInt32((int32_t) integer);
|
|
|
|
self->value.integer = BerInteger_createFromInt32((int32_t) integer);
|
|
|
@ -833,7 +829,6 @@ MmsValue*
|
|
|
|
MmsValue_newUnsignedFromUint32(uint32_t integer)
|
|
|
|
MmsValue_newUnsignedFromUint32(uint32_t integer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self == NULL)
|
|
|
|
if (self == NULL)
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
@ -848,7 +843,6 @@ MmsValue*
|
|
|
|
MmsValue_newIntegerFromInt64(int64_t integer)
|
|
|
|
MmsValue_newIntegerFromInt64(int64_t integer)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
MmsValue* self = (MmsValue*) GLOBAL_CALLOC(1, sizeof(MmsValue));
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (self == NULL)
|
|
|
|
if (self == NULL)
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
@ -914,8 +908,6 @@ MmsValue_toFloat(const MmsValue* self)
|
|
|
|
return val;
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
printf("MmsValue_toFloat: conversion error. Wrong type!\n");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0.f;
|
|
|
|
return 0.f;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -967,7 +959,7 @@ MmsValue_getSizeInMemory(const MmsValue* self)
|
|
|
|
switch (self->type)
|
|
|
|
switch (self->type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
memorySize += (MemoryAllocator_getAlignedSize(sizeof(MmsValue*)) * self->value.structure.size);
|
|
|
|
memorySize += (MemoryAllocator_getAlignedSize(sizeof(MmsValue*)) * self->value.structure.size);
|
|
|
|
|
|
|
|
|
|
|
@ -982,7 +974,7 @@ MmsValue_getSizeInMemory(const MmsValue* self)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
memorySize += MemoryAllocator_getAlignedSize(sizeof(Asn1PrimitiveValue));
|
|
|
|
memorySize += MemoryAllocator_getAlignedSize(sizeof(Asn1PrimitiveValue));
|
|
|
|
memorySize += MemoryAllocator_getAlignedSize(self->value.integer->maxSize);
|
|
|
|
memorySize += MemoryAllocator_getAlignedSize(self->value.integer->maxSize);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1018,7 +1010,7 @@ MmsValue_cloneToBuffer(const MmsValue* self, uint8_t* destinationAddress)
|
|
|
|
switch (self->type)
|
|
|
|
switch (self->type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
newValue->value.structure.components = (MmsValue**) destinationAddress;
|
|
|
|
newValue->value.structure.components = (MmsValue**) destinationAddress;
|
|
|
|
destinationAddress += (sizeof(MmsValue*) * self->value.structure.size);
|
|
|
|
destinationAddress += (sizeof(MmsValue*) * self->value.structure.size);
|
|
|
@ -1038,7 +1030,7 @@ MmsValue_cloneToBuffer(const MmsValue* self, uint8_t* destinationAddress)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
newValue->value.integer = (Asn1PrimitiveValue*) destinationAddress;
|
|
|
|
newValue->value.integer = (Asn1PrimitiveValue*) destinationAddress;
|
|
|
|
Asn1PrimitiveValue* newAsn1Value = (Asn1PrimitiveValue*) destinationAddress;
|
|
|
|
Asn1PrimitiveValue* newAsn1Value = (Asn1PrimitiveValue*) destinationAddress;
|
|
|
@ -1067,7 +1059,7 @@ MmsValue_cloneToBuffer(const MmsValue* self, uint8_t* destinationAddress)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case MMS_STRING:
|
|
|
|
case MMS_STRING:
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
newValue->value.visibleString.buf = (char*) destinationAddress;
|
|
|
|
newValue->value.visibleString.buf = (char*) destinationAddress;
|
|
|
|
newValue->value.visibleString.size = self->value.visibleString.size;
|
|
|
|
newValue->value.visibleString.size = self->value.visibleString.size;
|
|
|
|
strcpy((char*) destinationAddress, self->value.visibleString.buf);
|
|
|
|
strcpy((char*) destinationAddress, self->value.visibleString.buf);
|
|
|
@ -1081,7 +1073,6 @@ MmsValue_cloneToBuffer(const MmsValue* self, uint8_t* destinationAddress)
|
|
|
|
return destinationAddress;
|
|
|
|
return destinationAddress;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// create a deep clone
|
|
|
|
|
|
|
|
MmsValue*
|
|
|
|
MmsValue*
|
|
|
|
MmsValue_clone(const MmsValue* self)
|
|
|
|
MmsValue_clone(const MmsValue* self)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1098,7 +1089,7 @@ MmsValue_clone(const MmsValue* self)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int componentCount = self->value.structure.size;
|
|
|
|
int componentCount = self->value.structure.size;
|
|
|
|
newValue->value.structure.size = componentCount;
|
|
|
|
newValue->value.structure.size = componentCount;
|
|
|
@ -1112,7 +1103,7 @@ MmsValue_clone(const MmsValue* self)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
newValue->value.integer = Asn1PrimitiveValue_clone(self->value.integer);
|
|
|
|
newValue->value.integer = Asn1PrimitiveValue_clone(self->value.integer);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
@ -1153,7 +1144,7 @@ MmsValue_clone(const MmsValue* self)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_STRING:
|
|
|
|
case MMS_STRING:
|
|
|
|
size = self->value.visibleString.size;
|
|
|
|
size = self->value.visibleString.size;
|
|
|
|
newValue->value.visibleString.buf = (char*) GLOBAL_MALLOC(size + 1);
|
|
|
|
newValue->value.visibleString.buf = (char*) GLOBAL_MALLOC(size + 1);
|
|
|
|
newValue->value.visibleString.size = size;
|
|
|
|
newValue->value.visibleString.size = size;
|
|
|
@ -1168,7 +1159,7 @@ MmsValue_clone(const MmsValue* self)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
exit_function:
|
|
|
|
return newValue;
|
|
|
|
return newValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1191,7 +1182,7 @@ MmsValue_delete(MmsValue* self)
|
|
|
|
switch (self->type)
|
|
|
|
switch (self->type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
Asn1PrimitiveValue_destroy(self->value.integer);
|
|
|
|
Asn1PrimitiveValue_destroy(self->value.integer);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_FLOAT:
|
|
|
|
case MMS_FLOAT:
|
|
|
@ -1204,12 +1195,12 @@ MmsValue_delete(MmsValue* self)
|
|
|
|
GLOBAL_FREEMEM(self->value.octetString.buf);
|
|
|
|
GLOBAL_FREEMEM(self->value.octetString.buf);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_STRING:
|
|
|
|
case MMS_STRING:
|
|
|
|
if (self->value.visibleString.buf != NULL)
|
|
|
|
if (self->value.visibleString.buf != NULL)
|
|
|
|
GLOBAL_FREEMEM(self->value.visibleString.buf);
|
|
|
|
GLOBAL_FREEMEM(self->value.visibleString.buf);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int componentCount = self->value.structure.size;
|
|
|
|
int componentCount = self->value.structure.size;
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
@ -1237,7 +1228,7 @@ MmsValue_deleteConditional(MmsValue* self)
|
|
|
|
switch (self->type)
|
|
|
|
switch (self->type)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
Asn1PrimitiveValue_destroy(self->value.integer);
|
|
|
|
Asn1PrimitiveValue_destroy(self->value.integer);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_FLOAT:
|
|
|
|
case MMS_FLOAT:
|
|
|
@ -1250,12 +1241,12 @@ MmsValue_deleteConditional(MmsValue* self)
|
|
|
|
GLOBAL_FREEMEM(self->value.octetString.buf);
|
|
|
|
GLOBAL_FREEMEM(self->value.octetString.buf);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_STRING:
|
|
|
|
case MMS_STRING:
|
|
|
|
if (self->value.visibleString.buf != NULL)
|
|
|
|
if (self->value.visibleString.buf != NULL)
|
|
|
|
GLOBAL_FREEMEM(self->value.visibleString.buf);
|
|
|
|
GLOBAL_FREEMEM(self->value.visibleString.buf);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int componentCount = self->value.structure.size;
|
|
|
|
int componentCount = self->value.structure.size;
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
@ -1497,7 +1488,7 @@ MmsValue_newDefaultValue(const MmsVariableSpecification* typeSpec)
|
|
|
|
if (self != NULL)
|
|
|
|
if (self != NULL)
|
|
|
|
self->deleteValue = 0;
|
|
|
|
self->deleteValue = 0;
|
|
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
exit_function:
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1526,7 +1517,7 @@ setVisibleStringValue(MmsValue* self, const char* string)
|
|
|
|
self->value.visibleString.buf[0] = 0;
|
|
|
|
self->value.visibleString.buf[0] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
exit_function:
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1559,7 +1550,7 @@ MmsValue_newString(const char* string, MmsType type)
|
|
|
|
setVisibleStringValue(self, string);
|
|
|
|
setVisibleStringValue(self, string);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
exit_function:
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1590,7 +1581,7 @@ MmsValue_newStringWithSize(int size, MmsType type)
|
|
|
|
|
|
|
|
|
|
|
|
self->value.visibleString.buf[0] = 0;
|
|
|
|
self->value.visibleString.buf[0] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
exit_function:
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1715,9 +1706,8 @@ void
|
|
|
|
MmsValue_setMmsString(MmsValue* self, const char* string)
|
|
|
|
MmsValue_setMmsString(MmsValue* self, const char* string)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (self->type == MMS_STRING) {
|
|
|
|
if (self->type == MMS_STRING) {
|
|
|
|
assert(self->value.visibleString.buf != NULL);
|
|
|
|
if (self->value.visibleString.buf != NULL);
|
|
|
|
|
|
|
|
setVisibleStringValue(self, string);
|
|
|
|
setVisibleStringValue(self, string);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1740,7 +1730,7 @@ MmsValue_newStringFromByteArray(const uint8_t* byteArray, int size, MmsType type
|
|
|
|
self = NULL;
|
|
|
|
self = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
exit_function:
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1760,9 +1750,8 @@ void
|
|
|
|
MmsValue_setVisibleString(MmsValue* self, const char* string)
|
|
|
|
MmsValue_setVisibleString(MmsValue* self, const char* string)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (self->type == MMS_VISIBLE_STRING) {
|
|
|
|
if (self->type == MMS_VISIBLE_STRING) {
|
|
|
|
assert(self->value.visibleString.buf != NULL);
|
|
|
|
if (self->value.visibleString.buf != NULL);
|
|
|
|
|
|
|
|
setVisibleStringValue(self, string);
|
|
|
|
setVisibleStringValue(self, string);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1809,7 +1798,7 @@ MmsValue_newUtcTime(uint32_t timeval)
|
|
|
|
valueArray[3] = timeArray[3];
|
|
|
|
valueArray[3] = timeArray[3];
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
exit_function:
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1856,7 +1845,7 @@ MmsValue_createArray(MmsVariableSpecification* elementType, int size)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
exit_function:
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1883,7 +1872,7 @@ MmsValue_createEmptyArray(int size)
|
|
|
|
self->value.structure.components[i] = NULL;
|
|
|
|
self->value.structure.components[i] = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
exit_function:
|
|
|
|
exit_function:
|
|
|
|
return self;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2013,7 +2002,7 @@ MmsValue_printToBuffer(const MmsValue* self, char* buffer, int bufferSize)
|
|
|
|
switch (MmsValue_getType(self))
|
|
|
|
switch (MmsValue_getType(self))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
case MMS_STRUCTURE:
|
|
|
|
case MMS_ARRAY:
|
|
|
|
case MMS_ARRAY:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (bufferSize == 0)
|
|
|
|
if (bufferSize == 0)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|