Added check in each example object WriteProperty handler to pass test:

9.22.2.1 Writing Non-Array Properties with an Array Index
Thank you Kamalathas!
This commit is contained in:
skarg
2012-07-09 19:49:27 +00:00
parent d43146c7e3
commit 7578b4ef06
33 changed files with 605 additions and 81 deletions
+8 -1
View File
@@ -478,6 +478,13 @@ bool Routed_Device_Write_Property_Local(
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
return false;
}
/* only array properties can have array options */
if ((wp_data->object_property != PROP_OBJECT_LIST) &&
(wp_data->array_index != BACNET_ARRAY_ALL)) {
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_PROPERTY_IS_NOT_AN_ARRAY;
return false;
}
/* FIXME: len < application_data_len: more data? */
switch (wp_data->object_property) {
case PROP_OBJECT_IDENTIFIER:
@@ -601,7 +608,7 @@ void Routed_Device_Inc_Database_Revision(
/** Check to see if the current Device supports this service.
* Presently checks for RD and DCC and only allows them if the current
* device is the gateway device.
*
*
* @param service [in] The service being requested.
* @param service_argument [in] An optional argument (eg, service type).
* @param apdu_buff [in,out] The buffer where we will encode a Reject message.