|
@@ -169,11 +169,20 @@ typeCheckValue(UA_Server *server, const UA_NodeId *targetDataTypeId,
|
|
if(range) /* array dimensions are checked later when writing the range */
|
|
if(range) /* array dimensions are checked later when writing the range */
|
|
return UA_STATUSCODE_GOOD;
|
|
return UA_STATUSCODE_GOOD;
|
|
|
|
|
|
|
|
+ size_t valueArrayDimensionsSize = value->arrayDimensionsSize;
|
|
|
|
+ UA_UInt32 *valueArrayDimensions = value->arrayDimensions;
|
|
|
|
+ UA_UInt32 tempArrayDimensions;
|
|
|
|
+ if(valueArrayDimensions == 0 && !UA_Variant_isScalar(value)) {
|
|
|
|
+ valueArrayDimensionsSize = 1;
|
|
|
|
+ tempArrayDimensions = (UA_UInt32)value->arrayLength;
|
|
|
|
+ valueArrayDimensions = &tempArrayDimensions;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* See if the array dimensions match. When arrayDimensions are defined, they
|
|
/* See if the array dimensions match. When arrayDimensions are defined, they
|
|
* already hold the valuerank. */
|
|
* already hold the valuerank. */
|
|
if(targetArrayDimensionsSize > 0)
|
|
if(targetArrayDimensionsSize > 0)
|
|
return compatibleArrayDimensions(targetArrayDimensionsSize, targetArrayDimensions,
|
|
return compatibleArrayDimensions(targetArrayDimensionsSize, targetArrayDimensions,
|
|
- value->arrayDimensionsSize, value->arrayDimensions);
|
|
|
|
|
|
+ valueArrayDimensionsSize, valueArrayDimensions);
|
|
|
|
|
|
/* Check if the valuerank allows for the value dimension */
|
|
/* Check if the valuerank allows for the value dimension */
|
|
return compatibleValueRankValue(targetValueRank, value);
|
|
return compatibleValueRankValue(targetValueRank, value);
|