diff --git a/examples/dynamic-bridge-app/linux/include/data-model/DataModel.h b/examples/dynamic-bridge-app/linux/include/data-model/DataModel.h index cba8d3c9907129..053cd785aac472 100644 --- a/examples/dynamic-bridge-app/linux/include/data-model/DataModel.h +++ b/examples/dynamic-bridge-app/linux/include/data-model/DataModel.h @@ -201,7 +201,7 @@ CHIP_ERROR Encode(const ConcreteReadAttributePath & aPath, AttributeValueEncoder // CONFIG_BUILD_FOR_HOST_UNIT_TEST is true, so we can test how the other side // responds. #if !CONFIG_BUILD_FOR_HOST_UNIT_TEST - if (!x.HasValidValue()) + if (!x.ExistingValueInEncodableRange()) { return CHIP_IM_GLOBAL_STATUS(ConstraintError); } @@ -313,7 +313,7 @@ CHIP_ERROR Decode(const ConcreteDataAttributePath & aPath, AttributeValueDecoder // We have a value; decode it. ReturnErrorOnFailure(Decode(aPath, aDecoder, x.SetNonNull())); - if (!x.HasValidValue()) + if (!x.ExistingValueInEncodableRange()) { return CHIP_IM_GLOBAL_STATUS(ConstraintError); } diff --git a/src/app/data-model/Decode.h b/src/app/data-model/Decode.h index 5124fa44337a52..4acc96f138c50e 100644 --- a/src/app/data-model/Decode.h +++ b/src/app/data-model/Decode.h @@ -170,7 +170,7 @@ CHIP_ERROR Decode(TLV::TLVReader & reader, Nullable & x) // We have a value; decode it. ReturnErrorOnFailure(Decode(reader, x.SetNonNull())); - if (!x.HasValidValue()) + if (!x.ExistingValueInEncodableRange()) { return CHIP_IM_GLOBAL_STATUS(ConstraintError); } diff --git a/src/app/data-model/Encode.h b/src/app/data-model/Encode.h index 0546098a74184d..84a32cf745983c 100644 --- a/src/app/data-model/Encode.h +++ b/src/app/data-model/Encode.h @@ -188,7 +188,7 @@ CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, const Nullable & x) // CONFIG_BUILD_FOR_HOST_UNIT_TEST is true, so we can test how the other side // responds. #if !CONFIG_BUILD_FOR_HOST_UNIT_TEST - if (!x.HasValidValue()) + if (!x.ExistingValueInEncodableRange()) { return CHIP_IM_GLOBAL_STATUS(ConstraintError); } diff --git a/src/app/data-model/Nullable.h b/src/app/data-model/Nullable.h index 844a7c1b385ae9..ad6bdaf9e2c172 100644 --- a/src/app/data-model/Nullable.h +++ b/src/app/data-model/Nullable.h @@ -65,7 +65,7 @@ struct Nullable : protected Optional template < typename U = std::decay_t, typename std::enable_if_t<(std::is_integral::value && !std::is_same::value) || std::is_enum::value, int> = 0> - constexpr bool HasValidValue() const + constexpr bool ExistingValueInEncodableRange() const { return NumericAttributeTraits::CanRepresentValue(/* isNullable = */ true, Value()); } @@ -74,7 +74,7 @@ struct Nullable : protected Optional template , typename std::enable_if_t<(!std::is_integral::value || std::is_same::value) && !std::is_enum::value, int> = 0> - constexpr bool HasValidValue() const + constexpr bool ExistingValueInEncodableRange() const { return true; }