Added test for a decoding problem where the stack is unable to decode something, and retrofitted into WriteProperty for each of the demo objects by returning an Error, Out of Range.

This commit is contained in:
skarg
2010-10-12 01:17:50 +00:00
parent df2a5ca695
commit e9249b5b5e
29 changed files with 221 additions and 83 deletions
+6 -1
View File
@@ -522,7 +522,12 @@ bool Lighting_Output_Write_Property(
bacapp_decode_application_data(wp_data->application_data,
wp_data->application_data_len, &value);
/* FIXME: len < application_data_len: more data? */
/* FIXME: len == 0: unable to decode? */
if (len < 0) {
/* error while decoding - a value larger than we can handle */
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
return false;
}
switch (wp_data->object_property) {
case PROP_PRESENT_VALUE:
if (value.tag == BACNET_APPLICATION_TAG_REAL) {