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 {