From 82a03d948b046de3d02c75c2668878341ec0b89b Mon Sep 17 00:00:00 2001 From: skarg Date: Mon, 20 Jul 2009 22:15:08 +0000 Subject: [PATCH] Corrected present_value priority array offset for binary output examples. --- bacnet-stack/demo/object/bo.c | 4 ++-- bacnet-stack/ports/bdk-atxx4-mstp/bo.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bacnet-stack/demo/object/bo.c b/bacnet-stack/demo/object/bo.c index de4f6c35..b33b70ac 100644 --- a/bacnet-stack/demo/object/bo.c +++ b/bacnet-stack/demo/object/bo.c @@ -285,12 +285,12 @@ int Binary_Output_Encode_Property_APDU( object_index = Binary_Output_Instance_To_Index(object_instance); if (array_index <= BACNET_MAX_PRIORITY) { - if (Binary_Output_Level[object_index][array_index] == + if (Binary_Output_Level[object_index][array_index-1] == BINARY_NULL) len = encode_application_null(&apdu[apdu_len]); else { present_value = - Binary_Output_Level[object_index][array_index]; + Binary_Output_Level[object_index][array_index-1]; len = encode_application_enumerated(&apdu[apdu_len], present_value); diff --git a/bacnet-stack/ports/bdk-atxx4-mstp/bo.c b/bacnet-stack/ports/bdk-atxx4-mstp/bo.c index ada59700..23089a0a 100644 --- a/bacnet-stack/ports/bdk-atxx4-mstp/bo.c +++ b/bacnet-stack/ports/bdk-atxx4-mstp/bo.c @@ -351,7 +351,7 @@ int Binary_Output_Encode_Property_APDU( Binary_Output_Instance_To_Index(object_instance); if (array_index <= BACNET_MAX_PRIORITY) { present_value = - Binary_Output_Level[object_index][array_index]; + Binary_Output_Level[object_index][array_index-1]; if (present_value == BINARY_NULL) { len = encode_application_null(&apdu[apdu_len]); } else {