Added test for array options on RP and RPM to all object properties that are not arrays.

This commit is contained in:
skarg
2009-11-05 15:39:46 +00:00
parent 2c2fbdeeef
commit edc7c6c577
36 changed files with 278 additions and 66 deletions
+7
View File
@@ -160,6 +160,13 @@ int Analog_Input_Encode_Property_APDU(
apdu_len = -1;
break;
}
/* only array properties can have array options */
if ((apdu_len >= 0) &&
(array_index != BACNET_ARRAY_ALL)) {
*error_class = ERROR_CLASS_PROPERTY;
*error_code = ERROR_CODE_PROPERTY_IS_NOT_AN_ARRAY;
apdu_len = -1;
}
return apdu_len;
}
+10
View File
@@ -269,6 +269,16 @@ int Analog_Value_Encode_Property_APDU(
apdu_len = -1;
break;
}
/* only array properties can have array options */
if ((apdu_len >= 0) &&
#if 0
(property != PROP_PRIORITY_ARRAY) &&
#endif
(array_index != BACNET_ARRAY_ALL)) {
*error_class = ERROR_CLASS_PROPERTY;
*error_code = ERROR_CODE_PROPERTY_IS_NOT_AN_ARRAY;
apdu_len = -1;
}
return apdu_len;
}
+7
View File
@@ -184,6 +184,13 @@ int Binary_Input_Encode_Property_APDU(
apdu_len = -1;
break;
}
/* only array properties can have array options */
if ((apdu_len >= 0) &&
(array_index != BACNET_ARRAY_ALL)) {
*error_class = ERROR_CLASS_PROPERTY;
*error_code = ERROR_CODE_PROPERTY_IS_NOT_AN_ARRAY;
apdu_len = -1;
}
return apdu_len;
}
+7
View File
@@ -185,6 +185,13 @@ int Binary_Value_Encode_Property_APDU(
apdu_len = -1;
break;
}
/* only array properties can have array options */
if ((apdu_len >= 0) &&
(array_index != BACNET_ARRAY_ALL)) {
*error_class = ERROR_CLASS_PROPERTY;
*error_code = ERROR_CODE_PROPERTY_IS_NOT_AN_ARRAY;
apdu_len = -1;
}
return apdu_len;
}
+8
View File
@@ -476,6 +476,14 @@ int Device_Encode_Property_APDU(
apdu_len = -1;
break;
}
/* only array properties can have array options */
if ((apdu_len >= 0) &&
(property != PROP_OBJECT_LIST) &&
(array_index != BACNET_ARRAY_ALL)) {
*error_class = ERROR_CLASS_PROPERTY;
*error_code = ERROR_CODE_PROPERTY_IS_NOT_AN_ARRAY;
apdu_len = -1;
}
return apdu_len;
}