diff --git a/comment.sh b/comment.sh index 09aef9bd..a9c1dfeb 100755 --- a/comment.sh +++ b/comment.sh @@ -1,6 +1,7 @@ #!/bin/bash # This script converts any C++ comments to C comments # using the ccmtcnvt tool from the liwc package +# sudo apt install liwc CONVERTER=/usr/bin/ccmtcnvt # silent fail if the tool is not installed diff --git a/src/bacnet/event.c b/src/bacnet/event.c index 5a6b53fe..19189cfd 100644 --- a/src/bacnet/event.c +++ b/src/bacnet/event.c @@ -61,7 +61,7 @@ static int parse_complex_event_type_values(int len, unsigned apdu_len, uint8_t * } */ - // TODO this is mostly copied from "cov_notify_decode_service_request" - extract to a common function? + /* TODO this is mostly copied from "cov_notify_decode_service_request" - extract to a common function? */ uint8_t tag_number = 0; uint32_t len_value = 0; @@ -71,12 +71,12 @@ static int parse_complex_event_type_values(int len, unsigned apdu_len, uint8_t * int app_len = 0; #if (BACNET_DECODE_COMPLEX_EVENT_TYPE_PARAMETERS == 1) + BACNET_PROPERTY_VALUE *values; + BACNET_PROPERTY_VALUE *value; /* we want to extract the values */ - BACNET_PROPERTY_VALUE *values = data->notificationParams.complexEventType.values; + values = data->notificationParams.complexEventType.values; bacapp_property_value_list_init(values, BACNET_COMPLEX_EVENT_TYPE_MAX_PARAMETERS); - - BACNET_PROPERTY_VALUE *value = values; - + value = values; for(;;) { /* tag 0 - propertyIdentifier */ if (len >= (int)apdu_len) { @@ -151,11 +151,12 @@ static int parse_complex_event_type_values(int len, unsigned apdu_len, uint8_t * } } #else - // we just want to discard the complex values + /* we just want to discard the complex values */ BACNET_PROPERTY_VALUE dummyValue; - bacapp_property_value_list_init(&dummyValue, 1); - BACNET_PROPERTY_VALUE *value = &dummyValue; + BACNET_PROPERTY_VALUE *value; + bacapp_property_value_list_init(&dummyValue, 1); + value = &dummyValue; for(;;) { /* tag 0 - propertyIdentifier */ if (len >= (int)apdu_len) { diff --git a/src/bacnet/event.h b/src/bacnet/event.h index ad086c19..edda5e19 100644 --- a/src/bacnet/event.h +++ b/src/bacnet/event.h @@ -49,8 +49,6 @@ typedef enum { */ -// TODO make these configurable from env? - /** Enable decoding of complex-event-type property-values. If set to 0, the values are decoded and discarded. */ #ifndef BACNET_DECODE_COMPLEX_EVENT_TYPE_PARAMETERS #define BACNET_DECODE_COMPLEX_EVENT_TYPE_PARAMETERS 1