From 954d2b0079ae71b164938e9a4b4d8128a5fc96e2 Mon Sep 17 00:00:00 2001 From: petermcs Date: Sat, 31 Dec 2011 08:05:29 +0000 Subject: [PATCH] Moved check for wild card Device Id to before call to rpm_ack_encode_apdu_object_begin so that the real Device ID is encoded in the response. --- bacnet-stack/demo/handler/h_rpm.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bacnet-stack/demo/handler/h_rpm.c b/bacnet-stack/demo/handler/h_rpm.c index 4168bd4f..e0a85b94 100644 --- a/bacnet-stack/demo/handler/h_rpm.c +++ b/bacnet-stack/demo/handler/h_rpm.c @@ -126,11 +126,6 @@ static int RPM_Encode_Property( len = 0; rpdata.error_class = ERROR_CLASS_OBJECT; rpdata.error_code = ERROR_CODE_UNKNOWN_OBJECT; - /* Test for case of indefinite Device object instance */ - if ((rpmdata->object_type == OBJECT_DEVICE) && - (rpmdata->object_instance == BACNET_MAX_INSTANCE)) { - rpmdata->object_instance = Device_Object_Instance_Number(); - } rpdata.object_type = rpmdata->object_type; rpdata.object_instance = rpmdata->object_instance; rpdata.object_property = rpmdata->object_property; @@ -245,6 +240,12 @@ void handler_read_property_multiple( goto RPM_FAILURE; } + /* Test for case of indefinite Device object instance */ + if ((rpmdata.object_type == OBJECT_DEVICE) && + (rpmdata.object_instance == BACNET_MAX_INSTANCE)) { + rpmdata.object_instance = Device_Object_Instance_Number(); + } + /* Stick this object id into the reply - if it will fit */ len = rpm_ack_encode_apdu_object_begin(&Temp_Buf[0], &rpmdata); copy_len =