Corrected index offset for priority array when read one index at a time.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user