From c304b8b3307008abedc9596efe21c542fa2a8c02 Mon Sep 17 00:00:00 2001 From: skarg Date: Sun, 23 Aug 2009 03:48:27 +0000 Subject: [PATCH] Added a parameter to Device_Encode_Property_APDU so that it matched all the ther objects, which required all the demo and ports to modify their device and h_rp files. --- bacnet-stack/ports/at91sam7s/device.c | 2 ++ bacnet-stack/ports/at91sam7s/h_rp.c | 3 ++- bacnet-stack/ports/atmega168/device.c | 2 ++ bacnet-stack/ports/atmega168/h_rp.c | 4 +++- bacnet-stack/ports/atmega8/device.c | 2 ++ bacnet-stack/ports/atmega8/h_rp.c | 4 +++- bacnet-stack/ports/bdk-atxx4-mstp/device.c | 2 ++ bacnet-stack/ports/bdk-atxx4-mstp/h_rp.c | 3 ++- bacnet-stack/ports/pic18f6720/device.c | 2 ++ bacnet-stack/ports/pic18f6720/h_rp.c | 1 + 10 files changed, 21 insertions(+), 4 deletions(-) diff --git a/bacnet-stack/ports/at91sam7s/device.c b/bacnet-stack/ports/at91sam7s/device.c index 370a4732..633b40a3 100644 --- a/bacnet-stack/ports/at91sam7s/device.c +++ b/bacnet-stack/ports/at91sam7s/device.c @@ -238,6 +238,7 @@ bool Device_Object_List_Identifier( /* return the length of the apdu encoded or -1 for error */ int Device_Encode_Property_APDU( uint8_t * apdu, + uint32_t object_instance, BACNET_PROPERTY_ID property, int32_t array_index, BACNET_ERROR_CLASS * error_class, @@ -254,6 +255,7 @@ int Device_Encode_Property_APDU( BACNET_TIME local_time; BACNET_DATE local_date; + object_instance = object_instance; /* FIXME: change the hardcoded names to suit your application */ switch (property) { case PROP_OBJECT_IDENTIFIER: diff --git a/bacnet-stack/ports/at91sam7s/h_rp.c b/bacnet-stack/ports/at91sam7s/h_rp.c index 341f61ab..482b174f 100644 --- a/bacnet-stack/ports/at91sam7s/h_rp.c +++ b/bacnet-stack/ports/at91sam7s/h_rp.c @@ -66,7 +66,8 @@ int Encode_Property_APDU( case OBJECT_DEVICE: if (Device_Valid_Object_Instance_Number(object_instance)) { apdu_len = - Device_Encode_Property_APDU(&apdu[0], property, + Device_Encode_Property_APDU(&apdu[0], + object_instance, property, array_index, error_class, error_code); } break; diff --git a/bacnet-stack/ports/atmega168/device.c b/bacnet-stack/ports/atmega168/device.c index c291e3f7..846fafd2 100644 --- a/bacnet-stack/ports/atmega168/device.c +++ b/bacnet-stack/ports/atmega168/device.c @@ -164,6 +164,7 @@ bool Device_Object_List_Identifier( /* return the length of the apdu encoded or -1 for error */ int Device_Encode_Property_APDU( uint8_t * apdu, + uint32_t object_instance, BACNET_PROPERTY_ID property, int32_t array_index, BACNET_ERROR_CLASS * error_class, @@ -178,6 +179,7 @@ int Device_Encode_Property_APDU( uint32_t instance = 0; unsigned count = 0; + object_instance = object_instance; /* FIXME: change the hardcoded names to suit your application */ switch (property) { case PROP_OBJECT_IDENTIFIER: diff --git a/bacnet-stack/ports/atmega168/h_rp.c b/bacnet-stack/ports/atmega168/h_rp.c index cf6475db..00171b26 100644 --- a/bacnet-stack/ports/atmega168/h_rp.c +++ b/bacnet-stack/ports/atmega168/h_rp.c @@ -57,7 +57,9 @@ int Encode_Property_APDU( if (Device_Valid_Object_Instance_Number(rp_data->object_instance)) { apdu_len = Device_Encode_Property_APDU(&apdu[0], - rp_data->object_property, rp_data->array_index, + rp_data->object_instance, + rp_data->object_property, + rp_data->array_index, error_class, error_code); } break; diff --git a/bacnet-stack/ports/atmega8/device.c b/bacnet-stack/ports/atmega8/device.c index bbf7272b..b788480b 100644 --- a/bacnet-stack/ports/atmega8/device.c +++ b/bacnet-stack/ports/atmega8/device.c @@ -170,6 +170,7 @@ bool Device_Object_List_Identifier( /* return the length of the apdu encoded or -1 for error */ int Device_Encode_Property_APDU( uint8_t * apdu, + uint32_t object_instance, BACNET_PROPERTY_ID property, int32_t array_index, BACNET_ERROR_CLASS * error_class, @@ -184,6 +185,7 @@ int Device_Encode_Property_APDU( uint32_t instance = 0; unsigned count = 0; + object_instance = object_instance; /* FIXME: change the hardcoded names to suit your application */ switch (property) { case PROP_OBJECT_IDENTIFIER: diff --git a/bacnet-stack/ports/atmega8/h_rp.c b/bacnet-stack/ports/atmega8/h_rp.c index 94f0f423..419b6279 100644 --- a/bacnet-stack/ports/atmega8/h_rp.c +++ b/bacnet-stack/ports/atmega8/h_rp.c @@ -61,7 +61,9 @@ int Encode_Property_APDU( if (Device_Valid_Object_Instance_Number(rp_data->object_instance)) { apdu_len = Device_Encode_Property_APDU(&apdu[0], - rp_data->object_property, rp_data->array_index, + rp_data->object_instance, + rp_data->object_property, + rp_data->array_index, error_class, error_code); } break; diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/device.c b/bacnet-stack/ports/bdk-atxx4-mstp/device.c index a48c8da4..3bbfd826 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/device.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/device.c @@ -308,6 +308,7 @@ bool Device_Object_List_Identifier( /* return the length of the apdu encoded or -1 for error */ int Device_Encode_Property_APDU( uint8_t * apdu, + uint32_t object_instance, BACNET_PROPERTY_ID property, int32_t array_index, BACNET_ERROR_CLASS * error_class, @@ -322,6 +323,7 @@ int Device_Encode_Property_APDU( uint32_t instance = 0; unsigned count = 0; + object_instance = object_instance; /* FIXME: change the hardcoded names to suit your application */ switch (property) { case PROP_OBJECT_IDENTIFIER: diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/h_rp.c b/bacnet-stack/ports/bdk-atxx4-mstp/h_rp.c index abec7608..414518e4 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/h_rp.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/h_rp.c @@ -66,7 +66,8 @@ int Encode_Property_APDU( case OBJECT_DEVICE: if (Device_Valid_Object_Instance_Number(object_instance)) { apdu_len = - Device_Encode_Property_APDU(&apdu[0], property, + Device_Encode_Property_APDU(&apdu[0], + object_instance, property, array_index, error_class, error_code); } break; diff --git a/bacnet-stack/ports/pic18f6720/device.c b/bacnet-stack/ports/pic18f6720/device.c index 4cdf7c2c..f6941f8e 100644 --- a/bacnet-stack/ports/pic18f6720/device.c +++ b/bacnet-stack/ports/pic18f6720/device.c @@ -242,6 +242,7 @@ bool Device_Object_List_Identifier( /* return the length of the apdu encoded or -1 for error */ int Device_Encode_Property_APDU( uint8_t * apdu, + uint32_t object_instance, BACNET_PROPERTY_ID property, int32_t array_index, BACNET_ERROR_CLASS * error_class, @@ -261,6 +262,7 @@ int Device_Encode_Property_APDU( char string_buffer[24]; int16_t TimeZone = 0; + object_instance = object_instance; /* FIXME: change the hardcoded names to suit your application */ switch (property) { case PROP_OBJECT_IDENTIFIER: diff --git a/bacnet-stack/ports/pic18f6720/h_rp.c b/bacnet-stack/ports/pic18f6720/h_rp.c index 3f0f789a..6fcc38ee 100644 --- a/bacnet-stack/ports/pic18f6720/h_rp.c +++ b/bacnet-stack/ports/pic18f6720/h_rp.c @@ -93,6 +93,7 @@ void handler_read_property( if (Device_Valid_Object_Instance_Number(data.object_instance)) { len = Device_Encode_Property_APDU(&Temp_Buf[0], + data.object_instance, data.object_property, data.array_index, &error_class, &error_code); if (len >= 0) {