Added handling for abort and reject errors in Write Property service (#1216)

This commit is contained in:
Steve Karg
2026-02-02 13:54:26 -06:00
committed by GitHub
parent 59218819c1
commit 577ecf8d7f
2 changed files with 15 additions and 2 deletions
+2 -1
View File
@@ -12,7 +12,7 @@ The git repositories are hosted at the following sites:
* https://bacnet.sourceforge.net/
* https://github.com/bacnet-stack/bacnet-stack/
## [Unreleased] - 2026-01-28
## [Unreleased] - 2026-02-02
### Security
@@ -120,6 +120,7 @@ The git repositories are hosted at the following sites:
### Fixed
* Fixed handling for abort and reject errors in Write Property service. (#1216)
* Fixed lighting output object lighting-commands for warn-off and
warn-relinquish when an update at the specified priority slot
shall occur after an egress time delay. (#1214)
+13 -1
View File
@@ -70,8 +70,10 @@ handler_write_property_relinquish_bypass(BACNET_WRITE_PROPERTY_DATA *wp_data)
* - an Abort if
* - the message is segmented
* - if decoding fails
* - the WriteProperty fails and error code is an Abort
* - a Reject if the WriteProperty fails and error code is a Reject
* - an ACK if Device_Write_Property() succeeds
* - an Error if Device_Write_Property() fails
* - an Error if Device_Write_Property() fails and error code is an Error
* or there isn't enough room in the APDU to fit the data.
*
* @param service_request [in] The contents of the service request.
@@ -154,6 +156,16 @@ void handler_write_property(
&Handler_Transmit_Buffer[pdu_len], service_data->invoke_id,
SERVICE_CONFIRMED_WRITE_PROPERTY);
debug_print("WP: Sending Simple Ack!\n");
} else if (abort_valid_error_code(wp_data.error_code)) {
len = abort_encode_apdu(
&Handler_Transmit_Buffer[pdu_len], service_data->invoke_id,
abort_convert_error_code(wp_data.error_code), true);
debug_print("WP: Sending Abort!\n");
} else if (reject_valid_error_code(wp_data.error_code)) {
len = reject_encode_apdu(
&Handler_Transmit_Buffer[pdu_len], service_data->invoke_id,
reject_convert_error_code(wp_data.error_code));
debug_print("WP: Sending Reject!\n");
} else {
len = bacerror_encode_apdu(
&Handler_Transmit_Buffer[pdu_len], service_data->invoke_id,