From 7ccbb406b4ae56ebd5c2b719e818f247f3b33a7b Mon Sep 17 00:00:00 2001 From: k001a Date: Mon, 15 Aug 2011 09:35:14 +0000 Subject: [PATCH] WritePropertyMultiple: if an attempt is made to write to a commandable property without specifying the priority then the writing is at the lowest priority (number 16). --- bacnet-stack/src/wpm.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/bacnet-stack/src/wpm.c b/bacnet-stack/src/wpm.c index ea2804db..2f1d2f84 100644 --- a/bacnet-stack/src/wpm.c +++ b/bacnet-stack/src/wpm.c @@ -75,7 +75,7 @@ int wpm_decode_object_property(uint8_t * apdu, if((apdu) && (apdu_len) && (wp_data)) { wp_data->array_index = BACNET_ARRAY_ALL; - wp_data->priority = BACNET_NO_PRIORITY; + wp_data->priority = BACNET_MAX_PRIORITY; wp_data->application_data_len = 0; /* tag 0 - Property Identifier */ @@ -90,7 +90,7 @@ int wpm_decode_object_property(uint8_t * apdu, /* tag 1 - Property Array Index - optional */ len += decode_tag_number_and_value(&apdu[len], &tag_number, &len_value); - if(tag_number ==1) + if(tag_number == 1) { len += decode_unsigned(&apdu[len],len_value, &ulVal); wp_data->array_index = ulVal; @@ -120,12 +120,9 @@ int wpm_decode_object_property(uint8_t * apdu, /* tag 3 - Priority - optional */ len += decode_tag_number_and_value(&apdu[len], &tag_number, &len_value); - if(tag_number == 3) - { - uint32_t priority = BACNET_NO_PRIORITY; - - len += decode_unsigned(&apdu[len], len_value, &priority); - wp_data->priority = priority; + if(tag_number == 3) { + len += decode_unsigned(&apdu[len], len_value, &ulVal); + wp_data->priority = ulVal; } else len--;