From b36225149c3b5205a208c3c5fe7d8f6cc6898852 Mon Sep 17 00:00:00 2001 From: skarg Date: Mon, 15 Jan 2007 16:10:12 +0000 Subject: [PATCH] Corrected index offset for priority array when read one index at a time. --- bacnet-stack/demo/object/ao.c | 4 ++-- bacnet-stack/demo/object/av.c | 4 ++-- bacnet-stack/demo/object/mso.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bacnet-stack/demo/object/ao.c b/bacnet-stack/demo/object/ao.c index 00df4fc7..0b322561 100644 --- a/bacnet-stack/demo/object/ao.c +++ b/bacnet-stack/demo/object/ao.c @@ -236,12 +236,12 @@ int Analog_Output_Encode_Property_APDU(uint8_t * apdu, object_index = Analog_Output_Instance_To_Index(object_instance); if (array_index <= BACNET_MAX_PRIORITY) { - if (Analog_Output_Level[object_index][array_index] == + if (Analog_Output_Level[object_index][array_index-1] == AO_LEVEL_NULL) apdu_len = encode_tagged_null(&apdu[0]); else { real_value = - Analog_Output_Level[object_index][array_index]; + Analog_Output_Level[object_index][array_index-1]; apdu_len = encode_tagged_real(&apdu[0], real_value); } } else { diff --git a/bacnet-stack/demo/object/av.c b/bacnet-stack/demo/object/av.c index ef9213c5..6cffb6d4 100644 --- a/bacnet-stack/demo/object/av.c +++ b/bacnet-stack/demo/object/av.c @@ -233,12 +233,12 @@ int Analog_Value_Encode_Property_APDU(uint8_t * apdu, } else { object_index = Analog_Value_Instance_To_Index(object_instance); if (array_index <= BACNET_MAX_PRIORITY) { - if (Analog_Value_Level[object_index][array_index] == + if (Analog_Value_Level[object_index][array_index-1] == ANALOG_LEVEL_NULL) apdu_len = encode_tagged_null(&apdu[0]); else { real_value = - Analog_Value_Level[object_index][array_index]; + Analog_Value_Level[object_index][array_index-1]; apdu_len = encode_tagged_real(&apdu[0], real_value); } } else { diff --git a/bacnet-stack/demo/object/mso.c b/bacnet-stack/demo/object/mso.c index 1d7479b3..7b20e6de 100644 --- a/bacnet-stack/demo/object/mso.c +++ b/bacnet-stack/demo/object/mso.c @@ -236,12 +236,12 @@ int Multistate_Output_Encode_Property_APDU(uint8_t * apdu, object_index = Multistate_Output_Instance_To_Index(object_instance); if (array_index <= BACNET_MAX_PRIORITY) { - if (Multistate_Output_Level[object_index][array_index] == + if (Multistate_Output_Level[object_index][array_index-1] == MULTISTATE_NULL) apdu_len = encode_tagged_null(&apdu[0]); else { present_value = - Multistate_Output_Level[object_index][array_index]; + Multistate_Output_Level[object_index][array_index-1]; apdu_len = encode_tagged_unsigned(&apdu[0], present_value);