From b41c124dcc11d4fefc3d6a21afaf30426fcfda55 Mon Sep 17 00:00:00 2001 From: skarg Date: Tue, 27 Feb 2007 22:17:34 +0000 Subject: [PATCH] Corrected Analog Output setting of value which had priority off-by-one error. --- bacnet-stack/demo/object/ao.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bacnet-stack/demo/object/ao.c b/bacnet-stack/demo/object/ao.c index e0d4ee2d..346b0c16 100644 --- a/bacnet-stack/demo/object/ao.c +++ b/bacnet-stack/demo/object/ao.c @@ -168,7 +168,7 @@ bool Analog_Output_Present_Value_Set(uint32_t object_instance, if (priority && (priority <= BACNET_MAX_PRIORITY) && (priority != 6 /* reserved */ ) && (value >= 0.0) && (value <= 100.0)) { - Analog_Output_Level[index][priority] = (uint8_t) value; + Analog_Output_Level[index][priority-1] = (uint8_t) value; /* Note: you could set the physical output here to the next highest priority, or to the relinquish default if no priorities are set. @@ -192,7 +192,7 @@ bool Analog_Output_Present_Value_Relinquish(uint32_t object_instance, if (index < MAX_ANALOG_OUTPUTS) { if (priority && (priority <= BACNET_MAX_PRIORITY) && (priority != 6 /* reserved */ )) { - Analog_Output_Level[index][priority] = AO_LEVEL_NULL; + Analog_Output_Level[index][priority-1] = AO_LEVEL_NULL; /* Note: you could set the physical output here to the next highest priority, or to the relinquish default if no priorities are set.