Fixed WriteProperty bypass which is only for present-value property of commandable objects. (#984)

This commit is contained in:
Steve Karg
2025-05-05 21:48:29 -05:00
committed by GitHub
parent 44d727c13b
commit 0f3cbe3ec5
7 changed files with 123 additions and 24 deletions
+21 -15
View File
@@ -500,6 +500,12 @@ bool write_property_unsigned_decode(
* the property shall not be changed, and the write shall
* be considered successful.
*
* @note There was an interpretation request in April 2025 that clarifies
* that the NULL bypass is only for present-value property of objects that
* optionally support a priority array but don't implement it.
* See 135-2024-19.2.1.1 Commandable Properties for the list of commandable
* properties of specific objects.
*
* @param wp_data [in] The WriteProperty data structure
* @param member_of_object [in] Function to check if a property is a member
of an object instance
@@ -520,25 +526,25 @@ bool write_property_relinquish_bypass(
wp_data->application_data, wp_data->application_data_len);
if ((len > 0) && (len == wp_data->application_data_len)) {
/* single NULL */
/* check to see if this object property is commandable.
Does the property list contain a priority-array? */
if (member_of_object) {
has_priority_array = member_of_object(
wp_data->object_type, wp_data->object_instance,
PROP_PRIORITY_ARRAY);
}
if (has_priority_array || (wp_data->object_type == OBJECT_CHANNEL)) {
if (wp_data->object_property != PROP_PRESENT_VALUE) {
/* this property is not commandable,
if (property_list_commandable_member(
wp_data->object_type, wp_data->object_property)) {
if (member_of_object) {
/* check to see if this object property is commandable.
Does the property list contain a priority-array? */
has_priority_array = member_of_object(
wp_data->object_type, wp_data->object_instance,
PROP_PRIORITY_ARRAY);
}
if (has_priority_array ||
(wp_data->object_type == OBJECT_CHANNEL)) {
/* this property is commandable and shall not be bypassed */
} else {
/* this property that is optionally commandable
is not commandable for this object instance,
so it "shall not be changed, and
the write shall be considered successful." */
bypass = true;
}
} else {
/* this object is not commandable, so any property
written with a NULL "shall not be changed, and
the write shall be considered successful." */
bypass = true;
}
}