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 =
|
object_index =
|
||||||
Analog_Output_Instance_To_Index(object_instance);
|
Analog_Output_Instance_To_Index(object_instance);
|
||||||
if (array_index <= BACNET_MAX_PRIORITY) {
|
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)
|
AO_LEVEL_NULL)
|
||||||
apdu_len = encode_tagged_null(&apdu[0]);
|
apdu_len = encode_tagged_null(&apdu[0]);
|
||||||
else {
|
else {
|
||||||
real_value =
|
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);
|
apdu_len = encode_tagged_real(&apdu[0], real_value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -233,12 +233,12 @@ int Analog_Value_Encode_Property_APDU(uint8_t * apdu,
|
|||||||
} else {
|
} else {
|
||||||
object_index = Analog_Value_Instance_To_Index(object_instance);
|
object_index = Analog_Value_Instance_To_Index(object_instance);
|
||||||
if (array_index <= BACNET_MAX_PRIORITY) {
|
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)
|
ANALOG_LEVEL_NULL)
|
||||||
apdu_len = encode_tagged_null(&apdu[0]);
|
apdu_len = encode_tagged_null(&apdu[0]);
|
||||||
else {
|
else {
|
||||||
real_value =
|
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);
|
apdu_len = encode_tagged_real(&apdu[0], real_value);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -236,12 +236,12 @@ int Multistate_Output_Encode_Property_APDU(uint8_t * apdu,
|
|||||||
object_index =
|
object_index =
|
||||||
Multistate_Output_Instance_To_Index(object_instance);
|
Multistate_Output_Instance_To_Index(object_instance);
|
||||||
if (array_index <= BACNET_MAX_PRIORITY) {
|
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)
|
MULTISTATE_NULL)
|
||||||
apdu_len = encode_tagged_null(&apdu[0]);
|
apdu_len = encode_tagged_null(&apdu[0]);
|
||||||
else {
|
else {
|
||||||
present_value =
|
present_value =
|
||||||
Multistate_Output_Level[object_index][array_index];
|
Multistate_Output_Level[object_index][array_index-1];
|
||||||
apdu_len =
|
apdu_len =
|
||||||
encode_tagged_unsigned(&apdu[0],
|
encode_tagged_unsigned(&apdu[0],
|
||||||
present_value);
|
present_value);
|
||||||
|
|||||||
Reference in New Issue
Block a user