diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 9b2755b6c30801..0070684523029b 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2816,6 +2816,34 @@ server cluster TestCluster = 1295 { kValueC = 3; } + bitmap Bitmap16MaskMap : BITMAP16 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x4000; + } + + bitmap Bitmap32MaskMap : BITMAP32 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x40000000; + } + + bitmap Bitmap64MaskMap : BITMAP64 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x4000000000000000; + } + + bitmap Bitmap8MaskMap : BITMAP8 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x40; + } + bitmap SimpleBitmap : BITMAP8 { kValueA = 0x1; kValueB = 0x2; @@ -2894,10 +2922,10 @@ server cluster TestCluster = 1295 { } attribute boolean boolean = 0; - attribute bitmap8 bitmap8 = 1; - attribute bitmap16 bitmap16 = 2; - attribute bitmap32 bitmap32 = 3; - attribute bitmap64 bitmap64 = 4; + attribute Bitmap8MaskMap bitmap8 = 1; + attribute Bitmap16MaskMap bitmap16 = 2; + attribute Bitmap32MaskMap bitmap32 = 3; + attribute Bitmap64MaskMap bitmap64 = 4; attribute int8u int8u = 5; attribute int16u int16u = 6; attribute int24u int24u = 7; @@ -2941,10 +2969,10 @@ server cluster TestCluster = 1295 { attribute boolean generalErrorBoolean = 49; attribute boolean clusterErrorBoolean = 50; attribute nullable boolean nullableBoolean = 32768; - attribute nullable bitmap8 nullableBitmap8 = 32769; - attribute nullable bitmap16 nullableBitmap16 = 32770; - attribute nullable bitmap32 nullableBitmap32 = 32771; - attribute nullable bitmap64 nullableBitmap64 = 32772; + attribute nullable Bitmap8MaskMap nullableBitmap8 = 32769; + attribute nullable Bitmap16MaskMap nullableBitmap16 = 32770; + attribute nullable Bitmap32MaskMap nullableBitmap32 = 32771; + attribute nullable Bitmap64MaskMap nullableBitmap64 = 32772; attribute nullable int8u nullableInt8u = 32773; attribute nullable int16u nullableInt16u = 32774; attribute nullable int24u nullableInt24u = 32775; diff --git a/examples/chip-tool/templates/tests/partials/command_value.zapt b/examples/chip-tool/templates/tests/partials/command_value.zapt index e5e7c2b0943c7c..edb0968522bdef 100644 --- a/examples/chip-tool/templates/tests/partials/command_value.zapt +++ b/examples/chip-tool/templates/tests/partials/command_value.zapt @@ -48,7 +48,7 @@ chip::ByteSpan(chip::Uint8::from_const_char("{{octetStringEscapedForCLiteral definedValue}}garbage: not in length on purpose"), {{definedValue.length}}); {{else}} {{#if_is_bitmap type}} - static_cast<{{zapTypeToEncodableClusterObjectType type ns=ns}}>({{definedValue}}); + static_cast<{{zapTypeToEncodableClusterObjectType type ns=ns}}>({{asTypedLiteral definedValue type}}); {{else if (chip_tests_config_has definedValue)}} m{{asUpperCamelCase definedValue}}.HasValue() ? m{{asUpperCamelCase definedValue}}.Value() : {{asTypedLiteral (chip_tests_config_get_default_value definedValue) (chip_tests_config_get_type definedValue)}}; {{else}} diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 9aee7904ef9d0a..5e404e835a5e0c 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -2416,6 +2416,34 @@ server cluster TestCluster = 1295 { kValueC = 3; } + bitmap Bitmap16MaskMap : BITMAP16 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x4000; + } + + bitmap Bitmap32MaskMap : BITMAP32 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x40000000; + } + + bitmap Bitmap64MaskMap : BITMAP64 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x4000000000000000; + } + + bitmap Bitmap8MaskMap : BITMAP8 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x40; + } + bitmap SimpleBitmap : BITMAP8 { kValueA = 0x1; kValueB = 0x2; @@ -2441,10 +2469,10 @@ server cluster TestCluster = 1295 { } attribute boolean boolean = 0; - attribute bitmap8 bitmap8 = 1; - attribute bitmap16 bitmap16 = 2; - attribute bitmap32 bitmap32 = 3; - attribute bitmap64 bitmap64 = 4; + attribute Bitmap8MaskMap bitmap8 = 1; + attribute Bitmap16MaskMap bitmap16 = 2; + attribute Bitmap32MaskMap bitmap32 = 3; + attribute Bitmap64MaskMap bitmap64 = 4; attribute int8u int8u = 5; attribute int16u int16u = 6; attribute int32u int32u = 8; diff --git a/src/app/tests/suites/include/ConstraintsChecker.h b/src/app/tests/suites/include/ConstraintsChecker.h index ae50c2d969650e..1dcb9a3c56c486 100644 --- a/src/app/tests/suites/include/ConstraintsChecker.h +++ b/src/app/tests/suites/include/ConstraintsChecker.h @@ -257,6 +257,18 @@ class ConstraintsChecker return true; } + template + bool CheckConstraintNotValue(const char * itemName, chip::BitFlags current, chip::BitFlags expected) + { + if (current == expected) + { + Exit(std::string(itemName) + " got unexpected value: " + std::to_string(current.Raw())); + return false; + } + + return true; + } + template bool CheckConstraintNotValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) { diff --git a/src/app/tests/suites/include/ValueChecker.h b/src/app/tests/suites/include/ValueChecker.h index 8c6ea93e64a157..540546667a70d2 100644 --- a/src/app/tests/suites/include/ValueChecker.h +++ b/src/app/tests/suites/include/ValueChecker.h @@ -83,6 +83,12 @@ class ValueChecker return CheckValue(itemName, current.Raw(), expected); } + template + bool CheckValue(const char * itemName, chip::BitFlags current, chip::BitFlags expected) + { + return CheckValue(itemName, current.Raw(), expected.Raw()); + } + template bool CheckValuePresent(const char * itemName, const chip::Optional & value) { diff --git a/src/app/util/attribute-storage-null-handling.h b/src/app/util/attribute-storage-null-handling.h index 720bfa29f91514..361ecf1713e7c9 100644 --- a/src/app/util/attribute-storage-null-handling.h +++ b/src/app/util/attribute-storage-null-handling.h @@ -21,6 +21,7 @@ #include #include +#include namespace chip { namespace app { @@ -125,6 +126,56 @@ struct NumericAttributeTraits static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return reinterpret_cast(&value); } }; +template +struct NumericAttributeTraits> +{ + using StorageType = T; + using WorkingType = BitFlags; + + static constexpr void WorkingToStorage(WorkingType workingValue, StorageType & storageValue) + { + storageValue = static_cast(workingValue.Raw()); + } + + static constexpr WorkingType StorageToWorking(StorageType storageValue) { return WorkingType(storageValue); } + + static constexpr void SetNull(StorageType & value) + { + // + // When setting to null, store a value that has all bits set. This aliases to the same behavior + // we do for other integral types, ensuring consistency across all underlying integral types in the data store as well as + // re-using logic for serialization/de-serialization of that data in the IM. + // + value = static_cast(std::numeric_limits>::max()); + } + + static constexpr bool IsNullValue(StorageType value) + { + // + // While we store a nullable bitmap value by setting all its bits, we can be a bit more conservative when actually + // testing for null since the spec only mandates that the MSB be reserved for nullable bitmaps. + // + auto msbSetValue = std::underlying_type_t(1) << (std::numeric_limits>::digits - 1); + return !!(std::underlying_type_t(value) & msbSetValue); + } + + static constexpr bool CanRepresentValue(bool isNullable, StorageType value) + { + // + // We permit the full-range of the underlying StorageType if !isNullable, + // and the restricted range otherwise. + // + return !isNullable || !IsNullValue(value); + } + + static CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag, StorageType value) + { + return writer.Put(tag, static_cast(value)); + } + + static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return reinterpret_cast(&value); } +}; + template <> struct NumericAttributeTraits { diff --git a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml index 0debda612cfdbc..c14f1cb877411a 100644 --- a/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/test-cluster.xml @@ -105,6 +105,38 @@ limitations under the License. array="true" optional="true"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CHIP Test Cluster @@ -113,10 +145,10 @@ limitations under the License. The Test Cluster is meant to validate the generated code boolean - bitmap8 - bitmap16 - bitmap32 - bitmap64 + bitmap8 + bitmap16 + bitmap32 + bitmap64 int8u int16u int24u @@ -168,10 +200,10 @@ limitations under the License. type="BOOLEAN" writable="true" optional="false">cluster_error_boolean nullable_boolean - nullable_bitmap8 - nullable_bitmap16 - nullable_bitmap32 - nullable_bitmap64 + nullable_bitmap8 + nullable_bitmap16 + nullable_bitmap32 + nullable_bitmap64 nullable_int8u nullable_int16u nullable_int24u diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index d9402ed8ebb13f..bd4334ae89d04e 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3279,6 +3279,34 @@ client cluster TestCluster = 1295 { kValueC = 3; } + bitmap Bitmap16MaskMap : BITMAP16 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x4000; + } + + bitmap Bitmap32MaskMap : BITMAP32 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x40000000; + } + + bitmap Bitmap64MaskMap : BITMAP64 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x4000000000000000; + } + + bitmap Bitmap8MaskMap : BITMAP8 { + kMaskVal1 = 0x1; + kMaskVal2 = 0x2; + kMaskVal3 = 0x4; + kMaskVal4 = 0x40; + } + bitmap SimpleBitmap : BITMAP8 { kValueA = 0x1; kValueB = 0x2; @@ -3357,10 +3385,10 @@ client cluster TestCluster = 1295 { } attribute boolean boolean = 0; - attribute bitmap8 bitmap8 = 1; - attribute bitmap16 bitmap16 = 2; - attribute bitmap32 bitmap32 = 3; - attribute bitmap64 bitmap64 = 4; + attribute Bitmap8MaskMap bitmap8 = 1; + attribute Bitmap16MaskMap bitmap16 = 2; + attribute Bitmap32MaskMap bitmap32 = 3; + attribute Bitmap64MaskMap bitmap64 = 4; attribute int8u int8u = 5; attribute int16u int16u = 6; attribute int24u int24u = 7; @@ -3405,10 +3433,10 @@ client cluster TestCluster = 1295 { attribute boolean clusterErrorBoolean = 50; attribute boolean unsupported = 255; attribute nullable boolean nullableBoolean = 32768; - attribute nullable bitmap8 nullableBitmap8 = 32769; - attribute nullable bitmap16 nullableBitmap16 = 32770; - attribute nullable bitmap32 nullableBitmap32 = 32771; - attribute nullable bitmap64 nullableBitmap64 = 32772; + attribute nullable Bitmap8MaskMap nullableBitmap8 = 32769; + attribute nullable Bitmap16MaskMap nullableBitmap16 = 32770; + attribute nullable Bitmap32MaskMap nullableBitmap32 = 32771; + attribute nullable Bitmap64MaskMap nullableBitmap64 = 32772; attribute nullable int8u nullableInt8u = 32773; attribute nullable int16u nullableInt16u = 32774; attribute nullable int24u nullableInt24u = 32775; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index fd7be76f1564a3..0f1188b2e1d185 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -11527,7 +11527,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + cppValue.Raw(), value); return value; } case Attributes::Bitmap16::Id: { @@ -11542,7 +11542,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + cppValue.Raw(), value); return value; } case Attributes::Bitmap32::Id: { @@ -11557,7 +11557,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string valueClassName = "java/lang/Long"; std::string valueCtorSignature = "(J)V"; chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + cppValue.Raw(), value); return value; } case Attributes::Bitmap64::Id: { @@ -11572,7 +11572,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string valueClassName = "java/lang/Long"; std::string valueCtorSignature = "(J)V"; chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue, value); + cppValue.Raw(), value); return value; } case Attributes::Int8u::Id: { @@ -13048,7 +13048,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue.Value(), value); + cppValue.Value().Raw(), value); } return value; } @@ -13070,7 +13070,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue.Value(), value); + cppValue.Value().Raw(), value); } return value; } @@ -13092,7 +13092,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string valueClassName = "java/lang/Long"; std::string valueCtorSignature = "(J)V"; chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue.Value(), value); + cppValue.Value().Raw(), value); } return value; } @@ -13114,7 +13114,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR std::string valueClassName = "java/lang/Long"; std::string valueCtorSignature = "(J)V"; chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - cppValue.Value(), value); + cppValue.Value().Raw(), value); } return value; } diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index e73b9aeca48d6a..97656a3dd69e48 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -18410,8 +18410,8 @@ CHIPTestClusterNullableBitmap8AttributeCallback::~CHIPTestClusterNullableBitmap8 env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTestClusterNullableBitmap8AttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPTestClusterNullableBitmap8AttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable> & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -18441,7 +18441,7 @@ void CHIPTestClusterNullableBitmap8AttributeCallback::CallbackFn(void * context, std::string javaValueClassName = "java/lang/Integer"; std::string javaValueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - value.Value(), javaValue); + value.Value().Raw(), javaValue); } env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); @@ -18477,8 +18477,8 @@ CHIPTestClusterNullableBitmap16AttributeCallback::~CHIPTestClusterNullableBitmap env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTestClusterNullableBitmap16AttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPTestClusterNullableBitmap16AttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable> & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -18508,7 +18508,7 @@ void CHIPTestClusterNullableBitmap16AttributeCallback::CallbackFn(void * context std::string javaValueClassName = "java/lang/Integer"; std::string javaValueCtorSignature = "(I)V"; chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - value.Value(), javaValue); + value.Value().Raw(), javaValue); } env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); @@ -18544,8 +18544,8 @@ CHIPTestClusterNullableBitmap32AttributeCallback::~CHIPTestClusterNullableBitmap env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTestClusterNullableBitmap32AttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPTestClusterNullableBitmap32AttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable> & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -18575,7 +18575,7 @@ void CHIPTestClusterNullableBitmap32AttributeCallback::CallbackFn(void * context std::string javaValueClassName = "java/lang/Long"; std::string javaValueCtorSignature = "(J)V"; chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - value.Value(), javaValue); + value.Value().Raw(), javaValue); } env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); @@ -18611,8 +18611,8 @@ CHIPTestClusterNullableBitmap64AttributeCallback::~CHIPTestClusterNullableBitmap env->DeleteGlobalRef(javaCallbackRef); } -void CHIPTestClusterNullableBitmap64AttributeCallback::CallbackFn(void * context, - const chip::app::DataModel::Nullable & value) +void CHIPTestClusterNullableBitmap64AttributeCallback::CallbackFn( + void * context, const chip::app::DataModel::Nullable> & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -18642,7 +18642,7 @@ void CHIPTestClusterNullableBitmap64AttributeCallback::CallbackFn(void * context std::string javaValueClassName = "java/lang/Long"; std::string javaValueCtorSignature = "(J)V"; chip::JniReferences::GetInstance().CreateBoxedObject(javaValueClassName.c_str(), javaValueCtorSignature.c_str(), - value.Value(), javaValue); + value.Value().Raw(), javaValue); } env->CallVoidMethod(javaCallbackRef, javaMethod, javaValue); diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 1bd5ff901f82a9..9518830a1eacdc 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -7368,7 +7368,9 @@ class CHIPTestClusterNullableBitmap8AttributeCallback } } - static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void + CallbackFn(void * context, + const chip::app::DataModel::Nullable> & value); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -7398,7 +7400,9 @@ class CHIPTestClusterNullableBitmap16AttributeCallback } } - static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void + CallbackFn(void * context, + const chip::app::DataModel::Nullable> & value); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -7428,7 +7432,9 @@ class CHIPTestClusterNullableBitmap32AttributeCallback } } - static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void + CallbackFn(void * context, + const chip::app::DataModel::Nullable> & value); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -7458,7 +7464,9 @@ class CHIPTestClusterNullableBitmap64AttributeCallback } } - static void CallbackFn(void * context, const chip::app::DataModel::Nullable & value); + static void + CallbackFn(void * context, + const chip::app::DataModel::Nullable> & value); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( diff --git a/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge-src.zapt b/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge-src.zapt index c83769158ca2b1..9cad8988ca0745 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge-src.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge-src.zapt @@ -46,6 +46,9 @@ {{#if_is_struct type}} {{#>CHIPCallbackBridge ns=parent.name }}{{asUpperCamelCase ../../name}}{{asUpperCamelCase ../name}}StructAttributeCallback{{/CHIPCallbackBridge}} {{/if_is_struct}} + {{#if_is_bitmap type}} + {{#>CHIPCallbackBridge ns=parent.name }}{{asUpperCamelCase ../../name}}{{asUpperCamelCase ../name}}AttributeCallback{{/CHIPCallbackBridge}} + {{/if_is_bitmap}} {{/if}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge_internal.zapt b/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge_internal.zapt index 06d6e8c7ed65f8..67f1b986f552a9 100644 --- a/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge_internal.zapt +++ b/src/darwin/Framework/CHIP/templates/CHIPCallbackBridge_internal.zapt @@ -33,6 +33,9 @@ typedef void (*Nullable{{asUpperCamelCase parent.name}}Cluster{{asUpperCamelCase {{#if_is_struct type}} typedef void (*{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}StructAttributeCallback)(void *, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true forceNotOptional=true}}); {{/if_is_struct}} +{{#if_is_bitmap type}} +typedef void (*{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}AttributeCallback)(void *, {{zapTypeToDecodableClusterObjectType type ns=parent.name isArgument=true forceNotOptional=true}}); +{{/if_is_bitmap}} {{/unless}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} @@ -76,6 +79,9 @@ typedef void (*{{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}StructAt {{#if_is_struct type}} {{#>CHIPCallbackBridge header="1" ns=parent.name }}{{asUpperCamelCase ../../name}}{{asUpperCamelCase ../name}}StructAttributeCallback{{/CHIPCallbackBridge}} {{/if_is_struct}} + {{#if_is_bitmap type}} + {{#>CHIPCallbackBridge header="1" ns=parent.name }}{{asUpperCamelCase ../../name}}{{asUpperCamelCase ../name}}AttributeCallback{{/CHIPCallbackBridge}} + {{/if_is_bitmap}} {{/if}} {{/chip_server_cluster_attributes}} {{/chip_client_clusters}} diff --git a/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt b/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt index 48845cc5f6a89d..f852aac380a31f 100644 --- a/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt +++ b/src/darwin/Framework/CHIP/templates/partials/attribute_data_callback_name.zapt @@ -6,6 +6,8 @@ less code to generate the callbacks on a per-attribute basis than a per-struct-type basis. ~}} {{asUpperCamelCase parent.name}}{{asUpperCamelCase name}}Struct + {{~else if_is_bitmap type~}} + {{asUpperCamelCase parent.name}}{{asUpperCamelCase name}} {{~else~}} {{~#if isNullable}}Nullable{{/if~}} {{~#if (isStrEqual (asUpperCamelCase type) (asUpperCamelCase "vendor_id"))~}} diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm index aac2e2f2efe0ce..5330268f99c07d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPAttributeTLVValueDecoder.mm @@ -9598,7 +9598,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::Bitmap16::Id: { @@ -9609,7 +9609,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedShort:cppValue]; + value = [NSNumber numberWithUnsignedShort:cppValue.Raw()]; return value; } case Attributes::Bitmap32::Id: { @@ -9620,7 +9620,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedInt:cppValue]; + value = [NSNumber numberWithUnsignedInt:cppValue.Raw()]; return value; } case Attributes::Bitmap64::Id: { @@ -9631,7 +9631,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedLongLong:cppValue]; + value = [NSNumber numberWithUnsignedLongLong:cppValue.Raw()]; return value; } case Attributes::Int8u::Id: { @@ -10463,7 +10463,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedChar:cppValue.Value()]; + value = [NSNumber numberWithUnsignedChar:cppValue.Value().Raw()]; } return value; } @@ -10478,7 +10478,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedShort:cppValue.Value()]; + value = [NSNumber numberWithUnsignedShort:cppValue.Value().Raw()]; } return value; } @@ -10493,7 +10493,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedInt:cppValue.Value()]; + value = [NSNumber numberWithUnsignedInt:cppValue.Value().Raw()]; } return value; } @@ -10508,7 +10508,7 @@ id CHIPDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::TLVReader if (cppValue.IsNull()) { value = nil; } else { - value = [NSNumber numberWithUnsignedLongLong:cppValue.Value()]; + value = [NSNumber numberWithUnsignedLongLong:cppValue.Value().Raw()]; } return value; } diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 8379e4ad22e85a..c16fbfaf47b22c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -8512,6 +8512,102 @@ } } +void CHIPTestClusterBitmap8AttributeCallbackBridge::OnSuccessFn( + void * context, chip::BitFlags value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedChar:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterBitmap8AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPTestClusterBitmap16AttributeCallbackBridge::OnSuccessFn( + void * context, chip::BitFlags value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterBitmap16AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPTestClusterBitmap32AttributeCallbackBridge::OnSuccessFn( + void * context, chip::BitFlags value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedInt:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterBitmap32AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPTestClusterBitmap64AttributeCallbackBridge::OnSuccessFn( + void * context, chip::BitFlags value) +{ + NSNumber * _Nonnull objCValue; + objCValue = [NSNumber numberWithUnsignedLongLong:value.Raw()]; + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterBitmap64AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPTestClusterListInt8uListAttributeCallbackBridge::OnSuccessFn( void * context, const chip::app::DataModel::DecodableList & value) { @@ -9012,6 +9108,118 @@ } } +void CHIPTestClusterNullableBitmap8AttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable> & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedChar:value.Value().Raw()]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterNullableBitmap8AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPTestClusterNullableBitmap16AttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable> & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedShort:value.Value().Raw()]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterNullableBitmap16AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPTestClusterNullableBitmap32AttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable> & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedInt:value.Value().Raw()]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterNullableBitmap32AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + +void CHIPTestClusterNullableBitmap64AttributeCallbackBridge::OnSuccessFn( + void * context, const chip::app::DataModel::Nullable> & value) +{ + NSNumber * _Nullable objCValue; + if (value.IsNull()) { + objCValue = nil; + } else { + objCValue = [NSNumber numberWithUnsignedLongLong:value.Value().Raw()]; + } + DispatchSuccess(context, objCValue); +}; + +void CHIPTestClusterNullableBitmap64AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished(void * context) +{ + auto * self = static_cast(context); + if (!self->mQueue) { + return; + } + + if (self->mEstablishedHandler != nil) { + dispatch_async(self->mQueue, self->mEstablishedHandler); + // On failure, mEstablishedHandler will be cleaned up by our destructor, + // but we can clean it up earlier on successful subscription + // establishment. + self->mEstablishedHandler = nil; + } +} + void CHIPTestClusterNullableStructStructAttributeCallbackBridge::OnSuccessFn(void * context, const chip::app::DataModel::Nullable & value) { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index 7ce6ad44dae0a9..0a9748496d1942 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -568,8 +568,20 @@ typedef void (*GeneralCommissioningBasicCommissioningInfoStructAttributeCallback void *, const chip::app::Clusters::GeneralCommissioning::Structs::BasicCommissioningInfo::DecodableType &); typedef void (*MediaPlaybackSampledPositionStructAttributeCallback)( void *, const chip::app::DataModel::Nullable &); +typedef void (*TestClusterBitmap8AttributeCallback)(void *, chip::BitFlags); +typedef void (*TestClusterBitmap16AttributeCallback)(void *, chip::BitFlags); +typedef void (*TestClusterBitmap32AttributeCallback)(void *, chip::BitFlags); +typedef void (*TestClusterBitmap64AttributeCallback)(void *, chip::BitFlags); typedef void (*TestClusterStructAttrStructAttributeCallback)( void *, const chip::app::Clusters::TestCluster::Structs::SimpleStruct::DecodableType &); +typedef void (*TestClusterNullableBitmap8AttributeCallback)( + void *, const chip::app::DataModel::Nullable> &); +typedef void (*TestClusterNullableBitmap16AttributeCallback)( + void *, const chip::app::DataModel::Nullable> &); +typedef void (*TestClusterNullableBitmap32AttributeCallback)( + void *, const chip::app::DataModel::Nullable> &); +typedef void (*TestClusterNullableBitmap64AttributeCallback)( + void *, const chip::app::DataModel::Nullable> &); typedef void (*TestClusterNullableStructStructAttributeCallback)( void *, const chip::app::DataModel::Nullable &); @@ -6806,6 +6818,110 @@ class CHIPTemperatureMeasurementAttributeListListAttributeCallbackSubscriptionBr SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPTestClusterBitmap8AttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPTestClusterBitmap8AttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, chip::BitFlags value); +}; + +class CHIPTestClusterBitmap8AttributeCallbackSubscriptionBridge : public CHIPTestClusterBitmap8AttributeCallbackBridge +{ +public: + CHIPTestClusterBitmap8AttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterBitmap8AttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPTestClusterBitmap16AttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPTestClusterBitmap16AttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, chip::BitFlags value); +}; + +class CHIPTestClusterBitmap16AttributeCallbackSubscriptionBridge : public CHIPTestClusterBitmap16AttributeCallbackBridge +{ +public: + CHIPTestClusterBitmap16AttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterBitmap16AttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPTestClusterBitmap32AttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPTestClusterBitmap32AttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, chip::BitFlags value); +}; + +class CHIPTestClusterBitmap32AttributeCallbackSubscriptionBridge : public CHIPTestClusterBitmap32AttributeCallbackBridge +{ +public: + CHIPTestClusterBitmap32AttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterBitmap32AttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPTestClusterBitmap64AttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPTestClusterBitmap64AttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void OnSuccessFn(void * context, chip::BitFlags value); +}; + +class CHIPTestClusterBitmap64AttributeCallbackSubscriptionBridge : public CHIPTestClusterBitmap64AttributeCallbackBridge +{ +public: + CHIPTestClusterBitmap64AttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterBitmap64AttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPTestClusterListInt8uListAttributeCallbackBridge : public CHIPCallbackBridge { public: @@ -7009,6 +7125,125 @@ class CHIPTestClusterListFabricScopedListAttributeCallbackSubscriptionBridge SubscriptionEstablishedHandler mEstablishedHandler; }; +class CHIPTestClusterNullableBitmap8AttributeCallbackBridge : public CHIPCallbackBridge +{ +public: + CHIPTestClusterNullableBitmap8AttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable> & value); +}; + +class CHIPTestClusterNullableBitmap8AttributeCallbackSubscriptionBridge + : public CHIPTestClusterNullableBitmap8AttributeCallbackBridge +{ +public: + CHIPTestClusterNullableBitmap8AttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterNullableBitmap8AttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPTestClusterNullableBitmap16AttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPTestClusterNullableBitmap16AttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable> & value); +}; + +class CHIPTestClusterNullableBitmap16AttributeCallbackSubscriptionBridge + : public CHIPTestClusterNullableBitmap16AttributeCallbackBridge +{ +public: + CHIPTestClusterNullableBitmap16AttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterNullableBitmap16AttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPTestClusterNullableBitmap32AttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPTestClusterNullableBitmap32AttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable> & value); +}; + +class CHIPTestClusterNullableBitmap32AttributeCallbackSubscriptionBridge + : public CHIPTestClusterNullableBitmap32AttributeCallbackBridge +{ +public: + CHIPTestClusterNullableBitmap32AttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterNullableBitmap32AttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + +class CHIPTestClusterNullableBitmap64AttributeCallbackBridge + : public CHIPCallbackBridge +{ +public: + CHIPTestClusterNullableBitmap64AttributeCallbackBridge(dispatch_queue_t queue, ResponseHandler handler, CHIPActionBlock action, + bool keepAlive = false) : + CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; + + static void + OnSuccessFn(void * context, + const chip::app::DataModel::Nullable> & value); +}; + +class CHIPTestClusterNullableBitmap64AttributeCallbackSubscriptionBridge + : public CHIPTestClusterNullableBitmap64AttributeCallbackBridge +{ +public: + CHIPTestClusterNullableBitmap64AttributeCallbackSubscriptionBridge(dispatch_queue_t queue, ResponseHandler handler, + CHIPActionBlock action, + SubscriptionEstablishedHandler establishedHandler) : + CHIPTestClusterNullableBitmap64AttributeCallbackBridge(queue, handler, action, true), + mEstablishedHandler(establishedHandler) + {} + + static void OnSubscriptionEstablished(void * context); + +private: + SubscriptionEstablishedHandler mEstablishedHandler; +}; + class CHIPTestClusterNullableStructStructAttributeCallbackBridge : public CHIPCallbackBridge { diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h index fa1e74f3c6eb1b..b5c5cc998753ee 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.h @@ -13208,6 +13208,34 @@ typedef NS_ENUM(NSInteger, CHIPTestClusterSimple) { CHIPTestClusterSimpleValueC = 0x03, }; +typedef NS_OPTIONS(NSUInteger, CHIPTestClusterBitmap16MaskMap) { + CHIPTestClusterBitmap16MaskMapMaskVal1 = 0x1, + CHIPTestClusterBitmap16MaskMapMaskVal2 = 0x2, + CHIPTestClusterBitmap16MaskMapMaskVal3 = 0x4, + CHIPTestClusterBitmap16MaskMapMaskVal4 = 0x4000, +}; + +typedef NS_OPTIONS(NSUInteger, CHIPTestClusterBitmap32MaskMap) { + CHIPTestClusterBitmap32MaskMapMaskVal1 = 0x1, + CHIPTestClusterBitmap32MaskMapMaskVal2 = 0x2, + CHIPTestClusterBitmap32MaskMapMaskVal3 = 0x4, + CHIPTestClusterBitmap32MaskMapMaskVal4 = 0x40000000, +}; + +typedef NS_OPTIONS(NSUInteger, CHIPTestClusterBitmap64MaskMap) { + CHIPTestClusterBitmap64MaskMapMaskVal1 = 0x1, + CHIPTestClusterBitmap64MaskMapMaskVal2 = 0x2, + CHIPTestClusterBitmap64MaskMapMaskVal3 = 0x4, + CHIPTestClusterBitmap64MaskMapMaskVal4 = 0x4000000000000000, +}; + +typedef NS_OPTIONS(NSUInteger, CHIPTestClusterBitmap8MaskMap) { + CHIPTestClusterBitmap8MaskMapMaskVal1 = 0x1, + CHIPTestClusterBitmap8MaskMapMaskVal2 = 0x2, + CHIPTestClusterBitmap8MaskMapMaskVal3 = 0x4, + CHIPTestClusterBitmap8MaskMapMaskVal4 = 0x40, +}; + typedef NS_OPTIONS(NSUInteger, CHIPTestClusterSimpleBitmap) { CHIPTestClusterSimpleBitmapValueA = 0x1, CHIPTestClusterSimpleBitmapValueB = 0x2, diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm index 24c0eb8f998b97..c5af0a24a645a3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPClustersObjc.mm @@ -36501,12 +36501,13 @@ new CHIPBooleanAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * - (void)readAttributeBitmap8WithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = TestCluster::Attributes::Bitmap8::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPTestClusterBitmap8AttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TestCluster::Attributes::Bitmap8::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)writeAttributeBitmap8WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler @@ -36520,7 +36521,7 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = TestCluster::Attributes::Bitmap8::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = static_cast>(value.unsignedCharValue); auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -36533,15 +36534,15 @@ - (void)subscribeAttributeBitmap8WithMinInterval:(NSNumber * _Nonnull)minInterva subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt8uAttributeCallbackSubscriptionBridge( + new CHIPTestClusterBitmap8AttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::Bitmap8::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPTestClusterBitmap8AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -36553,7 +36554,7 @@ + (void)readAttributeBitmap8WithAttributeCache:(CHIPAttributeCacheContainer *)at queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPTestClusterBitmap8AttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = TestCluster::Attributes::Bitmap8::TypeInfo; @@ -36562,7 +36563,7 @@ new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -36575,12 +36576,13 @@ new CHIPInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * su - (void)readAttributeBitmap16WithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = TestCluster::Attributes::Bitmap16::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPTestClusterBitmap16AttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TestCluster::Attributes::Bitmap16::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)writeAttributeBitmap16WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler @@ -36594,7 +36596,7 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = TestCluster::Attributes::Bitmap16::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedShortValue; + cppValue = static_cast>(value.unsignedShortValue); auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -36607,15 +36609,15 @@ - (void)subscribeAttributeBitmap16WithMinInterval:(NSNumber * _Nonnull)minInterv subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt16uAttributeCallbackSubscriptionBridge( + new CHIPTestClusterBitmap16AttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::Bitmap16::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPTestClusterBitmap16AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -36627,7 +36629,7 @@ + (void)readAttributeBitmap16WithAttributeCache:(CHIPAttributeCacheContainer *)a queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPTestClusterBitmap16AttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = TestCluster::Attributes::Bitmap16::TypeInfo; @@ -36636,7 +36638,7 @@ new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -36649,12 +36651,13 @@ new CHIPInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s - (void)readAttributeBitmap32WithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt32uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = TestCluster::Attributes::Bitmap32::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPTestClusterBitmap32AttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TestCluster::Attributes::Bitmap32::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)writeAttributeBitmap32WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler @@ -36668,7 +36671,7 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = TestCluster::Attributes::Bitmap32::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedIntValue; + cppValue = static_cast>(value.unsignedIntValue); auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -36681,15 +36684,15 @@ - (void)subscribeAttributeBitmap32WithMinInterval:(NSNumber * _Nonnull)minInterv subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt32uAttributeCallbackSubscriptionBridge( + new CHIPTestClusterBitmap32AttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::Bitmap32::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPTestClusterBitmap32AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -36701,7 +36704,7 @@ + (void)readAttributeBitmap32WithAttributeCache:(CHIPAttributeCacheContainer *)a queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPTestClusterBitmap32AttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = TestCluster::Attributes::Bitmap32::TypeInfo; @@ -36710,7 +36713,7 @@ new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -36723,12 +36726,13 @@ new CHIPInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s - (void)readAttributeBitmap64WithCompletionHandler:(void (^)( NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt64uAttributeCallbackBridge(self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - using TypeInfo = TestCluster::Attributes::Bitmap64::TypeInfo; - auto successFn = Callback::FromCancelable(success); - auto failureFn = Callback::FromCancelable(failure); - return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); - }); + new CHIPTestClusterBitmap64AttributeCallbackBridge( + self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + using TypeInfo = TestCluster::Attributes::Bitmap64::TypeInfo; + auto successFn = Callback::FromCancelable(success); + auto failureFn = Callback::FromCancelable(failure); + return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); + }); } - (void)writeAttributeBitmap64WithValue:(NSNumber * _Nonnull)value completionHandler:(StatusCompletion)completionHandler @@ -36742,7 +36746,7 @@ new CHIPDefaultSuccessCallbackBridge( ListFreer listFreer; using TypeInfo = TestCluster::Attributes::Bitmap64::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedLongLongValue; + cppValue = static_cast>(value.unsignedLongLongValue); auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.WriteAttribute(cppValue, successFn->mContext, successFn->mCall, failureFn->mCall); @@ -36755,15 +36759,15 @@ - (void)subscribeAttributeBitmap64WithMinInterval:(NSNumber * _Nonnull)minInterv subscriptionEstablished:(SubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPInt64uAttributeCallbackSubscriptionBridge( + new CHIPTestClusterBitmap64AttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::Bitmap64::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPInt64uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPTestClusterBitmap64AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -36775,7 +36779,7 @@ + (void)readAttributeBitmap64WithAttributeCache:(CHIPAttributeCacheContainer *)a queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPInt64uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + new CHIPTestClusterBitmap64AttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { if (attributeCacheContainer.cppAttributeCache) { chip::app::ConcreteAttributePath path; using TypeInfo = TestCluster::Attributes::Bitmap64::TypeInfo; @@ -36784,7 +36788,7 @@ new CHIPInt64uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * s path.mAttributeId = TypeInfo::GetAttributeId(); TypeInfo::DecodableType value; CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); if (err == CHIP_NO_ERROR) { successFn->mCall(successFn->mContext, value); } @@ -40469,10 +40473,10 @@ new CHIPNullableBooleanAttributeCallbackBridge(queue, completionHandler, ^(Cance - (void)readAttributeNullableBitmap8WithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPNullableInt8uAttributeCallbackBridge( + new CHIPTestClusterNullableBitmap8AttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::NullableBitmap8::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); @@ -40493,7 +40497,7 @@ new CHIPDefaultSuccessCallbackBridge( cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedCharValue; + nonNullValue_0 = static_cast>(value.unsignedCharValue); } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); @@ -40508,15 +40512,15 @@ - (void)subscribeAttributeNullableBitmap8WithMinInterval:(NSNumber * _Nonnull)mi reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPNullableInt8uAttributeCallbackSubscriptionBridge( + new CHIPTestClusterNullableBitmap8AttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::NullableBitmap8::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPNullableInt8uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPTestClusterNullableBitmap8AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -40529,32 +40533,33 @@ + (void)readAttributeNullableBitmap8WithAttributeCache:(CHIPAttributeCacheContai completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPNullableInt8uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TestCluster::Attributes::NullableBitmap8::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); + new CHIPTestClusterNullableBitmap8AttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TestCluster::Attributes::NullableBitmap8::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableBitmap16WithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPNullableInt16uAttributeCallbackBridge( + new CHIPTestClusterNullableBitmap16AttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::NullableBitmap16::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); @@ -40575,7 +40580,7 @@ new CHIPDefaultSuccessCallbackBridge( cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedShortValue; + nonNullValue_0 = static_cast>(value.unsignedShortValue); } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); @@ -40590,15 +40595,15 @@ - (void)subscribeAttributeNullableBitmap16WithMinInterval:(NSNumber * _Nonnull)m reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPNullableInt16uAttributeCallbackSubscriptionBridge( + new CHIPTestClusterNullableBitmap16AttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::NullableBitmap16::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPNullableInt16uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPTestClusterNullableBitmap16AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -40611,32 +40616,33 @@ + (void)readAttributeNullableBitmap16WithAttributeCache:(CHIPAttributeCacheConta completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPNullableInt16uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TestCluster::Attributes::NullableBitmap16::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); + new CHIPTestClusterNullableBitmap16AttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TestCluster::Attributes::NullableBitmap16::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableBitmap32WithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPNullableInt32uAttributeCallbackBridge( + new CHIPTestClusterNullableBitmap32AttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::NullableBitmap32::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); @@ -40657,7 +40663,7 @@ new CHIPDefaultSuccessCallbackBridge( cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedIntValue; + nonNullValue_0 = static_cast>(value.unsignedIntValue); } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); @@ -40672,15 +40678,15 @@ - (void)subscribeAttributeNullableBitmap32WithMinInterval:(NSNumber * _Nonnull)m reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPNullableInt32uAttributeCallbackSubscriptionBridge( + new CHIPTestClusterNullableBitmap32AttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::NullableBitmap32::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPNullableInt32uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPTestClusterNullableBitmap32AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -40693,32 +40699,33 @@ + (void)readAttributeNullableBitmap32WithAttributeCache:(CHIPAttributeCacheConta completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPNullableInt32uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TestCluster::Attributes::NullableBitmap32::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); + new CHIPTestClusterNullableBitmap32AttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TestCluster::Attributes::NullableBitmap32::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableBitmap64WithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPNullableInt64uAttributeCallbackBridge( + new CHIPTestClusterNullableBitmap64AttributeCallbackBridge( self.callbackQueue, completionHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::NullableBitmap64::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.ReadAttribute(successFn->mContext, successFn->mCall, failureFn->mCall); }); @@ -40739,7 +40746,7 @@ new CHIPDefaultSuccessCallbackBridge( cppValue.SetNull(); } else { auto & nonNullValue_0 = cppValue.SetNonNull(); - nonNullValue_0 = value.unsignedLongLongValue; + nonNullValue_0 = static_cast>(value.unsignedLongLongValue); } auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); @@ -40754,15 +40761,15 @@ - (void)subscribeAttributeNullableBitmap64WithMinInterval:(NSNumber * _Nonnull)m reportHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - new CHIPNullableInt64uAttributeCallbackSubscriptionBridge( + new CHIPTestClusterNullableBitmap64AttributeCallbackSubscriptionBridge( self.callbackQueue, reportHandler, ^(Cancelable * success, Cancelable * failure) { using TypeInfo = TestCluster::Attributes::NullableBitmap64::TypeInfo; - auto successFn = Callback::FromCancelable(success); + auto successFn = Callback::FromCancelable(success); auto failureFn = Callback::FromCancelable(failure); return self.cppCluster.SubscribeAttribute(successFn->mContext, successFn->mCall, failureFn->mCall, [minInterval unsignedShortValue], [maxInterval unsignedShortValue], - CHIPNullableInt64uAttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, + CHIPTestClusterNullableBitmap64AttributeCallbackSubscriptionBridge::OnSubscriptionEstablished, params == nil || params.fabricFiltered == nil || [params.fabricFiltered boolValue], params != nil && params.keepPreviousSubscriptions != nil && [params.keepPreviousSubscriptions boolValue]); }, @@ -40775,23 +40782,24 @@ + (void)readAttributeNullableBitmap64WithAttributeCache:(CHIPAttributeCacheConta completionHandler: (void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler { - new CHIPNullableInt64uAttributeCallbackBridge(queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { - if (attributeCacheContainer.cppAttributeCache) { - chip::app::ConcreteAttributePath path; - using TypeInfo = TestCluster::Attributes::NullableBitmap64::TypeInfo; - path.mEndpointId = static_cast([endpoint unsignedShortValue]); - path.mClusterId = TypeInfo::GetClusterId(); - path.mAttributeId = TypeInfo::GetAttributeId(); - TypeInfo::DecodableType value; - CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); - auto successFn = Callback::FromCancelable(success); - if (err == CHIP_NO_ERROR) { - successFn->mCall(successFn->mContext, value); + new CHIPTestClusterNullableBitmap64AttributeCallbackBridge( + queue, completionHandler, ^(Cancelable * success, Cancelable * failure) { + if (attributeCacheContainer.cppAttributeCache) { + chip::app::ConcreteAttributePath path; + using TypeInfo = TestCluster::Attributes::NullableBitmap64::TypeInfo; + path.mEndpointId = static_cast([endpoint unsignedShortValue]); + path.mClusterId = TypeInfo::GetClusterId(); + path.mAttributeId = TypeInfo::GetAttributeId(); + TypeInfo::DecodableType value; + CHIP_ERROR err = attributeCacheContainer.cppAttributeCache->Get(path, value); + auto successFn = Callback::FromCancelable(success); + if (err == CHIP_NO_ERROR) { + successFn->mCall(successFn->mContext, value); + } + return err; } - return err; - } - return CHIP_ERROR_NOT_FOUND; - }); + return CHIP_ERROR_NOT_FOUND; + }); } - (void)readAttributeNullableInt8uWithCompletionHandler:(void (^)( diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 4a87e6a0e990e7..014cec69b4c5b3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -31626,9 +31626,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) namespace Bitmap8 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); @@ -31640,9 +31640,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -31657,9 +31657,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace Bitmap16 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); @@ -31671,9 +31671,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -31688,9 +31688,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace Bitmap32 { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); @@ -31702,9 +31702,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -31719,9 +31719,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) namespace Bitmap64 { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); @@ -31733,9 +31733,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value) *value = Traits::StorageToWorking(temp); return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -32915,9 +32915,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace NullableBitmap8 { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable> & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); @@ -32932,9 +32933,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & valu } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -32947,14 +32948,15 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) EmberAfStatus SetNull(chip::EndpointId endpoint) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable> & value) { if (value.IsNull()) { @@ -32968,9 +32970,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace NullableBitmap16 { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable> & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); @@ -32985,9 +32988,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -33000,14 +33003,15 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) EmberAfStatus SetNull(chip::EndpointId endpoint) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable> & value) { if (value.IsNull()) { @@ -33021,9 +33025,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace NullableBitmap32 { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable> & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); @@ -33038,9 +33043,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -33053,14 +33058,15 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value) EmberAfStatus SetNull(chip::EndpointId endpoint) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable> & value) { if (value.IsNull()) { @@ -33074,9 +33080,10 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace NullableBitmap64 { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value) +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable> & value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::TestCluster::Id, Id, readable, sizeof(temp)); @@ -33091,9 +33098,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & val } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -33106,14 +33113,15 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value) EmberAfStatus SetNull(chip::EndpointId endpoint) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); return emberAfWriteServerAttribute(endpoint, Clusters::TestCluster::Id, Id, writable, ZCL_BITMAP64_ATTRIBUTE_TYPE); } -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value) +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable> & value) { if (value.IsNull()) { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 32db1883d7e531..7928ae7778d7b5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -5554,23 +5554,27 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); } // namespace Boolean namespace Bitmap8 { -EmberAfStatus Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitFlags * value); // Bitmap8MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); } // namespace Bitmap8 namespace Bitmap16 { -EmberAfStatus Get(chip::EndpointId endpoint, uint16_t * value); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitFlags * value); // Bitmap16MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); } // namespace Bitmap16 namespace Bitmap32 { -EmberAfStatus Get(chip::EndpointId endpoint, uint32_t * value); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitFlags * value); // Bitmap32MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); } // namespace Bitmap32 namespace Bitmap64 { -EmberAfStatus Get(chip::EndpointId endpoint, uint64_t * value); // bitmap64 -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + chip::BitFlags * value); // Bitmap64MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); } // namespace Bitmap64 namespace Int8u { @@ -5761,31 +5765,42 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl } // namespace NullableBoolean namespace NullableBitmap8 { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap8 -EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable> & value); // Bitmap8MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable> & value); } // namespace NullableBitmap8 namespace NullableBitmap16 { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap16 -EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); +EmberAfStatus +Get(chip::EndpointId endpoint, + DataModel::Nullable> & value); // Bitmap16MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable> & value); } // namespace NullableBitmap16 namespace NullableBitmap32 { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap32 -EmberAfStatus Set(chip::EndpointId endpoint, uint32_t value); +EmberAfStatus +Get(chip::EndpointId endpoint, + DataModel::Nullable> & value); // Bitmap32MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable> & value); } // namespace NullableBitmap32 namespace NullableBitmap64 { -EmberAfStatus Get(chip::EndpointId endpoint, DataModel::Nullable & value); // bitmap64 -EmberAfStatus Set(chip::EndpointId endpoint, uint64_t value); +EmberAfStatus +Get(chip::EndpointId endpoint, + DataModel::Nullable> & value); // Bitmap64MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); EmberAfStatus SetNull(chip::EndpointId endpoint); -EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullable & value); +EmberAfStatus Set(chip::EndpointId endpoint, + const chip::app::DataModel::Nullable> & value); } // namespace NullableBitmap64 namespace NullableInt8u { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 56067b0fbe4dfc..2471223302da32 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -2296,6 +2296,42 @@ enum class SimpleEnum : uint8_t kValueC = 0x03, }; +// Bitmap for Bitmap16MaskMap +enum class Bitmap16MaskMap : uint16_t +{ + kMaskVal1 = 0x1, + kMaskVal2 = 0x2, + kMaskVal3 = 0x4, + kMaskVal4 = 0x4000, +}; + +// Bitmap for Bitmap32MaskMap +enum class Bitmap32MaskMap : uint32_t +{ + kMaskVal1 = 0x1, + kMaskVal2 = 0x2, + kMaskVal3 = 0x4, + kMaskVal4 = 0x40000000, +}; + +// Bitmap for Bitmap64MaskMap +enum class Bitmap64MaskMap : uint64_t +{ + kMaskVal1 = 0x1, + kMaskVal2 = 0x2, + kMaskVal3 = 0x4, + kMaskVal4 = 0x4000000000000000, +}; + +// Bitmap for Bitmap8MaskMap +enum class Bitmap8MaskMap : uint8_t +{ + kMaskVal1 = 0x1, + kMaskVal2 = 0x2, + kMaskVal3 = 0x4, + kMaskVal4 = 0x40, +}; + // Bitmap for SimpleBitmap enum class SimpleBitmap : uint8_t { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 538f052bbddb03..469f09794dbff3 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -36722,9 +36722,9 @@ struct TypeInfo namespace Bitmap8 { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitFlags; + using DecodableType = chip::BitFlags; + using DecodableArgType = chip::BitFlags; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Bitmap8::Id; } @@ -36734,9 +36734,9 @@ struct TypeInfo namespace Bitmap16 { struct TypeInfo { - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; + using Type = chip::BitFlags; + using DecodableType = chip::BitFlags; + using DecodableArgType = chip::BitFlags; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Bitmap16::Id; } @@ -36746,9 +36746,9 @@ struct TypeInfo namespace Bitmap32 { struct TypeInfo { - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; + using Type = chip::BitFlags; + using DecodableType = chip::BitFlags; + using DecodableArgType = chip::BitFlags; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Bitmap32::Id; } @@ -36758,9 +36758,9 @@ struct TypeInfo namespace Bitmap64 { struct TypeInfo { - using Type = uint64_t; - using DecodableType = uint64_t; - using DecodableArgType = uint64_t; + using Type = chip::BitFlags; + using DecodableType = chip::BitFlags; + using DecodableArgType = chip::BitFlags; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Bitmap64::Id; } @@ -37308,9 +37308,10 @@ struct TypeInfo namespace NullableBitmap8 { struct TypeInfo { - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; + using DecodableArgType = + const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap8::Id; } @@ -37320,9 +37321,10 @@ struct TypeInfo namespace NullableBitmap16 { struct TypeInfo { - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; + using DecodableArgType = + const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap16::Id; } @@ -37332,9 +37334,10 @@ struct TypeInfo namespace NullableBitmap32 { struct TypeInfo { - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; + using DecodableArgType = + const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap32::Id; } @@ -37344,9 +37347,10 @@ struct TypeInfo namespace NullableBitmap64 { struct TypeInfo { - using Type = chip::app::DataModel::Nullable; - using DecodableType = chip::app::DataModel::Nullable; - using DecodableArgType = const chip::app::DataModel::Nullable &; + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; + using DecodableArgType = + const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap64::Id; } @@ -37761,11 +37765,15 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - Attributes::Boolean::TypeInfo::DecodableType boolean = static_cast(0); - Attributes::Bitmap8::TypeInfo::DecodableType bitmap8 = static_cast(0); - Attributes::Bitmap16::TypeInfo::DecodableType bitmap16 = static_cast(0); - Attributes::Bitmap32::TypeInfo::DecodableType bitmap32 = static_cast(0); - Attributes::Bitmap64::TypeInfo::DecodableType bitmap64 = static_cast(0); + Attributes::Boolean::TypeInfo::DecodableType boolean = static_cast(0); + Attributes::Bitmap8::TypeInfo::DecodableType bitmap8 = + static_cast>(0); + Attributes::Bitmap16::TypeInfo::DecodableType bitmap16 = + static_cast>(0); + Attributes::Bitmap32::TypeInfo::DecodableType bitmap32 = + static_cast>(0); + Attributes::Bitmap64::TypeInfo::DecodableType bitmap64 = + static_cast>(0); Attributes::Int8u::TypeInfo::DecodableType int8u = static_cast(0); Attributes::Int16u::TypeInfo::DecodableType int16u = static_cast(0); Attributes::Int24u::TypeInfo::DecodableType int24u = static_cast(0); diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index 27d671b181d6f5..5a0bdf956c7cef 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -467,6 +467,38 @@ enum EmberAfWiFiVersionType : uint8_t #define EMBER_AF_BARRIER_CONTROL_SAFETY_STATUS_POSITION_FAILURE_OFFSET (3) #define EMBER_AF_BATTERY_ALARM_MASK_VOLTAGE_TOO_LOW (1) #define EMBER_AF_BATTERY_ALARM_MASK_VOLTAGE_TOO_LOW_OFFSET (0) +#define EMBER_AF_BITMAP16_MASK_MAP_MASK_VAL1 (1) +#define EMBER_AF_BITMAP16_MASK_MAP_MASK_VAL1_OFFSET (0) +#define EMBER_AF_BITMAP16_MASK_MAP_MASK_VAL2 (2) +#define EMBER_AF_BITMAP16_MASK_MAP_MASK_VAL2_OFFSET (1) +#define EMBER_AF_BITMAP16_MASK_MAP_MASK_VAL3 (4) +#define EMBER_AF_BITMAP16_MASK_MAP_MASK_VAL3_OFFSET (2) +#define EMBER_AF_BITMAP16_MASK_MAP_MASK_VAL4 (16384) +#define EMBER_AF_BITMAP16_MASK_MAP_MASK_VAL4_OFFSET (14) +#define EMBER_AF_BITMAP32_MASK_MAP_MASK_VAL1 (1) +#define EMBER_AF_BITMAP32_MASK_MAP_MASK_VAL1_OFFSET (0) +#define EMBER_AF_BITMAP32_MASK_MAP_MASK_VAL2 (2) +#define EMBER_AF_BITMAP32_MASK_MAP_MASK_VAL2_OFFSET (1) +#define EMBER_AF_BITMAP32_MASK_MAP_MASK_VAL3 (4) +#define EMBER_AF_BITMAP32_MASK_MAP_MASK_VAL3_OFFSET (2) +#define EMBER_AF_BITMAP32_MASK_MAP_MASK_VAL4 (1073741824) +#define EMBER_AF_BITMAP32_MASK_MAP_MASK_VAL4_OFFSET (30) +#define EMBER_AF_BITMAP64_MASK_MAP_MASK_VAL1 (1) +#define EMBER_AF_BITMAP64_MASK_MAP_MASK_VAL1_OFFSET (0) +#define EMBER_AF_BITMAP64_MASK_MAP_MASK_VAL2 (2) +#define EMBER_AF_BITMAP64_MASK_MAP_MASK_VAL2_OFFSET (1) +#define EMBER_AF_BITMAP64_MASK_MAP_MASK_VAL3 (4) +#define EMBER_AF_BITMAP64_MASK_MAP_MASK_VAL3_OFFSET (2) +#define EMBER_AF_BITMAP64_MASK_MAP_MASK_VAL4 (4611686018427388000) +#define EMBER_AF_BITMAP64_MASK_MAP_MASK_VAL4_OFFSET (62) +#define EMBER_AF_BITMAP8_MASK_MAP_MASK_VAL1 (1) +#define EMBER_AF_BITMAP8_MASK_MAP_MASK_VAL1_OFFSET (0) +#define EMBER_AF_BITMAP8_MASK_MAP_MASK_VAL2 (2) +#define EMBER_AF_BITMAP8_MASK_MAP_MASK_VAL2_OFFSET (1) +#define EMBER_AF_BITMAP8_MASK_MAP_MASK_VAL3 (4) +#define EMBER_AF_BITMAP8_MASK_MAP_MASK_VAL3_OFFSET (2) +#define EMBER_AF_BITMAP8_MASK_MAP_MASK_VAL4 (64) +#define EMBER_AF_BITMAP8_MASK_MAP_MASK_VAL4_OFFSET (6) #define EMBER_AF_CHANNEL_FEATURE_CHANNEL_LIST (1) #define EMBER_AF_CHANNEL_FEATURE_CHANNEL_LIST_OFFSET (0) #define EMBER_AF_CHANNEL_FEATURE_LINEUP_INFO (2) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 081cf702a8c999..ad487efd602276 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -16151,7 +16151,7 @@ class WriteTestClusterBitmap8 : public WriteAttribute } private: - uint8_t mValue; + chip::BitFlags mValue; }; class WriteTestClusterBitmap16 : public WriteAttribute @@ -16177,7 +16177,7 @@ class WriteTestClusterBitmap16 : public WriteAttribute } private: - uint16_t mValue; + chip::BitFlags mValue; }; class WriteTestClusterBitmap32 : public WriteAttribute @@ -16203,7 +16203,7 @@ class WriteTestClusterBitmap32 : public WriteAttribute } private: - uint32_t mValue; + chip::BitFlags mValue; }; class WriteTestClusterBitmap64 : public WriteAttribute @@ -16229,7 +16229,7 @@ class WriteTestClusterBitmap64 : public WriteAttribute } private: - uint64_t mValue; + chip::BitFlags mValue; }; class WriteTestClusterInt8u : public WriteAttribute @@ -17428,7 +17428,7 @@ class WriteTestClusterNullableBitmap8 : public WriteAttribute } private: - chip::app::DataModel::Nullable mValue; + chip::app::DataModel::Nullable> mValue; }; class WriteTestClusterNullableBitmap16 : public WriteAttribute @@ -17455,7 +17455,7 @@ class WriteTestClusterNullableBitmap16 : public WriteAttribute } private: - chip::app::DataModel::Nullable mValue; + chip::app::DataModel::Nullable> mValue; }; class WriteTestClusterNullableBitmap32 : public WriteAttribute @@ -17482,7 +17482,7 @@ class WriteTestClusterNullableBitmap32 : public WriteAttribute } private: - chip::app::DataModel::Nullable mValue; + chip::app::DataModel::Nullable> mValue; }; class WriteTestClusterNullableBitmap64 : public WriteAttribute @@ -17509,7 +17509,7 @@ class WriteTestClusterNullableBitmap64 : public WriteAttribute } private: - chip::app::DataModel::Nullable mValue; + chip::app::DataModel::Nullable> mValue; }; class WriteTestClusterNullableInt8u : public WriteAttribute diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index b0f44914d734a8..603932a4b073dc 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -8464,22 +8464,22 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("boolean", 1, value); } case TestCluster::Attributes::Bitmap8::Id: { - uint8_t value; + chip::BitFlags value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("bitmap8", 1, value); } case TestCluster::Attributes::Bitmap16::Id: { - uint16_t value; + chip::BitFlags value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("bitmap16", 1, value); } case TestCluster::Attributes::Bitmap32::Id: { - uint32_t value; + chip::BitFlags value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("bitmap32", 1, value); } case TestCluster::Attributes::Bitmap64::Id: { - uint64_t value; + chip::BitFlags value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("bitmap64", 1, value); } @@ -8707,22 +8707,22 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("nullable_boolean", 1, value); } case TestCluster::Attributes::NullableBitmap8::Id: { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("nullable_bitmap8", 1, value); } case TestCluster::Attributes::NullableBitmap16::Id: { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("nullable_bitmap16", 1, value); } case TestCluster::Attributes::NullableBitmap32::Id: { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("nullable_bitmap32", 1, value); } case TestCluster::Attributes::NullableBitmap64::Id: { - chip::app::DataModel::Nullable value; + chip::app::DataModel::Nullable> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("nullable_bitmap64", 1, value); } diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 021a9f8bb6627e..a2eecf03d9d76c 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -65803,7 +65803,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_11(error); } - static void OnSuccessCallback_11(void * context, uint8_t bitmap8) + static void OnSuccessCallback_11(void * context, chip::BitFlags bitmap8) { (static_cast(context))->OnSuccessResponse_11(bitmap8); } @@ -65820,7 +65820,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_13(error); } - static void OnSuccessCallback_13(void * context, uint8_t bitmap8) + static void OnSuccessCallback_13(void * context, chip::BitFlags bitmap8) { (static_cast(context))->OnSuccessResponse_13(bitmap8); } @@ -65837,7 +65837,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_15(error); } - static void OnSuccessCallback_15(void * context, uint8_t bitmap8) + static void OnSuccessCallback_15(void * context, chip::BitFlags bitmap8) { (static_cast(context))->OnSuccessResponse_15(bitmap8); } @@ -65847,7 +65847,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_16(error); } - static void OnSuccessCallback_16(void * context, uint16_t bitmap16) + static void OnSuccessCallback_16(void * context, chip::BitFlags bitmap16) { (static_cast(context))->OnSuccessResponse_16(bitmap16); } @@ -65864,7 +65864,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_18(error); } - static void OnSuccessCallback_18(void * context, uint16_t bitmap16) + static void OnSuccessCallback_18(void * context, chip::BitFlags bitmap16) { (static_cast(context))->OnSuccessResponse_18(bitmap16); } @@ -65881,7 +65881,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_20(error); } - static void OnSuccessCallback_20(void * context, uint16_t bitmap16) + static void OnSuccessCallback_20(void * context, chip::BitFlags bitmap16) { (static_cast(context))->OnSuccessResponse_20(bitmap16); } @@ -65891,7 +65891,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_21(error); } - static void OnSuccessCallback_21(void * context, uint32_t bitmap32) + static void OnSuccessCallback_21(void * context, chip::BitFlags bitmap32) { (static_cast(context))->OnSuccessResponse_21(bitmap32); } @@ -65908,7 +65908,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_23(error); } - static void OnSuccessCallback_23(void * context, uint32_t bitmap32) + static void OnSuccessCallback_23(void * context, chip::BitFlags bitmap32) { (static_cast(context))->OnSuccessResponse_23(bitmap32); } @@ -65925,7 +65925,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_25(error); } - static void OnSuccessCallback_25(void * context, uint32_t bitmap32) + static void OnSuccessCallback_25(void * context, chip::BitFlags bitmap32) { (static_cast(context))->OnSuccessResponse_25(bitmap32); } @@ -65935,7 +65935,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_26(error); } - static void OnSuccessCallback_26(void * context, uint64_t bitmap64) + static void OnSuccessCallback_26(void * context, chip::BitFlags bitmap64) { (static_cast(context))->OnSuccessResponse_26(bitmap64); } @@ -65952,7 +65952,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_28(error); } - static void OnSuccessCallback_28(void * context, uint64_t bitmap64) + static void OnSuccessCallback_28(void * context, chip::BitFlags bitmap64) { (static_cast(context))->OnSuccessResponse_28(bitmap64); } @@ -65969,7 +65969,7 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_30(error); } - static void OnSuccessCallback_30(void * context, uint64_t bitmap64) + static void OnSuccessCallback_30(void * context, chip::BitFlags bitmap64) { (static_cast(context))->OnSuccessResponse_30(bitmap64); } @@ -67143,7 +67143,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_184(error); } - static void OnSuccessCallback_184(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) + static void OnSuccessCallback_184( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap8) { (static_cast(context))->OnSuccessResponse_184(nullableBitmap8); } @@ -67160,7 +67162,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_186(error); } - static void OnSuccessCallback_186(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) + static void OnSuccessCallback_186( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap8) { (static_cast(context))->OnSuccessResponse_186(nullableBitmap8); } @@ -67177,7 +67181,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_188(error); } - static void OnSuccessCallback_188(void * context, const chip::app::DataModel::Nullable & nullableBitmap8) + static void OnSuccessCallback_188( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap8) { (static_cast(context))->OnSuccessResponse_188(nullableBitmap8); } @@ -67194,7 +67200,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_190(error); } - static void OnSuccessCallback_190(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) + static void OnSuccessCallback_190( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap16) { (static_cast(context))->OnSuccessResponse_190(nullableBitmap16); } @@ -67211,7 +67219,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_192(error); } - static void OnSuccessCallback_192(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) + static void OnSuccessCallback_192( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap16) { (static_cast(context))->OnSuccessResponse_192(nullableBitmap16); } @@ -67228,7 +67238,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_194(error); } - static void OnSuccessCallback_194(void * context, const chip::app::DataModel::Nullable & nullableBitmap16) + static void OnSuccessCallback_194( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap16) { (static_cast(context))->OnSuccessResponse_194(nullableBitmap16); } @@ -67245,7 +67257,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_196(error); } - static void OnSuccessCallback_196(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) + static void OnSuccessCallback_196( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap32) { (static_cast(context))->OnSuccessResponse_196(nullableBitmap32); } @@ -67262,7 +67276,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_198(error); } - static void OnSuccessCallback_198(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) + static void OnSuccessCallback_198( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap32) { (static_cast(context))->OnSuccessResponse_198(nullableBitmap32); } @@ -67279,7 +67295,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_200(error); } - static void OnSuccessCallback_200(void * context, const chip::app::DataModel::Nullable & nullableBitmap32) + static void OnSuccessCallback_200( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap32) { (static_cast(context))->OnSuccessResponse_200(nullableBitmap32); } @@ -67296,7 +67314,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_202(error); } - static void OnSuccessCallback_202(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) + static void OnSuccessCallback_202( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap64) { (static_cast(context))->OnSuccessResponse_202(nullableBitmap64); } @@ -67313,7 +67333,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_204(error); } - static void OnSuccessCallback_204(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) + static void OnSuccessCallback_204( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap64) { (static_cast(context))->OnSuccessResponse_204(nullableBitmap64); } @@ -67330,7 +67352,9 @@ class TestClusterSuite : public TestCommand (static_cast(context))->OnFailureResponse_206(error); } - static void OnSuccessCallback_206(void * context, const chip::app::DataModel::Nullable & nullableBitmap64) + static void OnSuccessCallback_206( + void * context, + const chip::app::DataModel::Nullable> & nullableBitmap64) { (static_cast(context))->OnSuccessResponse_206(nullableBitmap64); } @@ -70001,7 +70025,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_11(uint8_t bitmap8) + void OnSuccessResponse_11(chip::BitFlags bitmap8) { VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); @@ -70014,8 +70038,8 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t bitmap8Argument; - bitmap8Argument = 255; + chip::BitFlags bitmap8Argument; + bitmap8Argument = static_cast>(255); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap8Argument, this, OnSuccessCallback_12, OnFailureCallback_12)); @@ -70047,7 +70071,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_13(uint8_t bitmap8) + void OnSuccessResponse_13(chip::BitFlags bitmap8) { VerifyOrReturn(CheckValue("bitmap8", bitmap8, 255)); @@ -70060,8 +70084,8 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t bitmap8Argument; - bitmap8Argument = 0; + chip::BitFlags bitmap8Argument; + bitmap8Argument = static_cast>(0); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap8Argument, this, OnSuccessCallback_14, OnFailureCallback_14)); @@ -70093,7 +70117,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_15(uint8_t bitmap8) + void OnSuccessResponse_15(chip::BitFlags bitmap8) { VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); @@ -70117,7 +70141,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_16(uint16_t bitmap16) + void OnSuccessResponse_16(chip::BitFlags bitmap16) { VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); @@ -70130,8 +70154,8 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t bitmap16Argument; - bitmap16Argument = 65535U; + chip::BitFlags bitmap16Argument; + bitmap16Argument = static_cast>(65535U); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap16Argument, this, OnSuccessCallback_17, OnFailureCallback_17)); @@ -70163,7 +70187,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_18(uint16_t bitmap16) + void OnSuccessResponse_18(chip::BitFlags bitmap16) { VerifyOrReturn(CheckValue("bitmap16", bitmap16, 65535U)); @@ -70176,8 +70200,8 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t bitmap16Argument; - bitmap16Argument = 0U; + chip::BitFlags bitmap16Argument; + bitmap16Argument = static_cast>(0U); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap16Argument, this, OnSuccessCallback_19, OnFailureCallback_19)); @@ -70209,7 +70233,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_20(uint16_t bitmap16) + void OnSuccessResponse_20(chip::BitFlags bitmap16) { VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); @@ -70233,7 +70257,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_21(uint32_t bitmap32) + void OnSuccessResponse_21(chip::BitFlags bitmap32) { VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); @@ -70246,8 +70270,8 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint32_t bitmap32Argument; - bitmap32Argument = 4294967295UL; + chip::BitFlags bitmap32Argument; + bitmap32Argument = static_cast>(4294967295UL); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap32Argument, this, OnSuccessCallback_22, OnFailureCallback_22)); @@ -70279,7 +70303,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_23(uint32_t bitmap32) + void OnSuccessResponse_23(chip::BitFlags bitmap32) { VerifyOrReturn(CheckValue("bitmap32", bitmap32, 4294967295UL)); @@ -70292,8 +70316,8 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint32_t bitmap32Argument; - bitmap32Argument = 0UL; + chip::BitFlags bitmap32Argument; + bitmap32Argument = static_cast>(0UL); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap32Argument, this, OnSuccessCallback_24, OnFailureCallback_24)); @@ -70325,7 +70349,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_25(uint32_t bitmap32) + void OnSuccessResponse_25(chip::BitFlags bitmap32) { VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); @@ -70349,7 +70373,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_26(uint64_t bitmap64) + void OnSuccessResponse_26(chip::BitFlags bitmap64) { VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); @@ -70362,8 +70386,8 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint64_t bitmap64Argument; - bitmap64Argument = 18446744073709551615ULL; + chip::BitFlags bitmap64Argument; + bitmap64Argument = static_cast>(18446744073709551615ULL); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap64Argument, this, OnSuccessCallback_27, OnFailureCallback_27)); @@ -70395,7 +70419,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_28(uint64_t bitmap64) + void OnSuccessResponse_28(chip::BitFlags bitmap64) { VerifyOrReturn(CheckValue("bitmap64", bitmap64, 18446744073709551615ULL)); @@ -70408,8 +70432,8 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint64_t bitmap64Argument; - bitmap64Argument = 0ULL; + chip::BitFlags bitmap64Argument; + bitmap64Argument = static_cast>(0ULL); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap64Argument, this, OnSuccessCallback_29, OnFailureCallback_29)); @@ -70441,7 +70465,7 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_30(uint64_t bitmap64) + void OnSuccessResponse_30(chip::BitFlags bitmap64) { VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); @@ -74988,9 +75012,9 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap8Argument; + chip::app::DataModel::Nullable> nullableBitmap8Argument; nullableBitmap8Argument.SetNonNull(); - nullableBitmap8Argument.Value() = 254; + nullableBitmap8Argument.Value() = static_cast>(254); ReturnErrorOnFailure(cluster.WriteAttribute( nullableBitmap8Argument, this, OnSuccessCallback_183, OnFailureCallback_183)); @@ -75022,7 +75046,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_184(const chip::app::DataModel::Nullable & nullableBitmap8) + void OnSuccessResponse_184( + const chip::app::DataModel::Nullable> & nullableBitmap8) { VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); @@ -75036,9 +75061,9 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap8Argument; + chip::app::DataModel::Nullable> nullableBitmap8Argument; nullableBitmap8Argument.SetNonNull(); - nullableBitmap8Argument.Value() = 255; + nullableBitmap8Argument.Value() = static_cast>(255); ReturnErrorOnFailure(cluster.WriteAttribute( nullableBitmap8Argument, this, OnSuccessCallback_185, OnFailureCallback_185)); @@ -75071,7 +75096,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_186(const chip::app::DataModel::Nullable & nullableBitmap8) + void OnSuccessResponse_186( + const chip::app::DataModel::Nullable> & nullableBitmap8) { VerifyOrReturn(CheckValueNonNull("nullableBitmap8", nullableBitmap8)); VerifyOrReturn(CheckValue("nullableBitmap8.Value()", nullableBitmap8.Value(), 254)); @@ -75085,7 +75111,7 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap8Argument; + chip::app::DataModel::Nullable> nullableBitmap8Argument; nullableBitmap8Argument.SetNull(); ReturnErrorOnFailure(cluster.WriteAttribute( @@ -75118,7 +75144,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_188(const chip::app::DataModel::Nullable & nullableBitmap8) + void OnSuccessResponse_188( + const chip::app::DataModel::Nullable> & nullableBitmap8) { VerifyOrReturn(CheckValueNull("nullableBitmap8", nullableBitmap8)); @@ -75131,9 +75158,9 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap16Argument; + chip::app::DataModel::Nullable> nullableBitmap16Argument; nullableBitmap16Argument.SetNonNull(); - nullableBitmap16Argument.Value() = 65534U; + nullableBitmap16Argument.Value() = static_cast>(65534U); ReturnErrorOnFailure(cluster.WriteAttribute( nullableBitmap16Argument, this, OnSuccessCallback_189, OnFailureCallback_189)); @@ -75165,7 +75192,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_190(const chip::app::DataModel::Nullable & nullableBitmap16) + void OnSuccessResponse_190( + const chip::app::DataModel::Nullable> & nullableBitmap16) { VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); @@ -75179,9 +75207,9 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap16Argument; + chip::app::DataModel::Nullable> nullableBitmap16Argument; nullableBitmap16Argument.SetNonNull(); - nullableBitmap16Argument.Value() = 65535U; + nullableBitmap16Argument.Value() = static_cast>(65535U); ReturnErrorOnFailure(cluster.WriteAttribute( nullableBitmap16Argument, this, OnSuccessCallback_191, OnFailureCallback_191)); @@ -75214,7 +75242,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_192(const chip::app::DataModel::Nullable & nullableBitmap16) + void OnSuccessResponse_192( + const chip::app::DataModel::Nullable> & nullableBitmap16) { VerifyOrReturn(CheckValueNonNull("nullableBitmap16", nullableBitmap16)); VerifyOrReturn(CheckValue("nullableBitmap16.Value()", nullableBitmap16.Value(), 65534U)); @@ -75228,7 +75257,7 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap16Argument; + chip::app::DataModel::Nullable> nullableBitmap16Argument; nullableBitmap16Argument.SetNull(); ReturnErrorOnFailure(cluster.WriteAttribute( @@ -75261,7 +75290,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_194(const chip::app::DataModel::Nullable & nullableBitmap16) + void OnSuccessResponse_194( + const chip::app::DataModel::Nullable> & nullableBitmap16) { VerifyOrReturn(CheckValueNull("nullableBitmap16", nullableBitmap16)); @@ -75274,9 +75304,10 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap32Argument; + chip::app::DataModel::Nullable> nullableBitmap32Argument; nullableBitmap32Argument.SetNonNull(); - nullableBitmap32Argument.Value() = 4294967294UL; + nullableBitmap32Argument.Value() = + static_cast>(4294967294UL); ReturnErrorOnFailure(cluster.WriteAttribute( nullableBitmap32Argument, this, OnSuccessCallback_195, OnFailureCallback_195)); @@ -75308,7 +75339,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_196(const chip::app::DataModel::Nullable & nullableBitmap32) + void OnSuccessResponse_196( + const chip::app::DataModel::Nullable> & nullableBitmap32) { VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); @@ -75322,9 +75354,10 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap32Argument; + chip::app::DataModel::Nullable> nullableBitmap32Argument; nullableBitmap32Argument.SetNonNull(); - nullableBitmap32Argument.Value() = 4294967295UL; + nullableBitmap32Argument.Value() = + static_cast>(4294967295UL); ReturnErrorOnFailure(cluster.WriteAttribute( nullableBitmap32Argument, this, OnSuccessCallback_197, OnFailureCallback_197)); @@ -75357,7 +75390,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_198(const chip::app::DataModel::Nullable & nullableBitmap32) + void OnSuccessResponse_198( + const chip::app::DataModel::Nullable> & nullableBitmap32) { VerifyOrReturn(CheckValueNonNull("nullableBitmap32", nullableBitmap32)); VerifyOrReturn(CheckValue("nullableBitmap32.Value()", nullableBitmap32.Value(), 4294967294UL)); @@ -75371,7 +75405,7 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap32Argument; + chip::app::DataModel::Nullable> nullableBitmap32Argument; nullableBitmap32Argument.SetNull(); ReturnErrorOnFailure(cluster.WriteAttribute( @@ -75404,7 +75438,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_200(const chip::app::DataModel::Nullable & nullableBitmap32) + void OnSuccessResponse_200( + const chip::app::DataModel::Nullable> & nullableBitmap32) { VerifyOrReturn(CheckValueNull("nullableBitmap32", nullableBitmap32)); @@ -75417,9 +75452,10 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap64Argument; + chip::app::DataModel::Nullable> nullableBitmap64Argument; nullableBitmap64Argument.SetNonNull(); - nullableBitmap64Argument.Value() = 18446744073709551614ULL; + nullableBitmap64Argument.Value() = + static_cast>(18446744073709551614ULL); ReturnErrorOnFailure(cluster.WriteAttribute( nullableBitmap64Argument, this, OnSuccessCallback_201, OnFailureCallback_201)); @@ -75451,7 +75487,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_202(const chip::app::DataModel::Nullable & nullableBitmap64) + void OnSuccessResponse_202( + const chip::app::DataModel::Nullable> & nullableBitmap64) { VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); @@ -75465,9 +75502,10 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap64Argument; + chip::app::DataModel::Nullable> nullableBitmap64Argument; nullableBitmap64Argument.SetNonNull(); - nullableBitmap64Argument.Value() = 18446744073709551615ULL; + nullableBitmap64Argument.Value() = + static_cast>(18446744073709551615ULL); ReturnErrorOnFailure(cluster.WriteAttribute( nullableBitmap64Argument, this, OnSuccessCallback_203, OnFailureCallback_203)); @@ -75500,7 +75538,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_204(const chip::app::DataModel::Nullable & nullableBitmap64) + void OnSuccessResponse_204( + const chip::app::DataModel::Nullable> & nullableBitmap64) { VerifyOrReturn(CheckValueNonNull("nullableBitmap64", nullableBitmap64)); VerifyOrReturn(CheckValue("nullableBitmap64.Value()", nullableBitmap64.Value(), 18446744073709551614ULL)); @@ -75514,7 +75553,7 @@ class TestClusterSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - chip::app::DataModel::Nullable nullableBitmap64Argument; + chip::app::DataModel::Nullable> nullableBitmap64Argument; nullableBitmap64Argument.SetNull(); ReturnErrorOnFailure(cluster.WriteAttribute( @@ -75547,7 +75586,8 @@ class TestClusterSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_206(const chip::app::DataModel::Nullable & nullableBitmap64) + void OnSuccessResponse_206( + const chip::app::DataModel::Nullable> & nullableBitmap64) { VerifyOrReturn(CheckValueNull("nullableBitmap64", nullableBitmap64)); @@ -85186,10 +85226,10 @@ class TestSaveAsSuite : public TestCommand uint8_t TestAddArgumentDefaultValue; bool readAttributeBooleanDefaultValue; - uint8_t readAttributeBitmap8DefaultValue; - uint16_t readAttributeBitmap16DefaultValue; - uint32_t readAttributeBitmap32DefaultValue; - uint64_t readAttributeBitmap64DefaultValue; + chip::BitFlags readAttributeBitmap8DefaultValue; + chip::BitFlags readAttributeBitmap16DefaultValue; + chip::BitFlags readAttributeBitmap32DefaultValue; + chip::BitFlags readAttributeBitmap64DefaultValue; uint8_t readAttributeInt8uDefaultValue; uint16_t readAttributeInt16uDefaultValue; uint32_t readAttributeInt32uDefaultValue; @@ -85269,7 +85309,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_9(error); } - static void OnSuccessCallback_9(void * context, uint8_t bitmap8) + static void OnSuccessCallback_9(void * context, chip::BitFlags bitmap8) { (static_cast(context))->OnSuccessResponse_9(bitmap8); } @@ -85286,7 +85326,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_11(error); } - static void OnSuccessCallback_11(void * context, uint8_t bitmap8) + static void OnSuccessCallback_11(void * context, chip::BitFlags bitmap8) { (static_cast(context))->OnSuccessResponse_11(bitmap8); } @@ -85303,7 +85343,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_13(error); } - static void OnSuccessCallback_13(void * context, uint8_t bitmap8) + static void OnSuccessCallback_13(void * context, chip::BitFlags bitmap8) { (static_cast(context))->OnSuccessResponse_13(bitmap8); } @@ -85313,7 +85353,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_14(error); } - static void OnSuccessCallback_14(void * context, uint16_t bitmap16) + static void OnSuccessCallback_14(void * context, chip::BitFlags bitmap16) { (static_cast(context))->OnSuccessResponse_14(bitmap16); } @@ -85330,7 +85370,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_16(error); } - static void OnSuccessCallback_16(void * context, uint16_t bitmap16) + static void OnSuccessCallback_16(void * context, chip::BitFlags bitmap16) { (static_cast(context))->OnSuccessResponse_16(bitmap16); } @@ -85347,7 +85387,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_18(error); } - static void OnSuccessCallback_18(void * context, uint16_t bitmap16) + static void OnSuccessCallback_18(void * context, chip::BitFlags bitmap16) { (static_cast(context))->OnSuccessResponse_18(bitmap16); } @@ -85357,7 +85397,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_19(error); } - static void OnSuccessCallback_19(void * context, uint32_t bitmap32) + static void OnSuccessCallback_19(void * context, chip::BitFlags bitmap32) { (static_cast(context))->OnSuccessResponse_19(bitmap32); } @@ -85374,7 +85414,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_21(error); } - static void OnSuccessCallback_21(void * context, uint32_t bitmap32) + static void OnSuccessCallback_21(void * context, chip::BitFlags bitmap32) { (static_cast(context))->OnSuccessResponse_21(bitmap32); } @@ -85391,7 +85431,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_23(error); } - static void OnSuccessCallback_23(void * context, uint32_t bitmap32) + static void OnSuccessCallback_23(void * context, chip::BitFlags bitmap32) { (static_cast(context))->OnSuccessResponse_23(bitmap32); } @@ -85401,7 +85441,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_24(error); } - static void OnSuccessCallback_24(void * context, uint64_t bitmap64) + static void OnSuccessCallback_24(void * context, chip::BitFlags bitmap64) { (static_cast(context))->OnSuccessResponse_24(bitmap64); } @@ -85418,7 +85458,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_26(error); } - static void OnSuccessCallback_26(void * context, uint64_t bitmap64) + static void OnSuccessCallback_26(void * context, chip::BitFlags bitmap64) { (static_cast(context))->OnSuccessResponse_26(bitmap64); } @@ -85435,7 +85475,7 @@ class TestSaveAsSuite : public TestCommand (static_cast(context))->OnFailureResponse_28(error); } - static void OnSuccessCallback_28(void * context, uint64_t bitmap64) + static void OnSuccessCallback_28(void * context, chip::BitFlags bitmap64) { (static_cast(context))->OnSuccessResponse_28(bitmap64); } @@ -86401,7 +86441,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_9(uint8_t bitmap8) + void OnSuccessResponse_9(chip::BitFlags bitmap8) { VerifyOrReturn(CheckValue("bitmap8", bitmap8, 0)); @@ -86415,8 +86455,8 @@ class TestSaveAsSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t bitmap8Argument; - bitmap8Argument = 1; + chip::BitFlags bitmap8Argument; + bitmap8Argument = static_cast>(1); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap8Argument, this, OnSuccessCallback_10, OnFailureCallback_10)); @@ -86448,7 +86488,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_11(uint8_t bitmap8) + void OnSuccessResponse_11(chip::BitFlags bitmap8) { VerifyOrReturn(CheckConstraintNotValue("bitmap8", bitmap8, readAttributeBitmap8DefaultValue)); @@ -86461,7 +86501,7 @@ class TestSaveAsSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint8_t bitmap8Argument; + chip::BitFlags bitmap8Argument; bitmap8Argument = readAttributeBitmap8DefaultValue; ReturnErrorOnFailure(cluster.WriteAttribute( @@ -86494,7 +86534,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_13(uint8_t bitmap8) + void OnSuccessResponse_13(chip::BitFlags bitmap8) { VerifyOrReturn(CheckValue("bitmap8", bitmap8, readAttributeBitmap8DefaultValue)); @@ -86518,7 +86558,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_14(uint16_t bitmap16) + void OnSuccessResponse_14(chip::BitFlags bitmap16) { VerifyOrReturn(CheckValue("bitmap16", bitmap16, 0U)); @@ -86532,8 +86572,8 @@ class TestSaveAsSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t bitmap16Argument; - bitmap16Argument = 1U; + chip::BitFlags bitmap16Argument; + bitmap16Argument = static_cast>(1U); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap16Argument, this, OnSuccessCallback_15, OnFailureCallback_15)); @@ -86565,7 +86605,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_16(uint16_t bitmap16) + void OnSuccessResponse_16(chip::BitFlags bitmap16) { VerifyOrReturn(CheckConstraintNotValue("bitmap16", bitmap16, readAttributeBitmap16DefaultValue)); @@ -86578,7 +86618,7 @@ class TestSaveAsSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint16_t bitmap16Argument; + chip::BitFlags bitmap16Argument; bitmap16Argument = readAttributeBitmap16DefaultValue; ReturnErrorOnFailure(cluster.WriteAttribute( @@ -86611,7 +86651,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_18(uint16_t bitmap16) + void OnSuccessResponse_18(chip::BitFlags bitmap16) { VerifyOrReturn(CheckValue("bitmap16", bitmap16, readAttributeBitmap16DefaultValue)); @@ -86635,7 +86675,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_19(uint32_t bitmap32) + void OnSuccessResponse_19(chip::BitFlags bitmap32) { VerifyOrReturn(CheckValue("bitmap32", bitmap32, 0UL)); @@ -86649,8 +86689,8 @@ class TestSaveAsSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint32_t bitmap32Argument; - bitmap32Argument = 1UL; + chip::BitFlags bitmap32Argument; + bitmap32Argument = static_cast>(1UL); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap32Argument, this, OnSuccessCallback_20, OnFailureCallback_20)); @@ -86682,7 +86722,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_21(uint32_t bitmap32) + void OnSuccessResponse_21(chip::BitFlags bitmap32) { VerifyOrReturn(CheckConstraintNotValue("bitmap32", bitmap32, readAttributeBitmap32DefaultValue)); @@ -86695,7 +86735,7 @@ class TestSaveAsSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint32_t bitmap32Argument; + chip::BitFlags bitmap32Argument; bitmap32Argument = readAttributeBitmap32DefaultValue; ReturnErrorOnFailure(cluster.WriteAttribute( @@ -86728,7 +86768,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_23(uint32_t bitmap32) + void OnSuccessResponse_23(chip::BitFlags bitmap32) { VerifyOrReturn(CheckValue("bitmap32", bitmap32, readAttributeBitmap32DefaultValue)); @@ -86752,7 +86792,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_24(uint64_t bitmap64) + void OnSuccessResponse_24(chip::BitFlags bitmap64) { VerifyOrReturn(CheckValue("bitmap64", bitmap64, 0ULL)); @@ -86766,8 +86806,8 @@ class TestSaveAsSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint64_t bitmap64Argument; - bitmap64Argument = 1ULL; + chip::BitFlags bitmap64Argument; + bitmap64Argument = static_cast>(1ULL); ReturnErrorOnFailure(cluster.WriteAttribute( bitmap64Argument, this, OnSuccessCallback_25, OnFailureCallback_25)); @@ -86799,7 +86839,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_26(uint64_t bitmap64) + void OnSuccessResponse_26(chip::BitFlags bitmap64) { VerifyOrReturn(CheckConstraintNotValue("bitmap64", bitmap64, readAttributeBitmap64DefaultValue)); @@ -86812,7 +86852,7 @@ class TestSaveAsSuite : public TestCommand chip::Controller::TestClusterClusterTest cluster; cluster.Associate(mDevices[kIdentityAlpha], endpoint); - uint64_t bitmap64Argument; + chip::BitFlags bitmap64Argument; bitmap64Argument = readAttributeBitmap64DefaultValue; ReturnErrorOnFailure(cluster.WriteAttribute( @@ -86845,7 +86885,7 @@ class TestSaveAsSuite : public TestCommand ThrowFailureResponse(); } - void OnSuccessResponse_28(uint64_t bitmap64) + void OnSuccessResponse_28(chip::BitFlags bitmap64) { VerifyOrReturn(CheckValue("bitmap64", bitmap64, readAttributeBitmap64DefaultValue));