From 9d9c1eedaf6124717339b3ff15e6bbb7ba2a21c4 Mon Sep 17 00:00:00 2001 From: tbrennan3 Date: Sun, 18 Sep 2011 17:13:04 +0000 Subject: [PATCH] More compliant DCC Disable or Disable_Initiation: if no time argument is given, take it as indefinite (a large number) rather than 0. --- bacnet-stack/src/dcc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bacnet-stack/src/dcc.c b/bacnet-stack/src/dcc.c index 54616129..965b0f5d 100644 --- a/bacnet-stack/src/dcc.c +++ b/bacnet-stack/src/dcc.c @@ -177,7 +177,9 @@ int dcc_decode_service_request( /* check for value pointers */ if (apdu_len) { - /* Tag 0: timeDuration --optional-- */ + /* Tag 0: timeDuration, in minutes --optional-- + * But if not included, take it as indefinite, + * which we return as "very large" */ if (decode_is_context_tag(&apdu[len], 0)) { len += decode_tag_number_and_value(&apdu[len], &tag_number, @@ -186,7 +188,7 @@ int dcc_decode_service_request( if (timeDuration) *timeDuration = (uint16_t) value32; } else if (timeDuration) - *timeDuration = 0; + *timeDuration = 0xFFFF; /* As big as we can make it: 2.99 years */ /* Tag 1: enable_disable */ if (!decode_is_context_tag(&apdu[len], 1)) return -1;