fixed bug: Writing of property NotifyType in AnalogValue - ID: 3541355

This commit is contained in:
skarg
2012-07-08 15:27:15 +00:00
parent 7514150f7d
commit d43146c7e3
2 changed files with 24 additions and 12 deletions
+12 -6
View File
@@ -630,12 +630,18 @@ bool Analog_Input_Write_Property(
&wp_data->error_class, &wp_data->error_code);
if (status) {
if (value.type.Bit_String.bits_used > NOTIFY_EVENT) {
CurrentAI->Event_Enable = value.type.Enumerated;
} else {
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
status = false;
switch ((BACNET_NOTIFY_TYPE)value.type.Enumerated) {
case NOTIFY_EVENT:
CurrentAI->Notify_Type = 1;
break;
case NOTIFY_ALARM:
CurrentAI->Notify_Type = 0;
break;
default:
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
status = false;
break;
}
}
break;
+12 -6
View File
@@ -728,12 +728,18 @@ bool Analog_Value_Write_Property(
&wp_data->error_class, &wp_data->error_code);
if (status) {
if (value.type.Bit_String.bits_used > NOTIFY_EVENT) {
CurrentAV->Event_Enable = value.type.Enumerated;
} else {
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
status = false;
switch ((BACNET_NOTIFY_TYPE)value.type.Enumerated) {
case NOTIFY_EVENT:
CurrentAV->Notify_Type = 1;
break;
case NOTIFY_ALARM:
CurrentAV->Notify_Type = 0;
break;
default:
wp_data->error_class = ERROR_CLASS_PROPERTY;
wp_data->error_code = ERROR_CODE_VALUE_OUT_OF_RANGE;
status = false;
break;
}
}
break;