fix analog, binary, and multistate output tests

This commit is contained in:
Steve Karg
2022-11-10 17:35:03 -06:00
parent 100df01cef
commit 77b2881f60
11 changed files with 106 additions and 24 deletions
+16 -1
View File
@@ -74,6 +74,8 @@ struct object_data {
};
/* Key List for storing the object data sorted by instance number */
static OS_Keylist Object_List;
/* common object type */
static const BACNET_OBJECT_TYPE Object_Type = OBJECT_ANALOG_OUTPUT;
/* callback for present value writes */
static analog_output_write_present_value_callback
Analog_Output_Write_Present_Value_Callback;
@@ -559,7 +561,7 @@ bool Analog_Output_Name_Set(uint32_t object_instance, char *new_name)
characterstring_init_ansi(&object_name, new_name);
if (Device_Valid_Object_Name(
&object_name, &found_type, &found_instance)) {
if ((found_type == OBJECT_ANALOG_OUTPUT) &&
if ((found_type == Object_Type) &&
(found_instance == object_instance)) {
/* writing same name to same object */
status = true;
@@ -1007,6 +1009,19 @@ int Analog_Output_Read_Property(BACNET_READ_PROPERTY_DATA *rpdata)
apdu = rpdata->application_data;
switch (rpdata->object_property) {
case PROP_OBJECT_IDENTIFIER:
apdu_len = encode_application_object_id(
&apdu[0], Object_Type, rpdata->object_instance);
break;
case PROP_OBJECT_NAME:
Analog_Output_Object_Name(rpdata->object_instance, &char_string);
apdu_len =
encode_application_character_string(&apdu[0], &char_string);
break;
case PROP_OBJECT_TYPE:
apdu_len =
encode_application_enumerated(&apdu[0], Object_Type);
break;
case PROP_PRESENT_VALUE:
real_value = Analog_Output_Present_Value(rpdata->object_instance);
apdu_len = encode_application_real(&apdu[0], real_value);