Moved Device object dependency to the demo handlers.

This commit is contained in:
skarg
2011-10-03 22:24:57 +00:00
parent ed4a72ed0a
commit 9c1f651458
4 changed files with 17 additions and 18 deletions
+5
View File
@@ -117,6 +117,11 @@ void handler_read_property(
rpdata.application_data = &Handler_Transmit_Buffer[npdu_len + apdu_len];
rpdata.application_data_len =
sizeof(Handler_Transmit_Buffer) - (npdu_len + apdu_len);
/* Test for case of indefinite Device object instance */
if ((rpdata.object_type == OBJECT_DEVICE) &&
(rpdata.object_instance == BACNET_MAX_INSTANCE)) {
rpdata.object_instance = Device_Object_Instance_Number();
}
len = Device_Read_Property(&rpdata);
if (len >= 0) {
apdu_len += len;
+5
View File
@@ -126,6 +126,11 @@ 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;