diff --git a/bacnet-stack/demo/object/ao.c b/bacnet-stack/demo/object/ao.c index b967885e..00df4fc7 100644 --- a/bacnet-stack/demo/object/ao.c +++ b/bacnet-stack/demo/object/ao.c @@ -238,11 +238,11 @@ int Analog_Output_Encode_Property_APDU(uint8_t * apdu, if (array_index <= BACNET_MAX_PRIORITY) { if (Analog_Output_Level[object_index][array_index] == AO_LEVEL_NULL) - len = encode_tagged_null(&apdu[apdu_len]); + apdu_len = encode_tagged_null(&apdu[0]); else { real_value = Analog_Output_Level[object_index][array_index]; - len = encode_tagged_real(&apdu[apdu_len], real_value); + apdu_len = encode_tagged_real(&apdu[0], real_value); } } else { *error_class = ERROR_CLASS_PROPERTY; diff --git a/bacnet-stack/demo/object/av.c b/bacnet-stack/demo/object/av.c index 5146503b..ef9213c5 100644 --- a/bacnet-stack/demo/object/av.c +++ b/bacnet-stack/demo/object/av.c @@ -235,11 +235,11 @@ int Analog_Value_Encode_Property_APDU(uint8_t * apdu, if (array_index <= BACNET_MAX_PRIORITY) { if (Analog_Value_Level[object_index][array_index] == ANALOG_LEVEL_NULL) - len = encode_tagged_null(&apdu[apdu_len]); + apdu_len = encode_tagged_null(&apdu[0]); else { real_value = Analog_Value_Level[object_index][array_index]; - len = encode_tagged_real(&apdu[apdu_len], real_value); + apdu_len = encode_tagged_real(&apdu[0], real_value); } } else { *error_class = ERROR_CLASS_PROPERTY; diff --git a/bacnet-stack/demo/object/mso.c b/bacnet-stack/demo/object/mso.c index e052ddcc..1d7479b3 100644 --- a/bacnet-stack/demo/object/mso.c +++ b/bacnet-stack/demo/object/mso.c @@ -238,12 +238,12 @@ int Multistate_Output_Encode_Property_APDU(uint8_t * apdu, if (array_index <= BACNET_MAX_PRIORITY) { if (Multistate_Output_Level[object_index][array_index] == MULTISTATE_NULL) - len = encode_tagged_null(&apdu[apdu_len]); + apdu_len = encode_tagged_null(&apdu[0]); else { present_value = Multistate_Output_Level[object_index][array_index]; - len = - encode_tagged_unsigned(&apdu[apdu_len], + apdu_len = + encode_tagged_unsigned(&apdu[0], present_value); } } else {