From c33944e0f8e706bce27995dc71f7ebebb1b0fbbd Mon Sep 17 00:00:00 2001 From: Steve Karg Date: Tue, 2 Dec 2025 12:37:27 -0600 Subject: [PATCH] Fixed the units to/from ASCII to function for other units properties. (#1165) --- CHANGELOG.md | 1 + src/bacnet/bacapp.c | 6 ++++++ src/bacnet/bactext.c | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8c32d32..a29a0ac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ The git repositories are hosted at the following sites: ### Fixed +* Fixed the units to/from ASCII to function for other units properties. (#1165) * Fixed datetime integer overflow on 8-bit AVR compiler (#1162) * Fixed the ports/linux BACnet/IP cache netmask for accurate subnet prefix calculation implementation which had always returned 0. (#1155) diff --git a/src/bacnet/bacapp.c b/src/bacnet/bacapp.c index 655d76da..7484814c 100644 --- a/src/bacnet/bacapp.c +++ b/src/bacnet/bacapp.c @@ -2386,6 +2386,12 @@ static int bacapp_snprintf_enumerated( str, str_len, "%s", bactext_event_state_name(value)); break; case PROP_UNITS: + case PROP_CONTROLLED_VARIABLE_UNITS: + case PROP_DERIVATIVE_CONSTANT_UNITS: + case PROP_INTEGRAL_CONSTANT_UNITS: + case PROP_PROPORTIONAL_CONSTANT_UNITS: + case PROP_OUTPUT_UNITS: + case PROP_CAR_LOAD_UNITS: if (bactext_engineering_unit_name_proprietary((unsigned)value)) { ret_val = bacapp_snprintf( str, str_len, "proprietary-%lu", (unsigned long)value); diff --git a/src/bacnet/bactext.c b/src/bacnet/bactext.c index 1f2b410b..3750be89 100644 --- a/src/bacnet/bactext.c +++ b/src/bacnet/bactext.c @@ -3032,6 +3032,12 @@ bool bactext_object_property_strtoul( bacnet_event_state_names, search_name, found_index); break; case PROP_UNITS: + case PROP_CONTROLLED_VARIABLE_UNITS: + case PROP_DERIVATIVE_CONSTANT_UNITS: + case PROP_INTEGRAL_CONSTANT_UNITS: + case PROP_PROPORTIONAL_CONSTANT_UNITS: + case PROP_OUTPUT_UNITS: + case PROP_CAR_LOAD_UNITS: status = bactext_string_to_uint32_index( bacnet_engineering_unit_names, search_name, found_index); break;