|
|
@ -239,7 +239,8 @@ MmsValue_update(MmsValue* self, const MmsValue* update)
|
|
|
|
memcpy(self->value.floatingPoint.buf, update->value.floatingPoint.buf,
|
|
|
|
memcpy(self->value.floatingPoint.buf, update->value.floatingPoint.buf,
|
|
|
|
self->value.floatingPoint.formatWidth / 8);
|
|
|
|
self->value.floatingPoint.formatWidth / 8);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else return false;
|
|
|
|
else
|
|
|
|
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_INTEGER:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
|
case MMS_UNSIGNED:
|
|
|
@ -254,16 +255,24 @@ MmsValue_update(MmsValue* self, const MmsValue* update)
|
|
|
|
case MMS_BIT_STRING:
|
|
|
|
case MMS_BIT_STRING:
|
|
|
|
if (self->value.bitString.size == update->value.bitString.size)
|
|
|
|
if (self->value.bitString.size == update->value.bitString.size)
|
|
|
|
memcpy(self->value.bitString.buf, update->value.bitString.buf, bitStringByteSize(self));
|
|
|
|
memcpy(self->value.bitString.buf, update->value.bitString.buf, bitStringByteSize(self));
|
|
|
|
else return false;
|
|
|
|
else
|
|
|
|
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_OCTET_STRING:
|
|
|
|
case MMS_OCTET_STRING:
|
|
|
|
if (self->value.octetString.maxSize == update->value.octetString.maxSize) {
|
|
|
|
{
|
|
|
|
memcpy(self->value.octetString.buf, update->value.octetString.buf,
|
|
|
|
int size = update->value.octetString.size;
|
|
|
|
update->value.octetString.size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self->value.octetString.size = update->value.octetString.size;
|
|
|
|
if (size > self->value.octetString.maxSize) {
|
|
|
|
|
|
|
|
GLOBAL_FREEMEM(self->value.octetString.buf);
|
|
|
|
|
|
|
|
self->value.octetString.buf = GLOBAL_MALLOC(size);
|
|
|
|
|
|
|
|
self->value.octetString.maxSize = size;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
size = self->value.octetString.maxSize;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
memcpy(self->value.octetString.buf, update->value.octetString.buf, size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self->value.octetString.size = size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else return false;
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
case MMS_VISIBLE_STRING:
|
|
|
|
MmsValue_setVisibleString(self, update->value.visibleString.buf);
|
|
|
|
MmsValue_setVisibleString(self, update->value.visibleString.buf);
|
|
|
|