From 9f81babc0c84ee8684cb92af4314be75fa45879a Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 13:30:36 -0400 Subject: [PATCH 01/18] Add a BitMask class that adds more functionality beyond bit flags --- src/lib/support/BUILD.gn | 1 + src/lib/support/BitMask.h | 96 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 src/lib/support/BitMask.h diff --git a/src/lib/support/BUILD.gn b/src/lib/support/BUILD.gn index e96066221d5b47..81a9e0e255c12b 100644 --- a/src/lib/support/BUILD.gn +++ b/src/lib/support/BUILD.gn @@ -61,6 +61,7 @@ static_library("support") { "Base64.cpp", "Base64.h", "BitFlags.h", + "BitMask.h", "BufferReader.cpp", "BufferReader.h", "BufferWriter.cpp", diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h new file mode 100644 index 00000000000000..d4437ccc1a85a4 --- /dev/null +++ b/src/lib/support/BitMask.h @@ -0,0 +1,96 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include + +namespace chip { + +/** + * Stores bit masks and flags in a more typesafe manner. + * + * Extends BitFlags for boolean flags and also adds support for bit-mask set options. + * + */ +template > +class BitMask : public BitFlags +{ +public: + /** + * GetField to value via a mask shifting. + * + * @param mask Typed flag(s) to used as mask, flag(s) must be contiguous. Any flags not in @a v are unaffected. + * @returns Value from the underlying field/mask + */ + constexpr BitFlags & SetField(FlagsEnum mask, IntegerType value) + { + IntegerType bitMask = static_cast(mask); + IntegerType shift = GetShiftToFirstSetBit(bitMask); + + // Value should be fully contained within the shift mask. + assert((value & (mask >> shift)) == value); + + // Clear bits overlayed by the mask + mValue = static_cast(mValue & ~bitMask); + // Set the right bits + mValue |= static_cast(bitMask & (value << shift)); + + return *this; + } + + /** + * GetField to value via a mask shifting. + * + * @param mask Typed flag(s) to used as mask, flag(s) must be contiguous. Any flags not in @a v are unaffected. + * @returns Value from the underlying field/mask + */ + IntegerType GetField(FlagsEnum mask) const + { + { + IntegerType bitMask = static_cast(mask); + IntegerType shift = GetShiftToFirstSetBit(bitMask); + + // Forward the right bits + return static_cast(((mValue & bitMask) >> shift)); + } + } + +protected: + /// Get the shift amount to reach the first non-zero bit in a bitmask + /// + /// Examples: + /// GetShiftToFirstSetBit(0b0000001) == 0 + /// GetShiftToFirstSetBit(0b0011100) == 2 + /// GetShiftToFirstSetBit(0b0110000) == 4 + /// + /// Note: This does NOT validate if the given mask is a valid mask. So: + /// GetShiftToFirstSetBit(0b0100010) == 1 + /// GetShiftToFirstSetBit(0b010110100) == 2 + static constexpr IntegerType GetShiftToFirstSetBit(IntegerType bitMask) + { + IntegerType count = 0; + while (!(bitMask & 0x1) && (count < std::numeric_limits::max())) + { + bitMask = static_cast(bitMask >> 1); + count++; + } + return count; + } +}; From a1fff946fbc6ad969264c3b6ffe546e742bb3e21 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 13:31:29 -0400 Subject: [PATCH 02/18] Use bit-mask class in zap --- .../templates/app/cluster-objects.zapt | 2 +- src/app/zap-templates/templates/app/helper.js | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/app/zap-templates/templates/app/cluster-objects.zapt b/src/app/zap-templates/templates/app/cluster-objects.zapt index a8dbc29205c5e4..e693edacbab6b2 100644 --- a/src/app/zap-templates/templates/app/cluster-objects.zapt +++ b/src/app/zap-templates/templates/app/cluster-objects.zapt @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js index 87d2731149d371..0eeeba5d296c9f 100644 --- a/src/app/zap-templates/templates/app/helper.js +++ b/src/app/zap-templates/templates/app/helper.js @@ -110,25 +110,25 @@ function chip_endpoint_generated_functions() { hasFunctionArray = true functionList = functionList.concat( - ` (EmberAfGenericClusterFunction) emberAf${cHelper.asCamelCased(clusterName, false)}ClusterServerInitCallback,\\\n`) + ` (EmberAfGenericClusterFunction) emberAf${cHelper.asCamelCased(clusterName, false)}ClusterServerInitCallback,\\\n`) } if (endpointClusterWithAttributeChanged.includes(clusterName)) { functionList = functionList.concat(` (EmberAfGenericClusterFunction) Matter${ cHelper.asCamelCased(clusterName, false)}ClusterServerAttributeChangedCallback,\\\n`) - hasFunctionArray = true + hasFunctionArray = true } if (endpointClusterWithMessageSent.includes(clusterName)) { functionList = functionList.concat(` (EmberAfGenericClusterFunction) emberAf${ cHelper.asCamelCased(clusterName, false)}ClusterServerMessageSentCallback,\\\n`) - hasFunctionArray = true + hasFunctionArray = true } if (endpointClusterWithPreAttribute.includes(clusterName)) { functionList = functionList.concat(` (EmberAfGenericClusterFunction) Matter${ cHelper.asCamelCased(clusterName, false)}ClusterServerPreAttributeChangedCallback,\\\n`) - hasFunctionArray = true + hasFunctionArray = true } if (hasFunctionArray) { @@ -294,9 +294,7 @@ async function asNativeType(type) function fn(pkgId) { const options = { 'hash' : {} }; - return zclHelper.asUnderlyingZclType.call(this, type, options).then(zclType => { - return ChipTypesHelper.asBasicType(zclType); - }) + return zclHelper.asUnderlyingZclType.call(this, type, options).then(zclType => { return ChipTypesHelper.asBasicType(zclType); }) } const promise = templateUtil.ensureZclPackageId(this).then(fn.bind(this)).catch(err => { @@ -480,7 +478,7 @@ async function zapTypeToClusterObjectType(type, isDecodable, options) if (s) { return 'uint' + s[1] + '_t'; } - return 'chip::BitFlags<' + ns + type + '>'; + return 'chip::BitMask<' + ns + type + '>'; } if (types.isStruct) { @@ -517,14 +515,14 @@ async function zapTypeToClusterObjectType(type, isDecodable, options) passByReference = true; // If we did not have a namespace provided, we can assume we're inside // chip::app::. - let ns = options.hash.ns ? "chip::app::" : "" + let ns = options.hash.ns ? "chip::app::" : "" typeStr = `${ns}DataModel::Nullable<${typeStr}>`; } if (this.isOptional && !options.hash.forceNotOptional) { passByReference = true; // If we did not have a namespace provided, we can assume we're inside // chip::. - let ns = options.hash.ns ? "chip::" : "" + let ns = options.hash.ns ? "chip::" : "" typeStr = `${ns}Optional<${typeStr}>`; } if (options.hash.isArgument && passByReference) { From ebe06139839e52f4fd2a379c2c5247bda107f306 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 13:35:56 -0400 Subject: [PATCH 03/18] Zap regen --- .../java/zap-generated/CHIPReadCallbacks.cpp | 8 +- .../java/zap-generated/CHIPReadCallbacks.h | 8 +- .../CHIP/zap-generated/CHIPCallbackBridge.mm | 46 +- .../CHIPCallbackBridge_internal.h | 94 ++-- .../zap-generated/attributes/Accessors.cpp | 200 ++++---- .../zap-generated/attributes/Accessors.h | 109 +++-- .../zap-generated/cluster-objects.h | 438 +++++++++--------- .../zap-generated/cluster/Commands.h | 36 +- .../cluster/logging/DataModelLogger.cpp | 46 +- .../chip-tool/zap-generated/test/Commands.h | 364 +++++++-------- 10 files changed, 673 insertions(+), 676 deletions(-) diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index 35a915459cd205..1092fdbdc12c4f 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -21141,7 +21141,7 @@ CHIPTestClusterNullableBitmap8AttributeCallback::~CHIPTestClusterNullableBitmap8 } void CHIPTestClusterNullableBitmap8AttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable> & value) + void * context, const chip::app::DataModel::Nullable> & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -21208,7 +21208,7 @@ CHIPTestClusterNullableBitmap16AttributeCallback::~CHIPTestClusterNullableBitmap } void CHIPTestClusterNullableBitmap16AttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable> & value) + void * context, const chip::app::DataModel::Nullable> & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -21275,7 +21275,7 @@ CHIPTestClusterNullableBitmap32AttributeCallback::~CHIPTestClusterNullableBitmap } void CHIPTestClusterNullableBitmap32AttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable> & value) + void * context, const chip::app::DataModel::Nullable> & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -21342,7 +21342,7 @@ CHIPTestClusterNullableBitmap64AttributeCallback::~CHIPTestClusterNullableBitmap } void CHIPTestClusterNullableBitmap64AttributeCallback::CallbackFn( - void * context, const chip::app::DataModel::Nullable> & value) + void * context, const chip::app::DataModel::Nullable> & value) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.h b/src/controller/java/zap-generated/CHIPReadCallbacks.h index 3bb525d8341de2..79824614a849f7 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.h +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.h @@ -8590,7 +8590,7 @@ class CHIPTestClusterNullableBitmap8AttributeCallback static void CallbackFn(void * context, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -8622,7 +8622,7 @@ class CHIPTestClusterNullableBitmap16AttributeCallback static void CallbackFn(void * context, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -8654,7 +8654,7 @@ class CHIPTestClusterNullableBitmap32AttributeCallback static void CallbackFn(void * context, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); static void OnSubscriptionEstablished(void * context) { CHIP_ERROR err = chip::JniReferences::GetInstance().CallSubscriptionEstablished( @@ -8686,7 +8686,7 @@ class CHIPTestClusterNullableBitmap64AttributeCallback static void CallbackFn(void * context, - const chip::app::DataModel::Nullable> & value); + 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/zap-generated/CHIPCallbackBridge.mm b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm index 2e31d08f6d27c7..4ebc375a6c47d2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge.mm @@ -3719,7 +3719,7 @@ } void CHIPDoorLockCredentialRulesSupportAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:value.Raw()]; @@ -3743,7 +3743,7 @@ } void CHIPDoorLockSupportedOperatingModesAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -3767,7 +3767,7 @@ } void CHIPDoorLockDefaultConfigurationRegisterAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -3791,7 +3791,7 @@ } void CHIPDoorLockLocalProgrammingFeaturesAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:value.Raw()]; @@ -3815,7 +3815,7 @@ } void CHIPDoorLockAlarmMaskAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -3839,7 +3839,7 @@ } void CHIPDoorLockKeypadOperationEventMaskAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -3863,7 +3863,7 @@ } void CHIPDoorLockRemoteOperationEventMaskAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -3887,7 +3887,7 @@ } void CHIPDoorLockManualOperationEventMaskAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -3911,7 +3911,7 @@ } void CHIPDoorLockRFIDOperationEventMaskAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -3935,7 +3935,7 @@ } void CHIPDoorLockKeypadProgrammingEventMaskAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -3959,7 +3959,7 @@ } void CHIPDoorLockRemoteProgrammingEventMaskAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -3983,7 +3983,7 @@ } void CHIPDoorLockRFIDProgrammingEventMaskAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -8359,7 +8359,7 @@ } void CHIPPumpConfigurationAndControlPumpStatusAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -9299,7 +9299,7 @@ } void CHIPTestClusterBitmap8AttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:value.Raw()]; @@ -9323,7 +9323,7 @@ } void CHIPTestClusterBitmap16AttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedShort:value.Raw()]; @@ -9347,7 +9347,7 @@ } void CHIPTestClusterBitmap32AttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedInt:value.Raw()]; @@ -9371,7 +9371,7 @@ } void CHIPTestClusterBitmap64AttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedLongLong:value.Raw()]; @@ -9895,7 +9895,7 @@ } void CHIPTestClusterNullableBitmap8AttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable> & value) + void * context, const chip::app::DataModel::Nullable> & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -9923,7 +9923,7 @@ } void CHIPTestClusterNullableBitmap16AttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable> & value) + void * context, const chip::app::DataModel::Nullable> & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -9951,7 +9951,7 @@ } void CHIPTestClusterNullableBitmap32AttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable> & value) + void * context, const chip::app::DataModel::Nullable> & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -9979,7 +9979,7 @@ } void CHIPTestClusterNullableBitmap64AttributeCallbackBridge::OnSuccessFn( - void * context, const chip::app::DataModel::Nullable> & value) + void * context, const chip::app::DataModel::Nullable> & value) { NSNumber * _Nullable objCValue; if (value.IsNull()) { @@ -11451,7 +11451,7 @@ } void CHIPWindowCoveringConfigStatusAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:value.Raw()]; @@ -11475,7 +11475,7 @@ } void CHIPWindowCoveringModeAttributeCallbackBridge::OnSuccessFn( - void * context, chip::BitFlags value) + void * context, chip::BitMask value) { NSNumber * _Nonnull objCValue; objCValue = [NSNumber numberWithUnsignedChar:value.Raw()]; diff --git a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h index e5b4149e3d63a5..2b8e0ff6d2bf3e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/CHIPCallbackBridge_internal.h @@ -755,29 +755,29 @@ typedef void (*DiagnosticLogsAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*DiagnosticLogsAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -typedef void (*DoorLockCredentialRulesSupportAttributeCallback)( - void *, chip::BitFlags); +typedef void (*DoorLockCredentialRulesSupportAttributeCallback)(void *, + chip::BitMask); typedef void (*DoorLockSupportedOperatingModesAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*DoorLockDefaultConfigurationRegisterAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*DoorLockLocalProgrammingFeaturesAttributeCallback)( - void *, chip::BitFlags); -typedef void (*DoorLockAlarmMaskAttributeCallback)(void *, chip::BitFlags); + void *, chip::BitMask); +typedef void (*DoorLockAlarmMaskAttributeCallback)(void *, chip::BitMask); typedef void (*DoorLockKeypadOperationEventMaskAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*DoorLockRemoteOperationEventMaskAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*DoorLockManualOperationEventMaskAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*DoorLockRFIDOperationEventMaskAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*DoorLockKeypadProgrammingEventMaskAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*DoorLockRemoteProgrammingEventMaskAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*DoorLockRFIDProgrammingEventMaskAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*DoorLockGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*DoorLockAcceptedCommandListListAttributeCallback)(void * context, @@ -1012,7 +1012,7 @@ typedef void (*PressureMeasurementAcceptedCommandListListAttributeCallback)( typedef void (*PressureMeasurementAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*PumpConfigurationAndControlPumpStatusAttributeCallback)( - void *, chip::BitFlags); + void *, chip::BitMask); typedef void (*PumpConfigurationAndControlGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*PumpConfigurationAndControlAcceptedCommandListListAttributeCallback)( @@ -1062,10 +1062,10 @@ typedef void (*TemperatureMeasurementAcceptedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*TemperatureMeasurementAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); -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 (*TestClusterBitmap8AttributeCallback)(void *, chip::BitMask); +typedef void (*TestClusterBitmap16AttributeCallback)(void *, chip::BitMask); +typedef void (*TestClusterBitmap32AttributeCallback)(void *, chip::BitMask); +typedef void (*TestClusterBitmap64AttributeCallback)(void *, chip::BitMask); typedef void (*TestClusterListInt8uListAttributeCallback)(void * context, const chip::app::DataModel::DecodableList & data); typedef void (*TestClusterListOctetStringListAttributeCallback)(void * context, @@ -1086,13 +1086,13 @@ typedef void (*TestClusterListFabricScopedListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*TestClusterNullableBitmap8AttributeCallback)( - void *, const chip::app::DataModel::Nullable> &); + void *, const chip::app::DataModel::Nullable> &); typedef void (*TestClusterNullableBitmap16AttributeCallback)( - void *, const chip::app::DataModel::Nullable> &); + void *, const chip::app::DataModel::Nullable> &); typedef void (*TestClusterNullableBitmap32AttributeCallback)( - void *, const chip::app::DataModel::Nullable> &); + void *, const chip::app::DataModel::Nullable> &); typedef void (*TestClusterNullableBitmap64AttributeCallback)( - void *, const chip::app::DataModel::Nullable> &); + void *, const chip::app::DataModel::Nullable> &); typedef void (*TestClusterNullableStructStructAttributeCallback)( void *, const chip::app::DataModel::Nullable &); typedef void (*TestClusterGeneratedCommandListListAttributeCallback)( @@ -1173,8 +1173,8 @@ typedef void (*WiFiNetworkDiagnosticsAcceptedCommandListListAttributeCallback)( typedef void (*WiFiNetworkDiagnosticsAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*WindowCoveringConfigStatusAttributeCallback)(void *, - chip::BitFlags); -typedef void (*WindowCoveringModeAttributeCallback)(void *, chip::BitFlags); + chip::BitMask); +typedef void (*WindowCoveringModeAttributeCallback)(void *, chip::BitMask); typedef void (*WindowCoveringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*WindowCoveringAcceptedCommandListListAttributeCallback)( @@ -3982,7 +3982,7 @@ class CHIPDoorLockCredentialRulesSupportAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockCredentialRulesSupportAttributeCallbackSubscriptionBridge @@ -4010,7 +4010,7 @@ class CHIPDoorLockSupportedOperatingModesAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockSupportedOperatingModesAttributeCallbackSubscriptionBridge @@ -4038,7 +4038,7 @@ class CHIPDoorLockDefaultConfigurationRegisterAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockDefaultConfigurationRegisterAttributeCallbackSubscriptionBridge @@ -4066,7 +4066,7 @@ class CHIPDoorLockLocalProgrammingFeaturesAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockLocalProgrammingFeaturesAttributeCallbackSubscriptionBridge @@ -4093,7 +4093,7 @@ class CHIPDoorLockAlarmMaskAttributeCallbackBridge : public CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockAlarmMaskAttributeCallbackSubscriptionBridge : public CHIPDoorLockAlarmMaskAttributeCallbackBridge @@ -4120,7 +4120,7 @@ class CHIPDoorLockKeypadOperationEventMaskAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockKeypadOperationEventMaskAttributeCallbackSubscriptionBridge @@ -4148,7 +4148,7 @@ class CHIPDoorLockRemoteOperationEventMaskAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockRemoteOperationEventMaskAttributeCallbackSubscriptionBridge @@ -4176,7 +4176,7 @@ class CHIPDoorLockManualOperationEventMaskAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockManualOperationEventMaskAttributeCallbackSubscriptionBridge @@ -4204,7 +4204,7 @@ class CHIPDoorLockRFIDOperationEventMaskAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockRFIDOperationEventMaskAttributeCallbackSubscriptionBridge @@ -4232,7 +4232,7 @@ class CHIPDoorLockKeypadProgrammingEventMaskAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockKeypadProgrammingEventMaskAttributeCallbackSubscriptionBridge @@ -4260,7 +4260,7 @@ class CHIPDoorLockRemoteProgrammingEventMaskAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockRemoteProgrammingEventMaskAttributeCallbackSubscriptionBridge @@ -4288,7 +4288,7 @@ class CHIPDoorLockRFIDProgrammingEventMaskAttributeCallbackBridge CHIPActionBlock action, bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPDoorLockRFIDProgrammingEventMaskAttributeCallbackSubscriptionBridge @@ -7407,7 +7407,7 @@ class CHIPPumpConfigurationAndControlPumpStatusAttributeCallbackBridge CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPPumpConfigurationAndControlPumpStatusAttributeCallbackSubscriptionBridge @@ -8093,7 +8093,7 @@ class CHIPTestClusterBitmap8AttributeCallbackBridge : public CHIPCallbackBridge< bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPTestClusterBitmap8AttributeCallbackSubscriptionBridge : public CHIPTestClusterBitmap8AttributeCallbackBridge @@ -8119,7 +8119,7 @@ class CHIPTestClusterBitmap16AttributeCallbackBridge : public CHIPCallbackBridge bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPTestClusterBitmap16AttributeCallbackSubscriptionBridge : public CHIPTestClusterBitmap16AttributeCallbackBridge @@ -8145,7 +8145,7 @@ class CHIPTestClusterBitmap32AttributeCallbackBridge : public CHIPCallbackBridge bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPTestClusterBitmap32AttributeCallbackSubscriptionBridge : public CHIPTestClusterBitmap32AttributeCallbackBridge @@ -8171,7 +8171,7 @@ class CHIPTestClusterBitmap64AttributeCallbackBridge : public CHIPCallbackBridge bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPTestClusterBitmap64AttributeCallbackSubscriptionBridge : public CHIPTestClusterBitmap64AttributeCallbackBridge @@ -8402,7 +8402,7 @@ class CHIPTestClusterNullableBitmap8AttributeCallbackBridge : public CHIPCallbac static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); }; class CHIPTestClusterNullableBitmap8AttributeCallbackSubscriptionBridge @@ -8432,7 +8432,7 @@ class CHIPTestClusterNullableBitmap16AttributeCallbackBridge static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); }; class CHIPTestClusterNullableBitmap16AttributeCallbackSubscriptionBridge @@ -8462,7 +8462,7 @@ class CHIPTestClusterNullableBitmap32AttributeCallbackBridge static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); }; class CHIPTestClusterNullableBitmap32AttributeCallbackSubscriptionBridge @@ -8492,7 +8492,7 @@ class CHIPTestClusterNullableBitmap64AttributeCallbackBridge static void OnSuccessFn(void * context, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); }; class CHIPTestClusterNullableBitmap64AttributeCallbackSubscriptionBridge @@ -9540,7 +9540,7 @@ class CHIPWindowCoveringConfigStatusAttributeCallbackBridge : public CHIPCallbac bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPWindowCoveringConfigStatusAttributeCallbackSubscriptionBridge @@ -9567,7 +9567,7 @@ class CHIPWindowCoveringModeAttributeCallbackBridge : public CHIPCallbackBridge< bool keepAlive = false) : CHIPCallbackBridge(queue, handler, action, OnSuccessFn, keepAlive){}; - static void OnSuccessFn(void * context, chip::BitFlags value); + static void OnSuccessFn(void * context, chip::BitMask value); }; class CHIPWindowCoveringModeAttributeCallbackSubscriptionBridge : public CHIPWindowCoveringModeAttributeCallbackBridge 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 6af0e3613dfe1d..120c422f9ea6ca 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 @@ -14889,9 +14889,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value) namespace CredentialRulesSupport { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -14903,9 +14903,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15136,9 +15136,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlOp namespace SupportedOperatingModes { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15150,9 +15150,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15167,9 +15167,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15181,9 +15181,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15322,9 +15322,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) namespace LocalProgrammingFeatures { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15336,9 +15336,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15508,9 +15508,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15522,9 +15522,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15539,9 +15539,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15553,9 +15553,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15570,9 +15570,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15584,9 +15584,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15601,9 +15601,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15615,9 +15615,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15632,9 +15632,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15646,9 +15646,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15663,9 +15663,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15677,9 +15677,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15694,9 +15694,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15708,9 +15708,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -15725,9 +15725,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::DoorLock::Id, Id, readable, sizeof(temp)); @@ -15739,9 +15739,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -16085,9 +16085,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace ConfigStatus { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); @@ -16099,9 +16099,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -16620,9 +16620,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value) namespace Mode { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = emberAfReadServerAttribute(endpoint, Clusters::WindowCovering::Id, Id, readable, sizeof(temp)); @@ -16634,9 +16634,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -17856,9 +17856,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace PumpStatus { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); EmberAfStatus status = @@ -17871,9 +17871,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -33650,9 +33650,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value) namespace Bitmap8 { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * 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)); @@ -33664,9 +33664,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -33681,9 +33681,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * 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)); @@ -33695,9 +33695,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -33712,9 +33712,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * 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)); @@ -33726,9 +33726,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -33743,9 +33743,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags * value) +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * 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)); @@ -33757,9 +33757,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -34940,9 +34940,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace NullableBitmap8 { EmberAfStatus Get(chip::EndpointId endpoint, - DataModel::Nullable> & value) + 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)); @@ -34957,9 +34957,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -34972,7 +34972,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags>; + using Traits = NumericAttributeTraits>; Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); @@ -34980,7 +34980,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) } EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable> & value) + const chip::app::DataModel::Nullable> & value) { if (value.IsNull()) { @@ -34995,9 +34995,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, namespace NullableBitmap16 { EmberAfStatus Get(chip::EndpointId endpoint, - DataModel::Nullable> & value) + 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)); @@ -35012,9 +35012,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -35027,7 +35027,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags>; + using Traits = NumericAttributeTraits>; Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); @@ -35035,7 +35035,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) } EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable> & value) + const chip::app::DataModel::Nullable> & value) { if (value.IsNull()) { @@ -35050,9 +35050,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, namespace NullableBitmap32 { EmberAfStatus Get(chip::EndpointId endpoint, - DataModel::Nullable> & value) + 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)); @@ -35067,9 +35067,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -35082,7 +35082,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags>; + using Traits = NumericAttributeTraits>; Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); @@ -35090,7 +35090,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) } EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable> & value) + const chip::app::DataModel::Nullable> & value) { if (value.IsNull()) { @@ -35105,9 +35105,9 @@ EmberAfStatus Set(chip::EndpointId endpoint, namespace NullableBitmap64 { EmberAfStatus Get(chip::EndpointId endpoint, - DataModel::Nullable> & value) + 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)); @@ -35122,9 +35122,9 @@ EmberAfStatus Get(chip::EndpointId endpoint, } return status; } -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value) +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value) { - using Traits = NumericAttributeTraits>; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ true, value)) { return EMBER_ZCL_STATUS_CONSTRAINT_ERROR; @@ -35137,7 +35137,7 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags>; + using Traits = NumericAttributeTraits>; Traits::StorageType value; Traits::SetNull(value); uint8_t * writable = Traits::ToAttributeStoreRepresentation(value); @@ -35145,7 +35145,7 @@ EmberAfStatus SetNull(chip::EndpointId endpoint) } EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable> & value) + 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 7c9b06e3ac06d7..e4a6c403850bb4 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 @@ -2634,8 +2634,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint8_t value); namespace CredentialRulesSupport { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlCredentialRuleMask -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlCredentialRuleMask +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace CredentialRulesSupport namespace NumberOfCredentialsSupportedPerUser { @@ -2675,15 +2675,15 @@ EmberAfStatus Set(chip::EndpointId endpoint, chip::app::Clusters::DoorLock::DlOp namespace SupportedOperatingModes { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlSupportedOperatingModes -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlSupportedOperatingModes +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace SupportedOperatingModes namespace DefaultConfigurationRegister { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlDefaultConfigurationRegister -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlDefaultConfigurationRegister +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace DefaultConfigurationRegister namespace EnableLocalProgramming { @@ -2708,8 +2708,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); namespace LocalProgrammingFeatures { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlLocalProgrammingFeatures -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlLocalProgrammingFeatures +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace LocalProgrammingFeatures namespace WrongCodeEntryLimit { @@ -2738,51 +2738,51 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace ExpiringUserTimeout namespace AlarmMask { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value); // DlAlarmMask -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value); // DlAlarmMask +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace AlarmMask namespace KeypadOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlKeypadOperationEventMask -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlKeypadOperationEventMask +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace KeypadOperationEventMask namespace RemoteOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlRemoteOperationEventMask -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlRemoteOperationEventMask +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace RemoteOperationEventMask namespace ManualOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlManualOperationEventMask -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlManualOperationEventMask +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace ManualOperationEventMask namespace RFIDOperationEventMask { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlRFIDOperationEventMask -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlRFIDOperationEventMask +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace RFIDOperationEventMask namespace KeypadProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlKeypadOperationEventMask -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlKeypadOperationEventMask +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace KeypadProgrammingEventMask namespace RemoteProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlRemoteProgrammingEventMask -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlRemoteProgrammingEventMask +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace RemoteProgrammingEventMask namespace RFIDProgrammingEventMask { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // DlRFIDProgrammingEventMask -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // DlRFIDProgrammingEventMask +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace RFIDProgrammingEventMask namespace FeatureMap { @@ -2842,8 +2842,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); namespace ConfigStatus { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // ConfigStatus -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // ConfigStatus +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace ConfigStatus namespace CurrentPositionLiftPercentage { @@ -2919,8 +2919,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, uint16_t value); } // namespace InstalledClosedLimitTilt namespace Mode { -EmberAfStatus Get(chip::EndpointId endpoint, chip::BitFlags * value); // Mode -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); +EmberAfStatus Get(chip::EndpointId endpoint, chip::BitMask * value); // Mode +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace Mode namespace SafetyStatus { @@ -3103,8 +3103,8 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace PumpStatus { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // PumpStatus -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // PumpStatus +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace PumpStatus namespace EffectiveOperationMode { @@ -5805,26 +5805,26 @@ EmberAfStatus Set(chip::EndpointId endpoint, bool value); namespace Bitmap8 { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // Bitmap8MaskMap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // Bitmap8MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace Bitmap8 namespace Bitmap16 { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // Bitmap16MaskMap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // Bitmap16MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace Bitmap16 namespace Bitmap32 { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // Bitmap32MaskMap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // Bitmap32MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace Bitmap32 namespace Bitmap64 { EmberAfStatus Get(chip::EndpointId endpoint, - chip::BitFlags * value); // Bitmap64MaskMap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + chip::BitMask * value); // Bitmap64MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); } // namespace Bitmap64 namespace Int8u { @@ -6016,41 +6016,38 @@ EmberAfStatus Set(chip::EndpointId endpoint, const chip::app::DataModel::Nullabl namespace NullableBitmap8 { EmberAfStatus Get(chip::EndpointId endpoint, - DataModel::Nullable> & value); // Bitmap8MaskMap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); + DataModel::Nullable> & value); // Bitmap8MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); EmberAfStatus SetNull(chip::EndpointId endpoint); EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); } // namespace NullableBitmap8 namespace NullableBitmap16 { -EmberAfStatus -Get(chip::EndpointId endpoint, - DataModel::Nullable> & value); // Bitmap16MaskMap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable> & value); // Bitmap16MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); EmberAfStatus SetNull(chip::EndpointId endpoint); EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); } // namespace NullableBitmap16 namespace NullableBitmap32 { -EmberAfStatus -Get(chip::EndpointId endpoint, - DataModel::Nullable> & value); // Bitmap32MaskMap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable> & value); // Bitmap32MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); EmberAfStatus SetNull(chip::EndpointId endpoint); EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); } // namespace NullableBitmap32 namespace NullableBitmap64 { -EmberAfStatus -Get(chip::EndpointId endpoint, - DataModel::Nullable> & value); // Bitmap64MaskMap -EmberAfStatus Set(chip::EndpointId endpoint, chip::BitFlags value); +EmberAfStatus Get(chip::EndpointId endpoint, + DataModel::Nullable> & value); // Bitmap64MaskMap +EmberAfStatus Set(chip::EndpointId endpoint, chip::BitMask value); EmberAfStatus SetNull(chip::EndpointId endpoint); EmberAfStatus Set(chip::EndpointId endpoint, - const chip::app::DataModel::Nullable> & value); + const chip::app::DataModel::Nullable> & value); } // namespace NullableBitmap64 namespace NullableInt8u { 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 4a617a39efb024..68e6761559abaa 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 @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include namespace chip { @@ -2613,11 +2613,11 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::CopyScene::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } - chip::BitFlags mode = static_cast>(0); - chip::GroupId groupIdFrom = static_cast(0); - uint8_t sceneIdFrom = static_cast(0); - chip::GroupId groupIdTo = static_cast(0); - uint8_t sceneIdTo = static_cast(0); + chip::BitMask mode = static_cast>(0); + chip::GroupId groupIdFrom = static_cast(0); + uint8_t sceneIdFrom = static_cast(0); + chip::GroupId groupIdTo = static_cast(0); + uint8_t sceneIdTo = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -2632,11 +2632,11 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::CopyScene::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Scenes::Id; } - chip::BitFlags mode = static_cast>(0); - chip::GroupId groupIdFrom = static_cast(0); - uint8_t sceneIdFrom = static_cast(0); - chip::GroupId groupIdTo = static_cast(0); - uint8_t sceneIdTo = static_cast(0); + chip::BitMask mode = static_cast>(0); + chip::GroupId groupIdFrom = static_cast(0); + uint8_t sceneIdFrom = static_cast(0); + chip::GroupId groupIdTo = static_cast(0); + uint8_t sceneIdTo = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace CopyScene @@ -3038,9 +3038,9 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::OnWithTimedOff::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } - chip::BitFlags onOffControl = static_cast>(0); - uint16_t onTime = static_cast(0); - uint16_t offWaitTime = static_cast(0); + chip::BitMask onOffControl = static_cast>(0); + uint16_t onTime = static_cast(0); + uint16_t offWaitTime = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -3055,9 +3055,9 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::OnWithTimedOff::Id; } static constexpr ClusterId GetClusterId() { return Clusters::OnOff::Id; } - chip::BitFlags onOffControl = static_cast>(0); - uint16_t onTime = static_cast(0); - uint16_t offWaitTime = static_cast(0); + chip::BitMask onOffControl = static_cast>(0); + uint16_t onTime = static_cast(0); + uint16_t offWaitTime = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace OnWithTimedOff @@ -5860,8 +5860,8 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } ApplianceStatus applianceStatus = static_cast(0); - chip::BitFlags remoteEnableFlagsAndDeviceStatus2 = - static_cast>(0); + chip::BitMask remoteEnableFlagsAndDeviceStatus2 = + static_cast>(0); ApplianceStatus applianceStatus2 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -5878,8 +5878,8 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } ApplianceStatus applianceStatus = static_cast(0); - chip::BitFlags remoteEnableFlagsAndDeviceStatus2 = - static_cast>(0); + chip::BitMask remoteEnableFlagsAndDeviceStatus2 = + static_cast>(0); ApplianceStatus applianceStatus2 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -5928,8 +5928,8 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } ApplianceStatus applianceStatus = static_cast(0); - chip::BitFlags remoteEnableFlagsAndDeviceStatus2 = - static_cast>(0); + chip::BitMask remoteEnableFlagsAndDeviceStatus2 = + static_cast>(0); ApplianceStatus applianceStatus2 = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -5946,8 +5946,8 @@ struct DecodableType static constexpr ClusterId GetClusterId() { return Clusters::ApplianceControl::Id; } ApplianceStatus applianceStatus = static_cast(0); - chip::BitFlags remoteEnableFlagsAndDeviceStatus2 = - static_cast>(0); + chip::BitMask remoteEnableFlagsAndDeviceStatus2 = + static_cast>(0); ApplianceStatus applianceStatus2 = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -10789,7 +10789,7 @@ enum class Fields struct Type { public: - chip::BitFlags security = static_cast>(0); + chip::BitMask security = static_cast>(0); chip::ByteSpan ssid; chip::ByteSpan bssid; uint16_t channel = static_cast(0); @@ -18112,13 +18112,13 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::SetWeekDaySchedule::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } - uint8_t weekDayIndex = static_cast(0); - uint16_t userIndex = static_cast(0); - chip::BitFlags daysMask = static_cast>(0); - uint8_t startHour = static_cast(0); - uint8_t startMinute = static_cast(0); - uint8_t endHour = static_cast(0); - uint8_t endMinute = static_cast(0); + uint8_t weekDayIndex = static_cast(0); + uint16_t userIndex = static_cast(0); + chip::BitMask daysMask = static_cast>(0); + uint8_t startHour = static_cast(0); + uint8_t startMinute = static_cast(0); + uint8_t endHour = static_cast(0); + uint8_t endMinute = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -18133,13 +18133,13 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::SetWeekDaySchedule::Id; } static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } - uint8_t weekDayIndex = static_cast(0); - uint16_t userIndex = static_cast(0); - chip::BitFlags daysMask = static_cast>(0); - uint8_t startHour = static_cast(0); - uint8_t startMinute = static_cast(0); - uint8_t endHour = static_cast(0); - uint8_t endMinute = static_cast(0); + uint8_t weekDayIndex = static_cast(0); + uint16_t userIndex = static_cast(0); + chip::BitMask daysMask = static_cast>(0); + uint8_t startHour = static_cast(0); + uint8_t startMinute = static_cast(0); + uint8_t endHour = static_cast(0); + uint8_t endMinute = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SetWeekDaySchedule @@ -18201,7 +18201,7 @@ struct Type uint8_t weekDayIndex = static_cast(0); uint16_t userIndex = static_cast(0); DlStatus status = static_cast(0); - Optional> daysMask; + Optional> daysMask; Optional startHour; Optional startMinute; Optional endHour; @@ -18223,7 +18223,7 @@ struct DecodableType uint8_t weekDayIndex = static_cast(0); uint16_t userIndex = static_cast(0); DlStatus status = static_cast(0); - Optional> daysMask; + Optional> daysMask; Optional startHour; Optional startMinute; Optional endHour; @@ -19535,9 +19535,9 @@ struct TypeInfo namespace CredentialRulesSupport { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::CredentialRulesSupport::Id; } @@ -19632,9 +19632,9 @@ struct TypeInfo namespace SupportedOperatingModes { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::SupportedOperatingModes::Id; } @@ -19644,9 +19644,9 @@ struct TypeInfo namespace DefaultConfigurationRegister { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::DefaultConfigurationRegister::Id; } @@ -19704,9 +19704,9 @@ struct TypeInfo namespace LocalProgrammingFeatures { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::LocalProgrammingFeatures::Id; } @@ -19776,9 +19776,9 @@ struct TypeInfo namespace AlarmMask { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::AlarmMask::Id; } @@ -19788,9 +19788,9 @@ struct TypeInfo namespace KeypadOperationEventMask { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::KeypadOperationEventMask::Id; } @@ -19800,9 +19800,9 @@ struct TypeInfo namespace RemoteOperationEventMask { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::RemoteOperationEventMask::Id; } @@ -19812,9 +19812,9 @@ struct TypeInfo namespace ManualOperationEventMask { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ManualOperationEventMask::Id; } @@ -19824,9 +19824,9 @@ struct TypeInfo namespace RFIDOperationEventMask { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::RFIDOperationEventMask::Id; } @@ -19836,9 +19836,9 @@ struct TypeInfo namespace KeypadProgrammingEventMask { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::KeypadProgrammingEventMask::Id; } @@ -19848,9 +19848,9 @@ struct TypeInfo namespace RemoteProgrammingEventMask { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::RemoteProgrammingEventMask::Id; } @@ -19860,9 +19860,9 @@ struct TypeInfo namespace RFIDProgrammingEventMask { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::DoorLock::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::RFIDProgrammingEventMask::Id; } @@ -19960,7 +19960,7 @@ struct TypeInfo Attributes::MaxRFIDCodeLength::TypeInfo::DecodableType maxRFIDCodeLength = static_cast(0); Attributes::MinRFIDCodeLength::TypeInfo::DecodableType minRFIDCodeLength = static_cast(0); Attributes::CredentialRulesSupport::TypeInfo::DecodableType credentialRulesSupport = - static_cast>(0); + static_cast>(0); Attributes::NumberOfCredentialsSupportedPerUser::TypeInfo::DecodableType numberOfCredentialsSupportedPerUser = static_cast(0); Attributes::EnableLogging::TypeInfo::DecodableType enableLogging = static_cast(0); @@ -19971,36 +19971,36 @@ struct TypeInfo Attributes::OperatingMode::TypeInfo::DecodableType operatingMode = static_cast(0); Attributes::SupportedOperatingModes::TypeInfo::DecodableType supportedOperatingModes = - static_cast>(0); + static_cast>(0); Attributes::DefaultConfigurationRegister::TypeInfo::DecodableType defaultConfigurationRegister = - static_cast>(0); + static_cast>(0); Attributes::EnableLocalProgramming::TypeInfo::DecodableType enableLocalProgramming = static_cast(0); Attributes::EnableOneTouchLocking::TypeInfo::DecodableType enableOneTouchLocking = static_cast(0); Attributes::EnableInsideStatusLED::TypeInfo::DecodableType enableInsideStatusLED = static_cast(0); Attributes::EnablePrivacyModeButton::TypeInfo::DecodableType enablePrivacyModeButton = static_cast(0); Attributes::LocalProgrammingFeatures::TypeInfo::DecodableType localProgrammingFeatures = - static_cast>(0); + static_cast>(0); Attributes::WrongCodeEntryLimit::TypeInfo::DecodableType wrongCodeEntryLimit = static_cast(0); Attributes::UserCodeTemporaryDisableTime::TypeInfo::DecodableType userCodeTemporaryDisableTime = static_cast(0); Attributes::SendPINOverTheAir::TypeInfo::DecodableType sendPINOverTheAir = static_cast(0); Attributes::RequirePINforRemoteOperation::TypeInfo::DecodableType requirePINforRemoteOperation = static_cast(0); Attributes::ExpiringUserTimeout::TypeInfo::DecodableType expiringUserTimeout = static_cast(0); Attributes::AlarmMask::TypeInfo::DecodableType alarmMask = - static_cast>(0); + static_cast>(0); Attributes::KeypadOperationEventMask::TypeInfo::DecodableType keypadOperationEventMask = - static_cast>(0); + static_cast>(0); Attributes::RemoteOperationEventMask::TypeInfo::DecodableType remoteOperationEventMask = - static_cast>(0); + static_cast>(0); Attributes::ManualOperationEventMask::TypeInfo::DecodableType manualOperationEventMask = - static_cast>(0); + static_cast>(0); Attributes::RFIDOperationEventMask::TypeInfo::DecodableType RFIDOperationEventMask = - static_cast>(0); + static_cast>(0); Attributes::KeypadProgrammingEventMask::TypeInfo::DecodableType keypadProgrammingEventMask = - static_cast>(0); + static_cast>(0); Attributes::RemoteProgrammingEventMask::TypeInfo::DecodableType remoteProgrammingEventMask = - static_cast>(0); + static_cast>(0); Attributes::RFIDProgrammingEventMask::TypeInfo::DecodableType RFIDProgrammingEventMask = - static_cast>(0); + static_cast>(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::AttributeList::TypeInfo::DecodableType attributeList; @@ -20574,9 +20574,9 @@ struct TypeInfo namespace ConfigStatus { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ConfigStatus::Id; } @@ -20730,9 +20730,9 @@ struct TypeInfo namespace Mode { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::WindowCovering::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Mode::Id; } @@ -20828,7 +20828,7 @@ struct TypeInfo Attributes::NumberOfActuationsLift::TypeInfo::DecodableType numberOfActuationsLift = static_cast(0); Attributes::NumberOfActuationsTilt::TypeInfo::DecodableType numberOfActuationsTilt = static_cast(0); Attributes::ConfigStatus::TypeInfo::DecodableType configStatus = - static_cast>(0); + static_cast>(0); Attributes::CurrentPositionLiftPercentage::TypeInfo::DecodableType currentPositionLiftPercentage; Attributes::CurrentPositionTiltPercentage::TypeInfo::DecodableType currentPositionTiltPercentage; Attributes::OperationalStatus::TypeInfo::DecodableType operationalStatus = static_cast(0); @@ -20842,7 +20842,7 @@ struct TypeInfo Attributes::InstalledClosedLimitLift::TypeInfo::DecodableType installedClosedLimitLift = static_cast(0); Attributes::InstalledOpenLimitTilt::TypeInfo::DecodableType installedOpenLimitTilt = static_cast(0); Attributes::InstalledClosedLimitTilt::TypeInfo::DecodableType installedClosedLimitTilt = static_cast(0); - Attributes::Mode::TypeInfo::DecodableType mode = static_cast>(0); + Attributes::Mode::TypeInfo::DecodableType mode = static_cast>(0); Attributes::SafetyStatus::TypeInfo::DecodableType safetyStatus = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; @@ -21306,9 +21306,9 @@ struct TypeInfo namespace PumpStatus { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::PumpConfigurationAndControl::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::PumpStatus::Id; } @@ -21506,7 +21506,7 @@ struct TypeInfo Attributes::MinConstTemp::TypeInfo::DecodableType minConstTemp; Attributes::MaxConstTemp::TypeInfo::DecodableType maxConstTemp; Attributes::PumpStatus::TypeInfo::DecodableType pumpStatus = - static_cast>(0); + static_cast>(0); Attributes::EffectiveOperationMode::TypeInfo::DecodableType effectiveOperationMode = static_cast(0); Attributes::EffectiveControlMode::TypeInfo::DecodableType effectiveControlMode = @@ -22118,9 +22118,9 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::GetWeeklyScheduleResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - uint8_t numberOfTransitionsForSequence = static_cast(0); - chip::BitFlags dayOfWeekForSequence = static_cast>(0); - chip::BitFlags modeForSequence = static_cast>(0); + uint8_t numberOfTransitionsForSequence = static_cast(0); + chip::BitMask dayOfWeekForSequence = static_cast>(0); + chip::BitMask modeForSequence = static_cast>(0); DataModel::List transitions; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -22136,9 +22136,9 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::GetWeeklyScheduleResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - uint8_t numberOfTransitionsForSequence = static_cast(0); - chip::BitFlags dayOfWeekForSequence = static_cast>(0); - chip::BitFlags modeForSequence = static_cast>(0); + uint8_t numberOfTransitionsForSequence = static_cast(0); + chip::BitMask dayOfWeekForSequence = static_cast>(0); + chip::BitMask modeForSequence = static_cast>(0); DataModel::DecodableList transitions; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -22159,9 +22159,9 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::SetWeeklySchedule::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - uint8_t numberOfTransitionsForSequence = static_cast(0); - chip::BitFlags dayOfWeekForSequence = static_cast>(0); - chip::BitFlags modeForSequence = static_cast>(0); + uint8_t numberOfTransitionsForSequence = static_cast(0); + chip::BitMask dayOfWeekForSequence = static_cast>(0); + chip::BitMask modeForSequence = static_cast>(0); DataModel::List transitions; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -22177,9 +22177,9 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::SetWeeklySchedule::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - uint8_t numberOfTransitionsForSequence = static_cast(0); - chip::BitFlags dayOfWeekForSequence = static_cast>(0); - chip::BitFlags modeForSequence = static_cast>(0); + uint8_t numberOfTransitionsForSequence = static_cast(0); + chip::BitMask dayOfWeekForSequence = static_cast>(0); + chip::BitMask modeForSequence = static_cast>(0); DataModel::DecodableList transitions; CHIP_ERROR Decode(TLV::TLVReader & reader); }; @@ -22198,8 +22198,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::GetWeeklySchedule::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - chip::BitFlags daysToReturn = static_cast>(0); - chip::BitFlags modeToReturn = static_cast>(0); + chip::BitMask daysToReturn = static_cast>(0); + chip::BitMask modeToReturn = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -22214,8 +22214,8 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::GetWeeklySchedule::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - chip::BitFlags daysToReturn = static_cast>(0); - chip::BitFlags modeToReturn = static_cast>(0); + chip::BitMask daysToReturn = static_cast>(0); + chip::BitMask modeToReturn = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GetWeeklySchedule @@ -24265,13 +24265,13 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::ColorLoopSet::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - chip::BitFlags updateFlags = static_cast>(0); - ColorLoopAction action = static_cast(0); - ColorLoopDirection direction = static_cast(0); - uint16_t time = static_cast(0); - uint16_t startHue = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask updateFlags = static_cast>(0); + ColorLoopAction action = static_cast(0); + ColorLoopDirection direction = static_cast(0); + uint16_t time = static_cast(0); + uint16_t startHue = static_cast(0); + uint8_t optionsMask = static_cast(0); + uint8_t optionsOverride = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -24286,13 +24286,13 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::ColorLoopSet::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ColorControl::Id; } - chip::BitFlags updateFlags = static_cast>(0); - ColorLoopAction action = static_cast(0); - ColorLoopDirection direction = static_cast(0); - uint16_t time = static_cast(0); - uint16_t startHue = static_cast(0); - uint8_t optionsMask = static_cast(0); - uint8_t optionsOverride = static_cast(0); + chip::BitMask updateFlags = static_cast>(0); + ColorLoopAction action = static_cast(0); + ColorLoopDirection direction = static_cast(0); + uint16_t time = static_cast(0); + uint16_t startHue = static_cast(0); + uint8_t optionsMask = static_cast(0); + uint8_t optionsOverride = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ColorLoopSet @@ -30587,10 +30587,10 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::ZoneStatusChangeNotification::Id; } static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } - chip::BitFlags zoneStatus = static_cast>(0); - uint8_t extendedStatus = static_cast(0); - uint8_t zoneId = static_cast(0); - uint16_t delay = static_cast(0); + chip::BitMask zoneStatus = static_cast>(0); + uint8_t extendedStatus = static_cast(0); + uint8_t zoneId = static_cast(0); + uint16_t delay = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -30605,10 +30605,10 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::ZoneStatusChangeNotification::Id; } static constexpr ClusterId GetClusterId() { return Clusters::IasZone::Id; } - chip::BitFlags zoneStatus = static_cast>(0); - uint8_t extendedStatus = static_cast(0); - uint8_t zoneId = static_cast(0); - uint16_t delay = static_cast(0); + chip::BitMask zoneStatus = static_cast>(0); + uint8_t extendedStatus = static_cast(0); + uint8_t zoneId = static_cast(0); + uint16_t delay = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace ZoneStatusChangeNotification @@ -30952,8 +30952,8 @@ enum class Fields struct Type { public: - uint8_t zoneId = static_cast(0); - chip::BitFlags zoneStatus = static_cast>(0); + uint8_t zoneId = static_cast(0); + chip::BitMask zoneStatus = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -31882,10 +31882,10 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::StartWarning::Id; } static constexpr ClusterId GetClusterId() { return Clusters::IasWd::Id; } - chip::BitFlags warningInfo = static_cast>(0); - uint16_t warningDuration = static_cast(0); - uint8_t strobeDutyCycle = static_cast(0); - uint8_t strobeLevel = static_cast(0); + chip::BitMask warningInfo = static_cast>(0); + uint16_t warningDuration = static_cast(0); + uint8_t strobeDutyCycle = static_cast(0); + uint8_t strobeLevel = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -31900,10 +31900,10 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::StartWarning::Id; } static constexpr ClusterId GetClusterId() { return Clusters::IasWd::Id; } - chip::BitFlags warningInfo = static_cast>(0); - uint16_t warningDuration = static_cast(0); - uint8_t strobeDutyCycle = static_cast(0); - uint8_t strobeLevel = static_cast(0); + chip::BitMask warningInfo = static_cast>(0); + uint16_t warningDuration = static_cast(0); + uint8_t strobeDutyCycle = static_cast(0); + uint8_t strobeLevel = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace StartWarning @@ -31920,7 +31920,7 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::Squawk::Id; } static constexpr ClusterId GetClusterId() { return Clusters::IasWd::Id; } - chip::BitFlags squawkInfo = static_cast>(0); + chip::BitMask squawkInfo = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -31935,7 +31935,7 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::Squawk::Id; } static constexpr ClusterId GetClusterId() { return Clusters::IasWd::Id; } - chip::BitFlags squawkInfo = static_cast>(0); + chip::BitMask squawkInfo = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace Squawk @@ -35321,9 +35321,9 @@ struct Type SimpleEnum c = static_cast(0); chip::ByteSpan d; chip::CharSpan e; - chip::BitFlags f = static_cast>(0); - float g = static_cast(0); - double h = static_cast(0); + chip::BitMask f = static_cast>(0); + float g = static_cast(0); + double h = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -37008,9 +37008,9 @@ struct TypeInfo namespace Bitmap8 { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Bitmap8::Id; } @@ -37020,9 +37020,9 @@ struct TypeInfo namespace Bitmap16 { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Bitmap16::Id; } @@ -37032,9 +37032,9 @@ struct TypeInfo namespace Bitmap32 { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Bitmap32::Id; } @@ -37044,9 +37044,9 @@ struct TypeInfo namespace Bitmap64 { struct TypeInfo { - using Type = chip::BitFlags; - using DecodableType = chip::BitFlags; - using DecodableArgType = chip::BitFlags; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Bitmap64::Id; } @@ -37594,10 +37594,10 @@ struct TypeInfo namespace NullableBitmap8 { struct TypeInfo { - using Type = chip::app::DataModel::Nullable>; - using DecodableType = chip::app::DataModel::Nullable>; + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; using DecodableArgType = - const chip::app::DataModel::Nullable> &; + const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap8::Id; } @@ -37607,10 +37607,10 @@ struct TypeInfo namespace NullableBitmap16 { struct TypeInfo { - using Type = chip::app::DataModel::Nullable>; - using DecodableType = chip::app::DataModel::Nullable>; + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; using DecodableArgType = - const chip::app::DataModel::Nullable> &; + const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap16::Id; } @@ -37620,10 +37620,10 @@ struct TypeInfo namespace NullableBitmap32 { struct TypeInfo { - using Type = chip::app::DataModel::Nullable>; - using DecodableType = chip::app::DataModel::Nullable>; + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; using DecodableArgType = - const chip::app::DataModel::Nullable> &; + const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap32::Id; } @@ -37633,10 +37633,10 @@ struct TypeInfo namespace NullableBitmap64 { struct TypeInfo { - using Type = chip::app::DataModel::Nullable>; - using DecodableType = chip::app::DataModel::Nullable>; + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; using DecodableArgType = - const chip::app::DataModel::Nullable> &; + const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::TestCluster::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::NullableBitmap64::Id; } @@ -38053,13 +38053,13 @@ struct TypeInfo Attributes::Boolean::TypeInfo::DecodableType boolean = static_cast(0); Attributes::Bitmap8::TypeInfo::DecodableType bitmap8 = - static_cast>(0); + static_cast>(0); Attributes::Bitmap16::TypeInfo::DecodableType bitmap16 = - static_cast>(0); + static_cast>(0); Attributes::Bitmap32::TypeInfo::DecodableType bitmap32 = - static_cast>(0); + static_cast>(0); Attributes::Bitmap64::TypeInfo::DecodableType bitmap64 = - static_cast>(0); + 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); @@ -38291,13 +38291,13 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::DisplayMessage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - uint32_t messageId = static_cast(0); - chip::BitFlags messageControl = static_cast>(0); - uint32_t startTime = static_cast(0); - uint16_t durationInMinutes = static_cast(0); + uint32_t messageId = static_cast(0); + chip::BitMask messageControl = static_cast>(0); + uint32_t startTime = static_cast(0); + uint16_t durationInMinutes = static_cast(0); chip::CharSpan message; - chip::BitFlags optionalExtendedMessageControl = - static_cast>(0); + chip::BitMask optionalExtendedMessageControl = + static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -38312,13 +38312,13 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::DisplayMessage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - uint32_t messageId = static_cast(0); - chip::BitFlags messageControl = static_cast>(0); - uint32_t startTime = static_cast(0); - uint16_t durationInMinutes = static_cast(0); + uint32_t messageId = static_cast(0); + chip::BitMask messageControl = static_cast>(0); + uint32_t startTime = static_cast(0); + uint16_t durationInMinutes = static_cast(0); chip::CharSpan message; - chip::BitFlags optionalExtendedMessageControl = - static_cast>(0); + chip::BitMask optionalExtendedMessageControl = + static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace DisplayMessage @@ -38364,8 +38364,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::CancelMessage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - uint32_t messageId = static_cast(0); - chip::BitFlags messageControl = static_cast>(0); + uint32_t messageId = static_cast(0); + chip::BitMask messageControl = static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -38380,8 +38380,8 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::CancelMessage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - uint32_t messageId = static_cast(0); - chip::BitFlags messageControl = static_cast>(0); + uint32_t messageId = static_cast(0); + chip::BitMask messageControl = static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace CancelMessage @@ -38444,13 +38444,13 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::DisplayProtectedMessage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - uint32_t messageId = static_cast(0); - chip::BitFlags messageControl = static_cast>(0); - uint32_t startTime = static_cast(0); - uint16_t durationInMinutes = static_cast(0); + uint32_t messageId = static_cast(0); + chip::BitMask messageControl = static_cast>(0); + uint32_t startTime = static_cast(0); + uint16_t durationInMinutes = static_cast(0); chip::CharSpan message; - chip::BitFlags optionalExtendedMessageControl = - static_cast>(0); + chip::BitMask optionalExtendedMessageControl = + static_cast>(0); CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -38465,13 +38465,13 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::DisplayProtectedMessage::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Messaging::Id; } - uint32_t messageId = static_cast(0); - chip::BitFlags messageControl = static_cast>(0); - uint32_t startTime = static_cast(0); - uint16_t durationInMinutes = static_cast(0); + uint32_t messageId = static_cast(0); + chip::BitMask messageControl = static_cast>(0); + uint32_t startTime = static_cast(0); + uint16_t durationInMinutes = static_cast(0); chip::CharSpan message; - chip::BitFlags optionalExtendedMessageControl = - static_cast>(0); + chip::BitMask optionalExtendedMessageControl = + static_cast>(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace DisplayProtectedMessage @@ -39182,8 +39182,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::GetAlertsResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } - chip::BitFlags alertsCount = static_cast>(0); - DataModel::List> alertStructures; + chip::BitMask alertsCount = static_cast>(0); + DataModel::List> alertStructures; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -39198,8 +39198,8 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::GetAlertsResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } - chip::BitFlags alertsCount = static_cast>(0); - DataModel::DecodableList> alertStructures; + chip::BitMask alertsCount = static_cast>(0); + DataModel::DecodableList> alertStructures; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace GetAlertsResponse @@ -39217,8 +39217,8 @@ struct Type static constexpr CommandId GetCommandId() { return Commands::AlertsNotification::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } - chip::BitFlags alertsCount = static_cast>(0); - DataModel::List> alertStructures; + chip::BitMask alertsCount = static_cast>(0); + DataModel::List> alertStructures; CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; @@ -39233,8 +39233,8 @@ struct DecodableType static constexpr CommandId GetCommandId() { return Commands::AlertsNotification::Id; } static constexpr ClusterId GetClusterId() { return Clusters::ApplianceEventsAndAlert::Id; } - chip::BitFlags alertsCount = static_cast>(0); - DataModel::DecodableList> alertStructures; + chip::BitMask alertsCount = static_cast>(0); + DataModel::DecodableList> alertStructures; CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace AlertsNotification diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 9d719306b22768..f3472561e9fedc 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -8803,7 +8803,7 @@ class WriteDoorLockLocalProgrammingFeatures : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteDoorLockWrongCodeEntryLimit : public WriteAttribute @@ -8964,7 +8964,7 @@ class WriteDoorLockAlarmMask : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteDoorLockKeypadOperationEventMask : public WriteAttribute @@ -8991,7 +8991,7 @@ class WriteDoorLockKeypadOperationEventMask : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteDoorLockRemoteOperationEventMask : public WriteAttribute @@ -9018,7 +9018,7 @@ class WriteDoorLockRemoteOperationEventMask : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteDoorLockManualOperationEventMask : public WriteAttribute @@ -9045,7 +9045,7 @@ class WriteDoorLockManualOperationEventMask : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteDoorLockRFIDOperationEventMask : public WriteAttribute @@ -9072,7 +9072,7 @@ class WriteDoorLockRFIDOperationEventMask : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteDoorLockKeypadProgrammingEventMask : public WriteAttribute @@ -9099,7 +9099,7 @@ class WriteDoorLockKeypadProgrammingEventMask : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteDoorLockRemoteProgrammingEventMask : public WriteAttribute @@ -9126,7 +9126,7 @@ class WriteDoorLockRemoteProgrammingEventMask : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteDoorLockRFIDProgrammingEventMask : public WriteAttribute @@ -9153,7 +9153,7 @@ class WriteDoorLockRFIDProgrammingEventMask : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; /*----------------------------------------------------------------------------*\ @@ -9434,7 +9434,7 @@ class WriteWindowCoveringMode : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; /*----------------------------------------------------------------------------*\ @@ -16355,7 +16355,7 @@ class WriteTestClusterBitmap8 : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteTestClusterBitmap16 : public WriteAttribute @@ -16381,7 +16381,7 @@ class WriteTestClusterBitmap16 : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteTestClusterBitmap32 : public WriteAttribute @@ -16407,7 +16407,7 @@ class WriteTestClusterBitmap32 : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteTestClusterBitmap64 : public WriteAttribute @@ -16433,7 +16433,7 @@ class WriteTestClusterBitmap64 : public WriteAttribute } private: - chip::BitFlags mValue; + chip::BitMask mValue; }; class WriteTestClusterInt8u : public WriteAttribute @@ -17632,7 +17632,7 @@ class WriteTestClusterNullableBitmap8 : public WriteAttribute } private: - chip::app::DataModel::Nullable> mValue; + chip::app::DataModel::Nullable> mValue; }; class WriteTestClusterNullableBitmap16 : public WriteAttribute @@ -17659,7 +17659,7 @@ class WriteTestClusterNullableBitmap16 : public WriteAttribute } private: - chip::app::DataModel::Nullable> mValue; + chip::app::DataModel::Nullable> mValue; }; class WriteTestClusterNullableBitmap32 : public WriteAttribute @@ -17686,7 +17686,7 @@ class WriteTestClusterNullableBitmap32 : public WriteAttribute } private: - chip::app::DataModel::Nullable> mValue; + chip::app::DataModel::Nullable> mValue; }; class WriteTestClusterNullableBitmap64 : public WriteAttribute @@ -17713,7 +17713,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 5a606898d7eb3b..03950ff284b8dc 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -5656,7 +5656,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("MinRFIDCodeLength", 1, value); } case DoorLock::Attributes::CredentialRulesSupport::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("CredentialRulesSupport", 1, value); } @@ -5696,12 +5696,12 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("OperatingMode", 1, value); } case DoorLock::Attributes::SupportedOperatingModes::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("SupportedOperatingModes", 1, value); } case DoorLock::Attributes::DefaultConfigurationRegister::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("DefaultConfigurationRegister", 1, value); } @@ -5726,7 +5726,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("EnablePrivacyModeButton", 1, value); } case DoorLock::Attributes::LocalProgrammingFeatures::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("LocalProgrammingFeatures", 1, value); } @@ -5756,42 +5756,42 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("ExpiringUserTimeout", 1, value); } case DoorLock::Attributes::AlarmMask::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("AlarmMask", 1, value); } case DoorLock::Attributes::KeypadOperationEventMask::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("KeypadOperationEventMask", 1, value); } case DoorLock::Attributes::RemoteOperationEventMask::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RemoteOperationEventMask", 1, value); } case DoorLock::Attributes::ManualOperationEventMask::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ManualOperationEventMask", 1, value); } case DoorLock::Attributes::RFIDOperationEventMask::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RFIDOperationEventMask", 1, value); } case DoorLock::Attributes::KeypadProgrammingEventMask::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("KeypadProgrammingEventMask", 1, value); } case DoorLock::Attributes::RemoteProgrammingEventMask::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RemoteProgrammingEventMask", 1, value); } case DoorLock::Attributes::RFIDProgrammingEventMask::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("RFIDProgrammingEventMask", 1, value); } @@ -8210,7 +8210,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("MaxConstTemp", 1, value); } case PumpConfigurationAndControl::Attributes::PumpStatus::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("PumpStatus", 1, value); } @@ -8598,22 +8598,22 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("boolean", 1, value); } case TestCluster::Attributes::Bitmap8::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("bitmap8", 1, value); } case TestCluster::Attributes::Bitmap16::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("bitmap16", 1, value); } case TestCluster::Attributes::Bitmap32::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("bitmap32", 1, value); } case TestCluster::Attributes::Bitmap64::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("bitmap64", 1, value); } @@ -8841,22 +8841,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); } @@ -9992,7 +9992,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("NumberOfActuationsTilt", 1, value); } case WindowCovering::Attributes::ConfigStatus::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ConfigStatus", 1, value); } @@ -10057,7 +10057,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("InstalledClosedLimitTilt", 1, value); } case WindowCovering::Attributes::Mode::Id: { - chip::BitFlags value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Mode", 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 f41c59751146ef..2bc6976f1fb12d 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -10457,7 +10457,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -10480,7 +10480,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(2); + value.updateFlags = static_cast>(2); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -10503,7 +10503,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(4); + value.updateFlags = static_cast>(4); value.action = static_cast(0); value.direction = static_cast(0); value.time = 30U; @@ -10526,7 +10526,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(8); + value.updateFlags = static_cast>(8); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -10549,7 +10549,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(1); value.direction = static_cast(0); value.time = 0U; @@ -10584,7 +10584,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -10619,7 +10619,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(2); + value.updateFlags = static_cast>(2); value.action = static_cast(0); value.direction = static_cast(1); value.time = 0U; @@ -10642,7 +10642,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(1); value.direction = static_cast(0); value.time = 0U; @@ -10677,7 +10677,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -10740,7 +10740,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(2); + value.updateFlags = static_cast>(2); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -10763,7 +10763,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(2); value.direction = static_cast(0); value.time = 0U; @@ -10798,7 +10798,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -10833,7 +10833,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(2); + value.updateFlags = static_cast>(2); value.action = static_cast(0); value.direction = static_cast(1); value.time = 0U; @@ -10856,7 +10856,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(2); value.direction = static_cast(0); value.time = 0U; @@ -10891,7 +10891,7 @@ class Test_TC_CC_9_1Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -11144,7 +11144,7 @@ class Test_TC_CC_9_2Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(15); + value.updateFlags = static_cast>(15); value.action = static_cast(0); value.direction = static_cast(0); value.time = 30U; @@ -11191,7 +11191,7 @@ class Test_TC_CC_9_2Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(1); value.direction = static_cast(0); value.time = 0U; @@ -11220,7 +11220,7 @@ class Test_TC_CC_9_2Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(2); + value.updateFlags = static_cast>(2); value.action = static_cast(0); value.direction = static_cast(1); value.time = 0U; @@ -11243,7 +11243,7 @@ class Test_TC_CC_9_2Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -11496,7 +11496,7 @@ class Test_TC_CC_9_3Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(15); + value.updateFlags = static_cast>(15); value.action = static_cast(0); value.direction = static_cast(0); value.time = 30U; @@ -11537,7 +11537,7 @@ class Test_TC_CC_9_3Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(1); value.direction = static_cast(0); value.time = 0U; @@ -11572,7 +11572,7 @@ class Test_TC_CC_9_3Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(4); + value.updateFlags = static_cast>(4); value.action = static_cast(0); value.direction = static_cast(0); value.time = 60U; @@ -11595,7 +11595,7 @@ class Test_TC_CC_9_3Suite : public TestCommand VerifyOrDo(!ShouldSkip("CR_COLORLOOPSET"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::ColorControl::Commands::ColorLoopSet::Type value; - value.updateFlags = static_cast>(1); + value.updateFlags = static_cast>(1); value.action = static_cast(0); value.direction = static_cast(0); value.time = 0U; @@ -27533,7 +27533,7 @@ class Test_TC_PCC_2_1Suite : public TestCommand } VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "map16")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0U)); @@ -35873,7 +35873,7 @@ class Test_TC_WNCV_2_1Suite : public TestCommand case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "map8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); @@ -35903,7 +35903,7 @@ class Test_TC_WNCV_2_1Suite : public TestCommand case 5: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintType("value", "", "map8")); VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); @@ -36278,8 +36278,8 @@ class Test_TC_WNCV_2_3Suite : public TestCommand chip::Optional mEndpoint; chip::Optional mTimeout; - chip::BitFlags configStatusValA; - chip::BitFlags configStatusValB; + chip::BitMask configStatusValA; + chip::BitMask configStatusValB; chip::EndpointId GetEndpoint(chip::EndpointId endpoint) { return mEndpoint.HasValue() ? mEndpoint.Value() : endpoint; } @@ -36303,7 +36303,7 @@ class Test_TC_WNCV_2_3Suite : public TestCommand case 2: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value", value, 4)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); @@ -36315,7 +36315,7 @@ class Test_TC_WNCV_2_3Suite : public TestCommand case 4: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); @@ -36327,7 +36327,7 @@ class Test_TC_WNCV_2_3Suite : public TestCommand case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); @@ -36343,7 +36343,7 @@ class Test_TC_WNCV_2_3Suite : public TestCommand case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value", value, 1)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); @@ -36352,7 +36352,7 @@ class Test_TC_WNCV_2_3Suite : public TestCommand case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); @@ -36367,7 +36367,7 @@ class Test_TC_WNCV_2_3Suite : public TestCommand case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); @@ -36383,7 +36383,7 @@ class Test_TC_WNCV_2_3Suite : public TestCommand case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value", value, 1)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); @@ -36392,7 +36392,7 @@ class Test_TC_WNCV_2_3Suite : public TestCommand case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintMinValue("value", value, 0)); VerifyOrReturn(CheckConstraintMaxValue("value", value, 127)); @@ -36427,8 +36427,8 @@ class Test_TC_WNCV_2_3Suite : public TestCommand LogStep(1, "1a: TH set the Mode Attribute bit0 of the DUT"); VerifyOrDo(!ShouldSkip("WNCV_REVERSAL"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(1); + chip::BitMask value; + value = static_cast>(1); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, chip::NullOptional, chip::NullOptional); } @@ -36442,8 +36442,8 @@ class Test_TC_WNCV_2_3Suite : public TestCommand LogStep(3, "1c: TH clear the Mode Attribute bit0 of the DUT"); VerifyOrDo(!ShouldSkip("WNCV_REVERSAL"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(0); + chip::BitMask value; + value = static_cast>(0); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, chip::NullOptional, chip::NullOptional); } @@ -36457,8 +36457,8 @@ class Test_TC_WNCV_2_3Suite : public TestCommand LogStep(5, "2a: TH set the Mode Attribute bit1 of the DUT"); VerifyOrDo(!ShouldSkip("WNCV_CALIBRATION"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(2); + chip::BitMask value; + value = static_cast>(2); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, chip::NullOptional, chip::NullOptional); } @@ -36482,8 +36482,8 @@ class Test_TC_WNCV_2_3Suite : public TestCommand LogStep(8, "2d: TH clear the Mode Attribute bit1 of the DUT"); VerifyOrDo(!ShouldSkip("WNCV_CALIBRATION"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(0); + chip::BitMask value; + value = static_cast>(0); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, chip::NullOptional, chip::NullOptional); } @@ -36513,8 +36513,8 @@ class Test_TC_WNCV_2_3Suite : public TestCommand LogStep(12, "3a: TH set the Mode Attribute bit2 of the DUT"); VerifyOrDo(!ShouldSkip("WNCV_MAINTENANCE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(4); + chip::BitMask value; + value = static_cast>(4); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, chip::NullOptional, chip::NullOptional); } @@ -36538,8 +36538,8 @@ class Test_TC_WNCV_2_3Suite : public TestCommand LogStep(15, "3d: TH clear the Mode Attribute bit2 of the DUT"); VerifyOrDo(!ShouldSkip("WNCV_MAINTENANCE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(0); + chip::BitMask value; + value = static_cast>(0); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, chip::NullOptional, chip::NullOptional); } @@ -41516,7 +41516,7 @@ class TestClusterSuite : public TestCommand chip::Optional mTimeout; chip::app::DataModel::Nullable booValueNull; - chip::app::DataModel::Nullable> nullableValue254; + chip::app::DataModel::Nullable> nullableValue254; chip::app::DataModel::Nullable nullableEnumAttr254; uint8_t * nullableOctetStrTestValueBuffer = nullptr; chip::app::DataModel::Nullable nullableOctetStrTestValue; @@ -41597,7 +41597,7 @@ class TestClusterSuite : public TestCommand case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap8", value, 0)); } @@ -41608,7 +41608,7 @@ class TestClusterSuite : public TestCommand case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap8", value, 255)); } @@ -41619,7 +41619,7 @@ class TestClusterSuite : public TestCommand case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap8", value, 0)); } @@ -41627,7 +41627,7 @@ class TestClusterSuite : public TestCommand case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap16", value, 0U)); } @@ -41638,7 +41638,7 @@ class TestClusterSuite : public TestCommand case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap16", value, 65535U)); } @@ -41649,7 +41649,7 @@ class TestClusterSuite : public TestCommand case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap16", value, 0U)); } @@ -41657,7 +41657,7 @@ class TestClusterSuite : public TestCommand case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap32", value, 0UL)); } @@ -41668,7 +41668,7 @@ class TestClusterSuite : public TestCommand case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap32", value, 4294967295UL)); } @@ -41679,7 +41679,7 @@ class TestClusterSuite : public TestCommand case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap32", value, 0UL)); } @@ -41687,7 +41687,7 @@ class TestClusterSuite : public TestCommand case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap64", value, 0ULL)); } @@ -41698,7 +41698,7 @@ class TestClusterSuite : public TestCommand case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap64", value, 18446744073709551615ULL)); } @@ -41709,7 +41709,7 @@ class TestClusterSuite : public TestCommand case 30: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap64", value, 0ULL)); } @@ -42906,7 +42906,7 @@ class TestClusterSuite : public TestCommand case 185: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNonNull("nullableBitmap8", value)); VerifyOrReturn(CheckValue("nullableBitmap8.Value()", value.Value(), 254)); @@ -42918,7 +42918,7 @@ class TestClusterSuite : public TestCommand case 187: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNonNull("nullableBitmap8", value)); VerifyOrReturn(CheckValue("nullableBitmap8.Value()", value.Value(), 254)); @@ -42932,7 +42932,7 @@ class TestClusterSuite : public TestCommand case 189: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNull("nullableBitmap8", value)); } @@ -42940,7 +42940,7 @@ class TestClusterSuite : public TestCommand case 190: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintNotValue("value", value, nullableValue254)); } @@ -42951,7 +42951,7 @@ class TestClusterSuite : public TestCommand case 192: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNonNull("nullableBitmap16", value)); VerifyOrReturn(CheckValue("nullableBitmap16.Value()", value.Value(), 65534U)); @@ -42963,7 +42963,7 @@ class TestClusterSuite : public TestCommand case 194: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNonNull("nullableBitmap16", value)); VerifyOrReturn(CheckValue("nullableBitmap16.Value()", value.Value(), 65534U)); @@ -42975,7 +42975,7 @@ class TestClusterSuite : public TestCommand case 196: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNull("nullableBitmap16", value)); } @@ -42986,7 +42986,7 @@ class TestClusterSuite : public TestCommand case 198: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNonNull("nullableBitmap32", value)); VerifyOrReturn(CheckValue("nullableBitmap32.Value()", value.Value(), 4294967294UL)); @@ -42998,7 +42998,7 @@ class TestClusterSuite : public TestCommand case 200: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNonNull("nullableBitmap32", value)); VerifyOrReturn(CheckValue("nullableBitmap32.Value()", value.Value(), 4294967294UL)); @@ -43010,7 +43010,7 @@ class TestClusterSuite : public TestCommand case 202: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNull("nullableBitmap32", value)); } @@ -43021,7 +43021,7 @@ class TestClusterSuite : public TestCommand case 204: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNonNull("nullableBitmap64", value)); VerifyOrReturn(CheckValue("nullableBitmap64.Value()", value.Value(), 18446744073709551614ULL)); @@ -43033,7 +43033,7 @@ class TestClusterSuite : public TestCommand case 206: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNonNull("nullableBitmap64", value)); VerifyOrReturn(CheckValue("nullableBitmap64.Value()", value.Value(), 18446744073709551614ULL)); @@ -43045,7 +43045,7 @@ class TestClusterSuite : public TestCommand case 208: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValueNull("nullableBitmap64", value)); } @@ -44926,8 +44926,8 @@ class TestClusterSuite : public TestCommand case 12: { LogStep(12, "Write attribute BITMAP8 Max Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(255); + chip::BitMask value; + value = static_cast>(255); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap8::Id, value, chip::NullOptional, chip::NullOptional); } @@ -44939,8 +44939,8 @@ class TestClusterSuite : public TestCommand case 14: { LogStep(14, "Write attribute BITMAP8 Min Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(0); + chip::BitMask value; + value = static_cast>(0); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap8::Id, value, chip::NullOptional, chip::NullOptional); } @@ -44957,8 +44957,8 @@ class TestClusterSuite : public TestCommand case 17: { LogStep(17, "Write attribute BITMAP16 Max Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(65535U); + chip::BitMask value; + value = static_cast>(65535U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap16::Id, value, chip::NullOptional, chip::NullOptional); } @@ -44970,8 +44970,8 @@ class TestClusterSuite : public TestCommand case 19: { LogStep(19, "Write attribute BITMAP16 Min Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(0U); + chip::BitMask value; + value = static_cast>(0U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap16::Id, value, chip::NullOptional, chip::NullOptional); } @@ -44988,8 +44988,8 @@ class TestClusterSuite : public TestCommand case 22: { LogStep(22, "Write attribute BITMAP32 Max Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(4294967295UL); + chip::BitMask value; + value = static_cast>(4294967295UL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap32::Id, value, chip::NullOptional, chip::NullOptional); } @@ -45001,8 +45001,8 @@ class TestClusterSuite : public TestCommand case 24: { LogStep(24, "Write attribute BITMAP32 Min Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(0UL); + chip::BitMask value; + value = static_cast>(0UL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap32::Id, value, chip::NullOptional, chip::NullOptional); } @@ -45019,8 +45019,8 @@ class TestClusterSuite : public TestCommand case 27: { LogStep(27, "Write attribute BITMAP64 Max Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(18446744073709551615ULL); + chip::BitMask value; + value = static_cast>(18446744073709551615ULL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap64::Id, value, chip::NullOptional, chip::NullOptional); } @@ -45032,8 +45032,8 @@ class TestClusterSuite : public TestCommand case 29: { LogStep(29, "Write attribute BITMAP64 Min Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(0ULL); + chip::BitMask value; + value = static_cast>(0ULL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap64::Id, value, chip::NullOptional, chip::NullOptional); } @@ -45891,7 +45891,7 @@ class TestClusterSuite : public TestCommand value.arg1.c = static_cast(2); value.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); value.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - value.arg1.f = static_cast>(1); + value.arg1.f = static_cast>(1); value.arg1.g = 0.0f; value.arg1.h = 0; @@ -45910,7 +45910,7 @@ class TestClusterSuite : public TestCommand value.arg1.c = static_cast(2); value.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); value.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - value.arg1.f = static_cast>(1); + value.arg1.f = static_cast>(1); value.arg1.g = 0.0f; value.arg1.h = 0; @@ -45932,7 +45932,7 @@ class TestClusterSuite : public TestCommand value.arg1.c.c = static_cast(2); value.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); value.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - value.arg1.c.f = static_cast>(1); + value.arg1.c.f = static_cast>(1); value.arg1.c.g = 0.0f; value.arg1.c.h = 0; @@ -45954,7 +45954,7 @@ class TestClusterSuite : public TestCommand value.arg1.c.c = static_cast(2); value.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); value.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - value.arg1.c.f = static_cast>(1); + value.arg1.c.f = static_cast>(1); value.arg1.c.g = 0.0f; value.arg1.c.h = 0; @@ -45976,7 +45976,7 @@ class TestClusterSuite : public TestCommand value.arg1.c.c = static_cast(2); value.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); value.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - value.arg1.c.f = static_cast>(1); + value.arg1.c.f = static_cast>(1); value.arg1.c.g = 0.0f; value.arg1.c.h = 0; @@ -45990,7 +45990,7 @@ class TestClusterSuite : public TestCommand listHolder_1->mList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); listHolder_1->mList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - listHolder_1->mList[0].f = static_cast>(1); + listHolder_1->mList[0].f = static_cast>(1); listHolder_1->mList[0].g = 0.0f; listHolder_1->mList[0].h = 0; @@ -46000,7 +46000,7 @@ class TestClusterSuite : public TestCommand listHolder_1->mList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); listHolder_1->mList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - listHolder_1->mList[1].f = static_cast>(1); + listHolder_1->mList[1].f = static_cast>(1); listHolder_1->mList[1].g = 0.0f; listHolder_1->mList[1].h = 0; @@ -46055,7 +46055,7 @@ class TestClusterSuite : public TestCommand value.arg1.c.c = static_cast(2); value.arg1.c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); value.arg1.c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - value.arg1.c.f = static_cast>(1); + value.arg1.c.f = static_cast>(1); value.arg1.c.g = 0.0f; value.arg1.c.h = 0; @@ -46069,7 +46069,7 @@ class TestClusterSuite : public TestCommand listHolder_1->mList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); listHolder_1->mList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - listHolder_1->mList[0].f = static_cast>(1); + listHolder_1->mList[0].f = static_cast>(1); listHolder_1->mList[0].g = 0.0f; listHolder_1->mList[0].h = 0; @@ -46079,7 +46079,7 @@ class TestClusterSuite : public TestCommand listHolder_1->mList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); listHolder_1->mList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - listHolder_1->mList[1].f = static_cast>(1); + listHolder_1->mList[1].f = static_cast>(1); listHolder_1->mList[1].g = 0.0f; listHolder_1->mList[1].h = 0; @@ -46131,7 +46131,7 @@ class TestClusterSuite : public TestCommand value.arg1.c = static_cast(2); value.arg1.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); value.arg1.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - value.arg1.f = static_cast>(1); + value.arg1.f = static_cast>(1); value.arg1.g = 0.1f; value.arg1.h = 0.1; @@ -46239,7 +46239,7 @@ class TestClusterSuite : public TestCommand listHolder_0->mList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); listHolder_0->mList[0].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); - listHolder_0->mList[0].f = static_cast>(1); + listHolder_0->mList[0].f = static_cast>(1); listHolder_0->mList[0].g = 0.0f; listHolder_0->mList[0].h = 0; @@ -46249,7 +46249,7 @@ class TestClusterSuite : public TestCommand listHolder_0->mList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); listHolder_0->mList[1].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); - listHolder_0->mList[1].f = static_cast>(1); + listHolder_0->mList[1].f = static_cast>(1); listHolder_0->mList[1].g = 0.0f; listHolder_0->mList[1].h = 0; @@ -46276,7 +46276,7 @@ class TestClusterSuite : public TestCommand listHolder_0->mList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("second_octet_stringgarbage: not in length on purpose"), 19); listHolder_0->mList[0].e = chip::Span("second_char_stringgarbage: not in length on purpose", 18); - listHolder_0->mList[0].f = static_cast>(1); + listHolder_0->mList[0].f = static_cast>(1); listHolder_0->mList[0].g = 0.0f; listHolder_0->mList[0].h = 0; @@ -46286,7 +46286,7 @@ class TestClusterSuite : public TestCommand listHolder_0->mList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("first_octet_stringgarbage: not in length on purpose"), 18); listHolder_0->mList[1].e = chip::Span("first_char_stringgarbage: not in length on purpose", 17); - listHolder_0->mList[1].f = static_cast>(1); + listHolder_0->mList[1].f = static_cast>(1); listHolder_0->mList[1].g = 0.0f; listHolder_0->mList[1].h = 0; @@ -46317,7 +46317,7 @@ class TestClusterSuite : public TestCommand listHolder_0->mList[0].c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); listHolder_0->mList[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - listHolder_0->mList[0].c.f = static_cast>(1); + listHolder_0->mList[0].c.f = static_cast>(1); listHolder_0->mList[0].c.g = 0.0f; listHolder_0->mList[0].c.h = 0; @@ -46331,7 +46331,7 @@ class TestClusterSuite : public TestCommand listHolder_2->mList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); listHolder_2->mList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - listHolder_2->mList[0].f = static_cast>(1); + listHolder_2->mList[0].f = static_cast>(1); listHolder_2->mList[0].g = 0.0f; listHolder_2->mList[0].h = 0; @@ -46341,7 +46341,7 @@ class TestClusterSuite : public TestCommand listHolder_2->mList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); listHolder_2->mList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - listHolder_2->mList[1].f = static_cast>(1); + listHolder_2->mList[1].f = static_cast>(1); listHolder_2->mList[1].g = 0.0f; listHolder_2->mList[1].h = 0; @@ -46405,7 +46405,7 @@ class TestClusterSuite : public TestCommand listHolder_0->mList[0].c.d = chip::ByteSpan(chip::Uint8::from_const_char("octet_stringgarbage: not in length on purpose"), 12); listHolder_0->mList[0].c.e = chip::Span("char_stringgarbage: not in length on purpose", 11); - listHolder_0->mList[0].c.f = static_cast>(1); + listHolder_0->mList[0].c.f = static_cast>(1); listHolder_0->mList[0].c.g = 0.0f; listHolder_0->mList[0].c.h = 0; @@ -46419,7 +46419,7 @@ class TestClusterSuite : public TestCommand listHolder_2->mList[0].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); listHolder_2->mList[0].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - listHolder_2->mList[0].f = static_cast>(1); + listHolder_2->mList[0].f = static_cast>(1); listHolder_2->mList[0].g = 0.0f; listHolder_2->mList[0].h = 0; @@ -46429,7 +46429,7 @@ class TestClusterSuite : public TestCommand listHolder_2->mList[1].d = chip::ByteSpan(chip::Uint8::from_const_char("nested_octet_stringgarbage: not in length on purpose"), 19); listHolder_2->mList[1].e = chip::Span("nested_char_stringgarbage: not in length on purpose", 18); - listHolder_2->mList[1].f = static_cast>(1); + listHolder_2->mList[1].f = static_cast>(1); listHolder_2->mList[1].g = 0.0f; listHolder_2->mList[1].h = 0; @@ -46653,9 +46653,9 @@ class TestClusterSuite : public TestCommand case 184: { LogStep(184, "Write attribute NULLABLE_BITMAP8 Max Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNonNull(); - value.Value() = static_cast>(254); + value.Value() = static_cast>(254); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap8::Id, value, chip::NullOptional, chip::NullOptional); } @@ -46667,9 +46667,9 @@ class TestClusterSuite : public TestCommand case 186: { LogStep(186, "Write attribute NULLABLE_BITMAP8 Invalid Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNonNull(); - value.Value() = static_cast>(255); + value.Value() = static_cast>(255); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap8::Id, value, chip::NullOptional, chip::NullOptional); } @@ -46681,7 +46681,7 @@ class TestClusterSuite : public TestCommand case 188: { LogStep(188, "Write attribute NULLABLE_BITMAP8 null Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap8::Id, value, chip::NullOptional, chip::NullOptional); @@ -46699,9 +46699,9 @@ class TestClusterSuite : public TestCommand case 191: { LogStep(191, "Write attribute NULLABLE_BITMAP16 Max Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNonNull(); - value.Value() = static_cast>(65534U); + value.Value() = static_cast>(65534U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap16::Id, value, chip::NullOptional, chip::NullOptional); } @@ -46713,9 +46713,9 @@ class TestClusterSuite : public TestCommand case 193: { LogStep(193, "Write attribute NULLABLE_BITMAP16 Invalid Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNonNull(); - value.Value() = static_cast>(65535U); + value.Value() = static_cast>(65535U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap16::Id, value, chip::NullOptional, chip::NullOptional); } @@ -46727,7 +46727,7 @@ class TestClusterSuite : public TestCommand case 195: { LogStep(195, "Write attribute NULLABLE_BITMAP16 null Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap16::Id, value, chip::NullOptional, chip::NullOptional); @@ -46740,9 +46740,9 @@ class TestClusterSuite : public TestCommand case 197: { LogStep(197, "Write attribute NULLABLE_BITMAP32 Max Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNonNull(); - value.Value() = static_cast>(4294967294UL); + value.Value() = static_cast>(4294967294UL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap32::Id, value, chip::NullOptional, chip::NullOptional); } @@ -46754,9 +46754,9 @@ class TestClusterSuite : public TestCommand case 199: { LogStep(199, "Write attribute NULLABLE_BITMAP32 Invalid Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNonNull(); - value.Value() = static_cast>(4294967295UL); + value.Value() = static_cast>(4294967295UL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap32::Id, value, chip::NullOptional, chip::NullOptional); } @@ -46768,7 +46768,7 @@ class TestClusterSuite : public TestCommand case 201: { LogStep(201, "Write attribute NULLABLE_BITMAP32 null Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap32::Id, value, chip::NullOptional, chip::NullOptional); @@ -46781,9 +46781,9 @@ class TestClusterSuite : public TestCommand case 203: { LogStep(203, "Write attribute NULLABLE_BITMAP64 Max Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNonNull(); - value.Value() = static_cast>(18446744073709551614ULL); + value.Value() = static_cast>(18446744073709551614ULL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap64::Id, value, chip::NullOptional, chip::NullOptional); } @@ -46795,9 +46795,9 @@ class TestClusterSuite : public TestCommand case 205: { LogStep(205, "Write attribute NULLABLE_BITMAP64 Invalid Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNonNull(); - value.Value() = static_cast>(18446744073709551615ULL); + value.Value() = static_cast>(18446744073709551615ULL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap64::Id, value, chip::NullOptional, chip::NullOptional); } @@ -46809,7 +46809,7 @@ class TestClusterSuite : public TestCommand case 207: { LogStep(207, "Write attribute NULLABLE_BITMAP64 null Value"); ListFreer listFreer; - chip::app::DataModel::Nullable> value; + chip::app::DataModel::Nullable> value; value.SetNull(); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::NullableBitmap64::Id, value, chip::NullOptional, chip::NullOptional); @@ -48731,7 +48731,7 @@ class TestClusterSuite : public TestCommand value.c = static_cast(2); value.d = chip::ByteSpan(chip::Uint8::from_const_char("abcgarbage: not in length on purpose"), 3); value.e = chip::Span("garbage: not in length on purpose", 0); - value.f = static_cast>(17); + value.f = static_cast>(17); value.g = 1.5f; value.h = 3.14159265358979; @@ -50443,10 +50443,10 @@ class TestSaveAsSuite : public TestCommand uint8_t TestAddArgumentDefaultValue; bool readAttributeBooleanDefaultValue; - chip::BitFlags readAttributeBitmap8DefaultValue; - chip::BitFlags readAttributeBitmap16DefaultValue; - chip::BitFlags readAttributeBitmap32DefaultValue; - chip::BitFlags readAttributeBitmap64DefaultValue; + chip::BitMask readAttributeBitmap8DefaultValue; + chip::BitMask readAttributeBitmap16DefaultValue; + chip::BitMask readAttributeBitmap32DefaultValue; + chip::BitMask readAttributeBitmap64DefaultValue; uint8_t readAttributeInt8uDefaultValue; uint16_t readAttributeInt16uDefaultValue; uint32_t readAttributeInt32uDefaultValue; @@ -50546,7 +50546,7 @@ class TestSaveAsSuite : public TestCommand case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap8", value, 0)); @@ -50559,7 +50559,7 @@ class TestSaveAsSuite : public TestCommand case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeBitmap8DefaultValue)); } @@ -50570,7 +50570,7 @@ class TestSaveAsSuite : public TestCommand case 13: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap8", value, readAttributeBitmap8DefaultValue)); } @@ -50578,7 +50578,7 @@ class TestSaveAsSuite : public TestCommand case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap16", value, 0U)); @@ -50591,7 +50591,7 @@ class TestSaveAsSuite : public TestCommand case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeBitmap16DefaultValue)); } @@ -50602,7 +50602,7 @@ class TestSaveAsSuite : public TestCommand case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap16", value, readAttributeBitmap16DefaultValue)); } @@ -50610,7 +50610,7 @@ class TestSaveAsSuite : public TestCommand case 19: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap32", value, 0UL)); @@ -50623,7 +50623,7 @@ class TestSaveAsSuite : public TestCommand case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeBitmap32DefaultValue)); } @@ -50634,7 +50634,7 @@ class TestSaveAsSuite : public TestCommand case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap32", value, readAttributeBitmap32DefaultValue)); } @@ -50642,7 +50642,7 @@ class TestSaveAsSuite : public TestCommand case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap64", value, 0ULL)); @@ -50655,7 +50655,7 @@ class TestSaveAsSuite : public TestCommand case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckConstraintNotValue("value", value, readAttributeBitmap64DefaultValue)); } @@ -50666,7 +50666,7 @@ class TestSaveAsSuite : public TestCommand case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { - chip::BitFlags value; + chip::BitMask value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); VerifyOrReturn(CheckValue("bitmap64", value, readAttributeBitmap64DefaultValue)); } @@ -51318,8 +51318,8 @@ class TestSaveAsSuite : public TestCommand case 10: { LogStep(10, "Write attribute BITMAP8 Not Default Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(1); + chip::BitMask value; + value = static_cast>(1); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap8::Id, value, chip::NullOptional, chip::NullOptional); } @@ -51331,7 +51331,7 @@ class TestSaveAsSuite : public TestCommand case 12: { LogStep(12, "Write attribute BITMAP8 Default Value"); ListFreer listFreer; - chip::BitFlags value; + chip::BitMask value; value = readAttributeBitmap8DefaultValue; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap8::Id, value, chip::NullOptional, chip::NullOptional); @@ -51349,8 +51349,8 @@ class TestSaveAsSuite : public TestCommand case 15: { LogStep(15, "Write attribute BITMAP16 Not Default Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(1U); + chip::BitMask value; + value = static_cast>(1U); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap16::Id, value, chip::NullOptional, chip::NullOptional); } @@ -51362,7 +51362,7 @@ class TestSaveAsSuite : public TestCommand case 17: { LogStep(17, "Write attribute BITMAP16 Default Value"); ListFreer listFreer; - chip::BitFlags value; + chip::BitMask value; value = readAttributeBitmap16DefaultValue; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap16::Id, value, chip::NullOptional, chip::NullOptional); @@ -51380,8 +51380,8 @@ class TestSaveAsSuite : public TestCommand case 20: { LogStep(20, "Write attribute BITMAP32 Not Default Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(1UL); + chip::BitMask value; + value = static_cast>(1UL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap32::Id, value, chip::NullOptional, chip::NullOptional); } @@ -51393,7 +51393,7 @@ class TestSaveAsSuite : public TestCommand case 22: { LogStep(22, "Write attribute BITMAP32 Default Value"); ListFreer listFreer; - chip::BitFlags value; + chip::BitMask value; value = readAttributeBitmap32DefaultValue; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap32::Id, value, chip::NullOptional, chip::NullOptional); @@ -51411,8 +51411,8 @@ class TestSaveAsSuite : public TestCommand case 25: { LogStep(25, "Write attribute BITMAP64 Not Default Value"); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(1ULL); + chip::BitMask value; + value = static_cast>(1ULL); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap64::Id, value, chip::NullOptional, chip::NullOptional); } @@ -51424,7 +51424,7 @@ class TestSaveAsSuite : public TestCommand case 27: { LogStep(27, "Write attribute BITMAP64 Default Value"); ListFreer listFreer; - chip::BitFlags value; + chip::BitMask value; value = readAttributeBitmap64DefaultValue; return WriteAttribute(kIdentityAlpha, GetEndpoint(1), TestCluster::Id, TestCluster::Attributes::Bitmap64::Id, value, chip::NullOptional, chip::NullOptional); @@ -61019,7 +61019,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 0; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61035,7 +61035,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = static_cast(NumberOfWeekDaySchedulesSupportedPerUser + 1); value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61051,7 +61051,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 0U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61067,7 +61067,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = static_cast(NumberOfTotalUsersSupported + 1); - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61083,7 +61083,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 2U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61099,7 +61099,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(0); + value.daysMask = static_cast>(0); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61115,7 +61115,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(3); + value.daysMask = static_cast>(3); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61131,7 +61131,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(73); + value.daysMask = static_cast>(73); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61147,7 +61147,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 24; value.startMinute = 16; value.endHour = 18; @@ -61163,7 +61163,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 60; value.endHour = 18; @@ -61179,7 +61179,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 16; value.endHour = 24; @@ -61195,7 +61195,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61211,7 +61211,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 19; value.startMinute = 16; value.endHour = 18; @@ -61227,7 +61227,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 50; value.endHour = 15; @@ -61558,7 +61558,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 15; value.startMinute = 16; value.endHour = 18; @@ -61835,7 +61835,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 2; value.userIndex = 1U; - value.daysMask = static_cast>(2); + value.daysMask = static_cast>(2); value.startHour = 0; value.startMinute = 0; value.endHour = 23; @@ -61995,7 +61995,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(2); + value.daysMask = static_cast>(2); value.startHour = 0; value.startMinute = 0; value.endHour = 23; @@ -62093,7 +62093,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 0; value.startMinute = 0; value.endHour = 23; @@ -62144,7 +62144,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 4; value.userIndex = 2U; - value.daysMask = static_cast>(64); + value.daysMask = static_cast>(64); value.startHour = 23; value.startMinute = 0; value.endHour = 23; @@ -62310,7 +62310,7 @@ class DL_SchedulesSuite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(1); + value.daysMask = static_cast>(1); value.startHour = 0; value.startMinute = 0; value.endHour = 23; @@ -63342,7 +63342,7 @@ class Test_TC_DL_2_8Suite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 1; value.userIndex = 1U; - value.daysMask = static_cast>(2); + value.daysMask = static_cast>(2); value.startHour = 15; value.startMinute = 45; value.endHour = 16; @@ -63369,7 +63369,7 @@ class Test_TC_DL_2_8Suite : public TestCommand chip::app::Clusters::DoorLock::Commands::SetWeekDaySchedule::Type value; value.weekDayIndex = 0; value.userIndex = 1U; - value.daysMask = static_cast>(7); + value.daysMask = static_cast>(7); value.startHour = 15; value.startMinute = 45; value.endHour = 16; From 43feea9c6bda136e5b68e306083a70d9e9c30b29 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 14:55:55 -0400 Subject: [PATCH 04/18] Update to make things compile --- .../util/attribute-storage-null-handling.h | 47 +++++++++++++++++++ src/lib/support/BitMask.h | 19 ++++++-- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/app/util/attribute-storage-null-handling.h b/src/app/util/attribute-storage-null-handling.h index 000fa8cb40483d..ecd29138506ad2 100644 --- a/src/app/util/attribute-storage-null-handling.h +++ b/src/app/util/attribute-storage-null-handling.h @@ -18,6 +18,8 @@ #pragma once #include +#include +#include #include #include @@ -171,6 +173,51 @@ struct NumericAttributeTraits> static uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return reinterpret_cast(&value); } }; +template +struct NumericAttributeTraits> +{ + using StorageType = T; + using WorkingType = BitMask; + + 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. + // + constexpr 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 uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return reinterpret_cast(&value); } +}; + template <> struct NumericAttributeTraits { diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index d4437ccc1a85a4..e75a927736d2de 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -33,13 +33,20 @@ template { public: + using IntegerType = typename BitFlags::IntegerType; + + BitMask() : BitFlags() {} + + explicit BitMask(FlagsEnum value) : BitFlags(value) {} + explicit BitMask(IntegerType value) : BitFlags(value) {} + /** * GetField to value via a mask shifting. * * @param mask Typed flag(s) to used as mask, flag(s) must be contiguous. Any flags not in @a v are unaffected. * @returns Value from the underlying field/mask */ - constexpr BitFlags & SetField(FlagsEnum mask, IntegerType value) + constexpr BitMask & SetField(FlagsEnum mask, IntegerType value) { IntegerType bitMask = static_cast(mask); IntegerType shift = GetShiftToFirstSetBit(bitMask); @@ -48,9 +55,11 @@ class BitMask : public BitFlags assert((value & (mask >> shift)) == value); // Clear bits overlayed by the mask - mValue = static_cast(mValue & ~bitMask); + IntegerType updated = static_cast(BitFlags::Raw() & ~bitMask); // Set the right bits - mValue |= static_cast(bitMask & (value << shift)); + updated |= static_cast(bitMask & (value << shift)); + + BitFlags::SetRaw(updated); return *this; } @@ -68,7 +77,7 @@ class BitMask : public BitFlags IntegerType shift = GetShiftToFirstSetBit(bitMask); // Forward the right bits - return static_cast(((mValue & bitMask) >> shift)); + return static_cast(((BitFlags::Raw() & bitMask) >> shift)); } } @@ -94,3 +103,5 @@ class BitMask : public BitFlags return count; } }; + +} // namespace chip From a3ef1e2a6c3117ea2d4054b720cce7e5e8312827 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 15:06:16 -0400 Subject: [PATCH 05/18] Add BitMask constructors and more support in generic test validation types --- .../tests/suites/include/ConstraintsChecker.h | 49 +++++++++++++++++++ src/app/tests/suites/include/ValueChecker.h | 12 +++++ src/lib/support/BitMask.h | 8 +++ 3 files changed, 69 insertions(+) diff --git a/src/app/tests/suites/include/ConstraintsChecker.h b/src/app/tests/suites/include/ConstraintsChecker.h index 10c87d61095b93..ec00b9743a55c4 100644 --- a/src/app/tests/suites/include/ConstraintsChecker.h +++ b/src/app/tests/suites/include/ConstraintsChecker.h @@ -219,6 +219,18 @@ class ConstraintsChecker return true; } + template + bool CheckConstraintMinValue(const char * itemName, chip::BitMask current, U expected) + { + if (current.Raw() < expected) + { + Exit(std::string(itemName) + " value < minValue: " + std::to_string(current.Raw()) + " < " + std::to_string(expected)); + return false; + } + + return true; + } + template bool CheckConstraintMinValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) { @@ -270,6 +282,18 @@ class ConstraintsChecker return true; } + template + bool CheckConstraintMaxValue(const char * itemName, chip::BitMask current, U expected) + { + if (current.Raw() > expected) + { + Exit(std::string(itemName) + " value > maxValue: " + std::to_string(current.Raw()) + " > " + std::to_string(expected)); + return false; + } + + return true; + } + template bool CheckConstraintMaxValue(const char * itemName, const chip::app::DataModel::Nullable & current, U expected) { @@ -345,6 +369,18 @@ class ConstraintsChecker return true; } + template + bool CheckConstraintNotValue(const char * itemName, chip::BitMask current, chip::BitMask 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, chip::BitFlags current, U expected) { @@ -358,6 +394,19 @@ class ConstraintsChecker return true; } + template + bool CheckConstraintNotValue(const char * itemName, chip::BitMask current, U expected) + { + if (current.Raw() == 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 9ea70c8b67bf20..d629626f4cd11d 100644 --- a/src/app/tests/suites/include/ValueChecker.h +++ b/src/app/tests/suites/include/ValueChecker.h @@ -94,6 +94,12 @@ class ValueChecker return CheckValue(itemName, current.Raw(), expected); } + template + bool CheckValue(const char * itemName, chip::BitMask current, U expected) + { + return CheckValue(itemName, current.Raw(), expected); + } + // Allow an expected value that is a nullable wrapped around the actual // value (e.g. a SaveAs from reading a different attribute that has a value // space that includes null). In that case we check that: @@ -114,6 +120,12 @@ class ValueChecker return CheckValue(itemName, current.Raw(), expected.Raw()); } + template + bool CheckValue(const char * itemName, chip::BitMask current, chip::BitMask expected) + { + return CheckValue(itemName, current.Raw(), expected.Raw()); + } + template bool CheckValuePresent(const char * itemName, const chip::Optional & value) { diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index e75a927736d2de..69c56b6d61c7b3 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -40,6 +40,14 @@ class BitMask : public BitFlags explicit BitMask(FlagsEnum value) : BitFlags(value) {} explicit BitMask(IntegerType value) : BitFlags(value) {} + template + BitMask(FlagsEnum flag, Args &&... args) : BitFlags(flag, std::forward(args)...) + {} + + template + BitMask(IntegerType value, Args &&... args) : BitFlags(value, std::forward(args)...) + {} + /** * GetField to value via a mask shifting. * From 4cc39a1c69bf859b1b2a614876f2084ced6c565d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 15:28:10 -0400 Subject: [PATCH 06/18] More updates for compilation - chip tool seems to compile now --- .../commands/clusters/ComplexArgument.h | 10 +++++++ examples/chip-tool/commands/common/Command.h | 9 +++++++ src/app/data-model/BasicTypes.h | 7 +++++ src/lib/core/CHIPTLV.h | 26 +++++++++++++++++++ src/lib/support/BitMask.h | 2 ++ 5 files changed, 54 insertions(+) diff --git a/examples/chip-tool/commands/clusters/ComplexArgument.h b/examples/chip-tool/commands/clusters/ComplexArgument.h index aafc18d68d7591..689b2e6f9a217e 100644 --- a/examples/chip-tool/commands/clusters/ComplexArgument.h +++ b/examples/chip-tool/commands/clusters/ComplexArgument.h @@ -102,6 +102,16 @@ class ComplexArgumentParser return CHIP_NO_ERROR; } + template + static CHIP_ERROR Setup(const char * label, chip::BitMask & request, Json::Value & value) + { + T requestValue; + ReturnErrorOnFailure(ComplexArgumentParser::Setup(label, requestValue, value)); + + request = chip::BitMask(requestValue); + return CHIP_NO_ERROR; + } + template static CHIP_ERROR Setup(const char * label, chip::Optional & request, Json::Value & value) { diff --git a/examples/chip-tool/commands/common/Command.h b/examples/chip-tool/commands/common/Command.h index 0973a9d4fec638..eb20d174f8e5be 100644 --- a/examples/chip-tool/commands/common/Command.h +++ b/examples/chip-tool/commands/common/Command.h @@ -196,6 +196,15 @@ class Command return AddArgument(name, min, max, reinterpret_cast(out), desc, flags); } + template + size_t AddArgument(const char * name, int64_t min, uint64_t max, chip::BitMask * out, const char * desc = "", + uint8_t flags = 0) + { + // This is a terrible hack that relies on BitMask only having the one + // mValue member. + return AddArgument(name, min, max, reinterpret_cast(out), desc, flags); + } + template size_t AddArgument(const char * name, chip::Optional * value, const char * desc = "") { diff --git a/src/app/data-model/BasicTypes.h b/src/app/data-model/BasicTypes.h index f2a732153dd946..6bc1c967d18423 100644 --- a/src/app/data-model/BasicTypes.h +++ b/src/app/data-model/BasicTypes.h @@ -19,6 +19,7 @@ #pragma once #include +#include #include #include @@ -43,6 +44,12 @@ struct IsBasicType> static constexpr bool value = true; }; +template +struct IsBasicType> +{ + static constexpr bool value = true; +}; + template <> struct IsBasicType { diff --git a/src/lib/core/CHIPTLV.h b/src/lib/core/CHIPTLV.h index f507294435d4a8..8a96f45ce1069f 100644 --- a/src/lib/core/CHIPTLV.h +++ b/src/lib/core/CHIPTLV.h @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -531,6 +532,21 @@ class DLL_EXPORT TLVReader return CHIP_NO_ERROR; } + /** + * Get the value of the current element as a BitMask value, if it's an integer + * value that fits in the BitMask type. + * + * @param[out] v Receives the value associated with current TLV element. + */ + template + CHIP_ERROR Get(BitMask & v) + { + std::underlying_type_t val; + ReturnErrorOnFailure(Get(val)); + v.SetRaw(val); + return CHIP_NO_ERROR; + } + /** * Get the value of the current byte or UTF8 string element. * @@ -1433,6 +1449,16 @@ class DLL_EXPORT TLVWriter return Put(tag, data.Raw()); } + /** + * + * Encodes an unsigned integer with bits corresponding to the flags set when data is a BitMask + */ + template + CHIP_ERROR Put(Tag tag, BitMask data) + { + return Put(tag, data.Raw()); + } + /** * Encodes a TLV boolean value. * diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index 69c56b6d61c7b3..566d71ed76acd3 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -19,6 +19,8 @@ #include +#include + #include namespace chip { From 59b376751b9c73ac8e3373ac6508f2ff5e041717 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 15:32:46 -0400 Subject: [PATCH 07/18] Restyle --- src/app/zap-templates/templates/app/helper.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/zap-templates/templates/app/helper.js b/src/app/zap-templates/templates/app/helper.js index 0eeeba5d296c9f..39450dae48ec8d 100644 --- a/src/app/zap-templates/templates/app/helper.js +++ b/src/app/zap-templates/templates/app/helper.js @@ -110,25 +110,25 @@ function chip_endpoint_generated_functions() { hasFunctionArray = true functionList = functionList.concat( - ` (EmberAfGenericClusterFunction) emberAf${cHelper.asCamelCased(clusterName, false)}ClusterServerInitCallback,\\\n`) + ` (EmberAfGenericClusterFunction) emberAf${cHelper.asCamelCased(clusterName, false)}ClusterServerInitCallback,\\\n`) } if (endpointClusterWithAttributeChanged.includes(clusterName)) { functionList = functionList.concat(` (EmberAfGenericClusterFunction) Matter${ cHelper.asCamelCased(clusterName, false)}ClusterServerAttributeChangedCallback,\\\n`) - hasFunctionArray = true + hasFunctionArray = true } if (endpointClusterWithMessageSent.includes(clusterName)) { functionList = functionList.concat(` (EmberAfGenericClusterFunction) emberAf${ cHelper.asCamelCased(clusterName, false)}ClusterServerMessageSentCallback,\\\n`) - hasFunctionArray = true + hasFunctionArray = true } if (endpointClusterWithPreAttribute.includes(clusterName)) { functionList = functionList.concat(` (EmberAfGenericClusterFunction) Matter${ cHelper.asCamelCased(clusterName, false)}ClusterServerPreAttributeChangedCallback,\\\n`) - hasFunctionArray = true + hasFunctionArray = true } if (hasFunctionArray) { @@ -294,7 +294,9 @@ async function asNativeType(type) function fn(pkgId) { const options = { 'hash' : {} }; - return zclHelper.asUnderlyingZclType.call(this, type, options).then(zclType => { return ChipTypesHelper.asBasicType(zclType); }) + return zclHelper.asUnderlyingZclType.call(this, type, options).then(zclType => { + return ChipTypesHelper.asBasicType(zclType); + }) } const promise = templateUtil.ensureZclPackageId(this).then(fn.bind(this)).catch(err => { @@ -515,14 +517,14 @@ async function zapTypeToClusterObjectType(type, isDecodable, options) passByReference = true; // If we did not have a namespace provided, we can assume we're inside // chip::app::. - let ns = options.hash.ns ? "chip::app::" : "" + let ns = options.hash.ns ? "chip::app::" : "" typeStr = `${ns}DataModel::Nullable<${typeStr}>`; } if (this.isOptional && !options.hash.forceNotOptional) { passByReference = true; // If we did not have a namespace provided, we can assume we're inside // chip::. - let ns = options.hash.ns ? "chip::" : "" + let ns = options.hash.ns ? "chip::" : "" typeStr = `${ns}Optional<${typeStr}>`; } if (options.hash.isArgument && passByReference) { From 678c4d44c4709f8a660331044c2261ea58a239fb Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 16:17:28 -0400 Subject: [PATCH 08/18] Fix all clusters compile --- .../door-lock-server/door-lock-server.cpp | 2 +- .../pump-configuration-and-control-server.cpp | 2 +- .../window-covering-server.cpp | 32 +++++++++---------- .../window-covering-server.h | 12 +++---- src/lib/support/BitMask.h | 10 ++++++ third_party/pigweed/repo | 2 +- 6 files changed, 35 insertions(+), 25 deletions(-) diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index 12d919766ce5b2..ef666c12bc6c45 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -2248,7 +2248,7 @@ void DoorLockServer::sendGetWeekDayScheduleResponse(chip::app::CommandHandler * response.status = status; if (DlStatus::kSuccess == status) { - response.daysMask = Optional>(daysMask); + response.daysMask = Optional>(daysMask); response.startHour = Optional(startHour); response.startMinute = Optional(startMinute); response.endHour = Optional(endHour); diff --git a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp index 27f337431b45cc..16bf63b112c473 100644 --- a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp +++ b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp @@ -71,7 +71,7 @@ static void updateAttributeLinks(EndpointId endpoint) { PumpControlMode controlMode; PumpOperationMode operationMode; - BitFlags pumpStatus; + BitMask pumpStatus; // Get the current control- and operation modes Attributes::ControlMode::Get(endpoint, &controlMode); diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp index bbb33c71b653d0..251118cc542a7c 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.cpp +++ b/src/app/clusters/window-covering-server/window-covering-server.cpp @@ -165,7 +165,7 @@ Type TypeGet(chip::EndpointId endpoint) return value; } -void ConfigStatusPrint(const chip::BitFlags & configStatus) +void ConfigStatusPrint(const chip::BitMask & configStatus) { emberAfWindowCoveringClusterPrint("ConfigStatus 0x%02X Operational=%u OnlineReserved=%u", configStatus.Raw(), configStatus.Has(ConfigStatus::kOperational), @@ -177,14 +177,14 @@ void ConfigStatusPrint(const chip::BitFlags & configStatus) configStatus.Has(ConfigStatus::kTiltPositionAware), configStatus.Has(ConfigStatus::kTiltEncoderControlled)); } -void ConfigStatusSet(chip::EndpointId endpoint, const chip::BitFlags & configStatus) +void ConfigStatusSet(chip::EndpointId endpoint, const chip::BitMask & configStatus) { Attributes::ConfigStatus::Set(endpoint, configStatus); } -chip::BitFlags ConfigStatusGet(chip::EndpointId endpoint) +chip::BitMask ConfigStatusGet(chip::EndpointId endpoint) { - chip::BitFlags configStatus; + chip::BitMask configStatus; Attributes::ConfigStatus::Get(endpoint, &configStatus); return configStatus; @@ -192,7 +192,7 @@ chip::BitFlags ConfigStatusGet(chip::EndpointId endpoint) void ConfigStatusUpdateFeatures(chip::EndpointId endpoint) { - chip::BitFlags configStatus = ConfigStatusGet(endpoint); + chip::BitMask configStatus = ConfigStatusGet(endpoint); configStatus.Set(ConfigStatus::kLiftPositionAware, HasFeaturePaLift(endpoint)); configStatus.Set(ConfigStatus::kTiltPositionAware, HasFeaturePaTilt(endpoint)); @@ -255,19 +255,19 @@ EndProductType EndProductTypeGet(chip::EndpointId endpoint) return value; } -void ModePrint(const chip::BitFlags & mode) +void ModePrint(const chip::BitMask & mode) { emberAfWindowCoveringClusterPrint("Mode 0x%02X MotorDirReversed=%u LedFeedback=%u Maintenance=%u Calibration=%u", mode.Raw(), mode.Has(Mode::kMotorDirectionReversed), mode.Has(Mode::kLedFeedback), mode.Has(Mode::kMaintenanceMode), mode.Has(Mode::kCalibrationMode)); } -void ModeSet(chip::EndpointId endpoint, chip::BitFlags & newMode) +void ModeSet(chip::EndpointId endpoint, chip::BitMask & newMode) { - chip::BitFlags newStatus; + chip::BitMask newStatus; - chip::BitFlags oldStatus = ConfigStatusGet(endpoint); - chip::BitFlags oldMode = ModeGet(endpoint); + chip::BitMask oldStatus = ConfigStatusGet(endpoint); + chip::BitMask oldMode = ModeGet(endpoint); newStatus = oldStatus; @@ -288,9 +288,9 @@ void ModeSet(chip::EndpointId endpoint, chip::BitFlags & newMode) ConfigStatusSet(endpoint, newStatus); } -chip::BitFlags ModeGet(chip::EndpointId endpoint) +chip::BitMask ModeGet(chip::EndpointId endpoint) { - chip::BitFlags mode; + chip::BitMask mode; Attributes::Mode::Get(endpoint, &mode); return mode; @@ -591,8 +591,8 @@ void PostAttributeChange(chip::EndpointId endpoint, chip::AttributeId attributeI { // all-cluster-app: simulation for the CI testing // otherwise it is defined for manufacturer specific implementation */ - BitFlags mode; - BitFlags configStatus; + BitMask mode; + BitMask configStatus; NPercent100ths current, target; OperationalStatus prevOpStatus = OperationalStatusGet(endpoint); OperationalStatus opStatus = prevOpStatus; @@ -659,8 +659,8 @@ void PostAttributeChange(chip::EndpointId endpoint, chip::AttributeId attributeI EmberAfStatus GetMotionLockStatus(chip::EndpointId endpoint) { - BitFlags mode = ModeGet(endpoint); - BitFlags configStatus = ConfigStatusGet(endpoint); + BitMask mode = ModeGet(endpoint); + BitMask configStatus = ConfigStatusGet(endpoint); // Is the device locked? if (!configStatus.Has(ConfigStatus::kOperational)) diff --git a/src/app/clusters/window-covering-server/window-covering-server.h b/src/app/clusters/window-covering-server/window-covering-server.h index 15282f2411ed6e..a0703a05917c64 100644 --- a/src/app/clusters/window-covering-server/window-covering-server.h +++ b/src/app/clusters/window-covering-server/window-covering-server.h @@ -99,9 +99,9 @@ bool HasFeaturePaTilt(chip::EndpointId endpoint); void TypeSet(chip::EndpointId endpoint, Type type); Type TypeGet(chip::EndpointId endpoint); -void ConfigStatusPrint(const chip::BitFlags & configStatus); -void ConfigStatusSet(chip::EndpointId endpoint, const chip::BitFlags & status); -chip::BitFlags ConfigStatusGet(chip::EndpointId endpoint); +void ConfigStatusPrint(const chip::BitMask & configStatus); +void ConfigStatusSet(chip::EndpointId endpoint, const chip::BitMask & status); +chip::BitMask ConfigStatusGet(chip::EndpointId endpoint); void ConfigStatusUpdateFeatures(chip::EndpointId endpoint); void OperationalStatusSet(chip::EndpointId endpoint, const OperationalStatus & status); @@ -115,9 +115,9 @@ Percent100ths ComputePercent100thsStep(OperationalState direction, Percent100ths void EndProductTypeSet(chip::EndpointId endpoint, EndProductType type); EndProductType EndProductTypeGet(chip::EndpointId endpoint); -void ModePrint(const chip::BitFlags & mode); -void ModeSet(chip::EndpointId endpoint, chip::BitFlags & mode); -chip::BitFlags ModeGet(chip::EndpointId endpoint); +void ModePrint(const chip::BitMask & mode); +void ModeSet(chip::EndpointId endpoint, chip::BitMask & mode); +chip::BitMask ModeGet(chip::EndpointId endpoint); void SafetyStatusSet(chip::EndpointId endpoint, SafetyStatus & status); const SafetyStatus SafetyStatusGet(chip::EndpointId endpoint); diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index 566d71ed76acd3..8155d23ea122ce 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -38,6 +38,8 @@ class BitMask : public BitFlags using IntegerType = typename BitFlags::IntegerType; BitMask() : BitFlags() {} + BitMask(const BitFlags & other) : BitFlags(other) {} + BitMask(BitFlags && other) : BitFlags(std::move(other)) {} explicit BitMask(FlagsEnum value) : BitFlags(value) {} explicit BitMask(IntegerType value) : BitFlags(value) {} @@ -50,6 +52,14 @@ class BitMask : public BitFlags BitMask(IntegerType value, Args &&... args) : BitFlags(value, std::forward(args)...) {} + BitMask & operator=(const BitMask &) = default; + + BitMask & operator=(const BitFlags & other) + { + BitFlags::SetRaw(other.Raw()); + return *this; + } + /** * GetField to value via a mask shifting. * diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo index e61718e9f4e5c5..2e14574efe7d02 160000 --- a/third_party/pigweed/repo +++ b/third_party/pigweed/repo @@ -1 +1 @@ -Subproject commit e61718e9f4e5c58c0855679a367de8b93eb116cb +Subproject commit 2e14574efe7d022966fc971151f0dfbbd81c85dc From 4e1faffd1064f611069136cff796a8e3908a8f37 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 16:35:03 -0400 Subject: [PATCH 09/18] Fix compilation for direct value assignment to a mask --- src/lib/support/BitMask.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index 8155d23ea122ce..631d6b3206ac43 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -60,6 +60,12 @@ class BitMask : public BitFlags return *this; } + BitMask & operator=(FlagsEnum value) + { + BitFlags::SetRaw(static_cast(value)); + return *this; + } + /** * GetField to value via a mask shifting. * From fb350a9082cff03be19b4db66ab4037f73ad3756 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 16:49:45 -0400 Subject: [PATCH 10/18] Add default copy constructor for BitMask --- src/lib/support/BitMask.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index 631d6b3206ac43..e01d1638b3fecc 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -40,6 +40,7 @@ class BitMask : public BitFlags BitMask() : BitFlags() {} BitMask(const BitFlags & other) : BitFlags(other) {} BitMask(BitFlags && other) : BitFlags(std::move(other)) {} + BitMask(const BitMask &) = default; explicit BitMask(FlagsEnum value) : BitFlags(value) {} explicit BitMask(IntegerType value) : BitFlags(value) {} From cf0826f897f52c368c28585f3142787c4115982c Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 17:40:03 -0400 Subject: [PATCH 11/18] Undo pigweed update --- third_party/pigweed/repo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo index 2e14574efe7d02..e61718e9f4e5c5 160000 --- a/third_party/pigweed/repo +++ b/third_party/pigweed/repo @@ -1 +1 @@ -Subproject commit 2e14574efe7d022966fc971151f0dfbbd81c85dc +Subproject commit e61718e9f4e5c58c0855679a367de8b93eb116cb From bbf903fbc4457871cadbc912da46afe5287cc107 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 31 May 2022 20:59:22 -0400 Subject: [PATCH 12/18] Convert one more flag to mask for compile on TI --- examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp | 2 +- examples/window-app/common/src/WindowApp.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp index c6b05762d495e5..2cb5475fcdf4f9 100644 --- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp +++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp @@ -467,7 +467,7 @@ void AppTask::UpdateClusterState(void) void AppTask::UpdateCluster(intptr_t context) { EmberStatus status; - BitFlags pumpStatus; + BitMask pumpStatus; ChipLogProgress(NotSpecified, "Update Cluster State"); diff --git a/examples/window-app/common/src/WindowApp.cpp b/examples/window-app/common/src/WindowApp.cpp index a9d357eea42e6c..0cada84b7b046c 100644 --- a/examples/window-app/common/src/WindowApp.cpp +++ b/examples/window-app/common/src/WindowApp.cpp @@ -294,8 +294,8 @@ void WindowApp::DispatchEvent(const WindowApp::Event & event) void WindowApp::DispatchEventAttributeChange(chip::EndpointId endpoint, chip::AttributeId attribute) { Cover * cover = GetCover(endpoint); - chip::BitFlags mode; - chip::BitFlags configStatus; + chip::BitMask mode; + chip::BitMask configStatus; if (nullptr == cover) { @@ -426,7 +426,7 @@ void WindowApp::Cover::Init(chip::EndpointId endpoint) TypeSet(endpoint, Type::kTiltBlindLiftAndTilt); // Attribute: Id 7 ConfigStatus - chip::BitFlags configStatus = ConfigStatusGet(endpoint); + chip::BitMask configStatus = ConfigStatusGet(endpoint); configStatus.Set(ConfigStatus::kLiftEncoderControlled); configStatus.Set(ConfigStatus::kTiltEncoderControlled); configStatus.Set(ConfigStatus::kOnlineReserved); @@ -438,7 +438,7 @@ void WindowApp::Cover::Init(chip::EndpointId endpoint) EndProductTypeSet(endpoint, EndProductType::kInteriorBlind); // Attribute: Id 24 Mode - chip::BitFlags mode; + chip::BitMask mode; mode.Clear(Mode::kMotorDirectionReversed); mode.Clear(Mode::kMaintenanceMode); mode.Clear(Mode::kCalibrationMode); From 18d2ca822ab846c1c301df487f57f2a2c4cbe509 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 2 Jun 2022 09:12:17 -0400 Subject: [PATCH 13/18] Review comments: better documentation, add unit tests --- src/lib/support/BitMask.h | 45 ++++++---- src/lib/support/tests/BUILD.gn | 1 + src/lib/support/tests/TestBitMask.cpp | 119 ++++++++++++++++++++++++++ 3 files changed, 149 insertions(+), 16 deletions(-) create mode 100644 src/lib/support/tests/TestBitMask.cpp diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index e01d1638b3fecc..7eec937bf6c84f 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -68,18 +68,24 @@ class BitMask : public BitFlags } /** - * GetField to value via a mask shifting. + * Set a field within the bit mask integer. * - * @param mask Typed flag(s) to used as mask, flag(s) must be contiguous. Any flags not in @a v are unaffected. - * @returns Value from the underlying field/mask + * Fields are assumed to be contiguous bits within the underlying integer, for example: + * A mask of 0x70 == 0b01110000 means that a 3 bit value is encoded at bits [4;6]. + * + * Calling SetField(0x70, n) is equivalent to "((value & ~0x70) | (n << 4)" + * + * @param mask The mask, code assumes a continous bit mask + * @param value The value, NOT shifted, MUST fit within the number of bits of the mask */ constexpr BitMask & SetField(FlagsEnum mask, IntegerType value) { IntegerType bitMask = static_cast(mask); IntegerType shift = GetShiftToFirstSetBit(bitMask); - // Value should be fully contained within the shift mask. - assert((value & (mask >> shift)) == value); + // NOTE: value should be fully contained within the shift mask. + // + // assert((value & (mask >> shift)) == value); // Clear bits overlayed by the mask IntegerType updated = static_cast(BitFlags::Raw() & ~bitMask); @@ -92,20 +98,20 @@ class BitMask : public BitFlags } /** - * GetField to value via a mask shifting. + * Gets an underlying field that is contained within a bit subset of the integer. + * Examples: + * GetField(0x70) == GetField(0b01110000) == ((n & 0x70) >> 4) == ((n >> 4) 0x07) + * GetField(0xB0) == GetField(0b11000000) == ((n & 0xB0) >> 6) == ((n >> 6) 0x03) * - * @param mask Typed flag(s) to used as mask, flag(s) must be contiguous. Any flags not in @a v are unaffected. - * @returns Value from the underlying field/mask + * @param mask The bit mask to be used, assumed to be a contigous bit mask */ IntegerType GetField(FlagsEnum mask) const { - { - IntegerType bitMask = static_cast(mask); - IntegerType shift = GetShiftToFirstSetBit(bitMask); + IntegerType bitMask = static_cast(mask); + IntegerType shift = GetShiftToFirstSetBit(bitMask); - // Forward the right bits - return static_cast(((BitFlags::Raw() & bitMask) >> shift)); - } + // Forward the right bits + return static_cast(((BitFlags::Raw() & bitMask) >> shift)); } protected: @@ -122,9 +128,16 @@ class BitMask : public BitFlags static constexpr IntegerType GetShiftToFirstSetBit(IntegerType bitMask) { IntegerType count = 0; - while (!(bitMask & 0x1) && (count < std::numeric_limits::max())) + IntegerType mask = 0x01; + + if (bitMask == 0) + { + return sizeof(bitMask); // generally invalid value + } + + while ((mask & bitMask) == 0) { - bitMask = static_cast(bitMask >> 1); + mask = static_cast(mask << 1); count++; } return count; diff --git a/src/lib/support/tests/BUILD.gn b/src/lib/support/tests/BUILD.gn index db44ef0d1640ae..25e6e96ad8c9df 100644 --- a/src/lib/support/tests/BUILD.gn +++ b/src/lib/support/tests/BUILD.gn @@ -22,6 +22,7 @@ chip_test_suite("tests") { output_name = "libSupportTests" test_sources = [ + "TestBitMask.cpp", "TestBufferReader.cpp", "TestBufferWriter.cpp", "TestBytesCircularBuffer.cpp", diff --git a/src/lib/support/tests/TestBitMask.cpp b/src/lib/support/tests/TestBitMask.cpp new file mode 100644 index 00000000000000..1745f9295cc126 --- /dev/null +++ b/src/lib/support/tests/TestBitMask.cpp @@ -0,0 +1,119 @@ +/* + * + * Copyright (c) 2022 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +#include +#include +#include +#include + +using namespace chip; + +namespace { + +enum class TestEnum : uint16_t +{ + kZero = 0x0000, // not a valid mask or bit flag, here anyway + + kBit_0 = 0x0001, + kBits_1_2 = 0x0006, + kBits_4_7 = 0x00F0, + kBits_High4 = 0xF000, + kBits_High8 = 0xFF00, +}; + +void TestBitMaskOperations(nlTestSuite * inSuite, void * inContext) +{ + BitMask mask; + + NL_TEST_ASSERT(inSuite, mask.Raw() == 0); + + mask.SetField(TestEnum::kBits_1_2, 2); + NL_TEST_ASSERT(inSuite, mask.Raw() == 0x0004); + + mask.SetRaw(0); + mask.SetField(TestEnum::kBits_4_7, 0x0B); + NL_TEST_ASSERT(inSuite, mask.Raw() == 0x00B0); + + mask.SetRaw(0); + + for (uint16_t i = 0; i < 0x10; i++) + { + mask.SetField(TestEnum::kBits_High4, i); + NL_TEST_ASSERT(inSuite, mask.Raw() == (i << 12)); + } + + mask.SetField(TestEnum::kBits_High8, 0x23); + NL_TEST_ASSERT(inSuite, mask.Raw() == 0x2300); + + mask.SetField(TestEnum::kBits_High4, 0xA); + NL_TEST_ASSERT(inSuite, mask.Raw() == 0xA300); +} + +void TestBitFieldLogic(nlTestSuite * inSuite, void * inContext) +{ + BitMask mask; + + // some general logic that still applies for bit fields just in case + NL_TEST_ASSERT(inSuite, !mask.HasAny(TestEnum::kBits_High4)); + NL_TEST_ASSERT(inSuite, !mask.HasAny(TestEnum::kBits_High8)); + + // setting something non-zero in the upper 4 bits sets "something" in both + // upper and 4 and 8 bits + mask.SetField(TestEnum::kBits_High4, 0x01); + NL_TEST_ASSERT(inSuite, mask.HasAny(TestEnum::kBits_High4)); + NL_TEST_ASSERT(inSuite, mask.HasAny(TestEnum::kBits_High8)); + + // sets something visible in high 8 bits, but not high 4 bits + mask.SetField(TestEnum::kBits_High8, 0x01); + NL_TEST_ASSERT(inSuite, !mask.HasAny(TestEnum::kBits_High4)); + NL_TEST_ASSERT(inSuite, mask.HasAny(TestEnum::kBits_High8)); +} + +void TestBitMaskInvalid(nlTestSuite * inSuite, void * inContext) +{ + BitMask mask; + + // This generally tests for no infinite loops. Nothing to set here + mask.SetField(TestEnum::kZero, 0x01); + NL_TEST_ASSERT(inSuite, mask.Raw() == 0); + + mask.SetRaw(0x1234); + mask.SetField(TestEnum::kZero, 0x01); + NL_TEST_ASSERT(inSuite, mask.Raw() == 0x1234); +} + +const nlTest sTests[] = { + NL_TEST_DEF("BitMask operations", TestBitMaskOperations), // + NL_TEST_DEF("BitFields logic", TestBitFieldLogic), // + NL_TEST_DEF("Invalid operations", TestBitMaskInvalid), // + NL_TEST_SENTINEL() // +}; + +} // namespace + +int TestBitMask() +{ + nlTestSuite theSuite = { "BitMask tests", &sTests[0], nullptr, nullptr }; + + // Run test suit againt one context. + nlTestRunner(&theSuite, nullptr); + return nlTestRunnerStats(&theSuite); +} + +CHIP_REGISTER_TEST_SUITE(TestBitMask) From fea7629d63160d115e48d554c7151960627c99bb Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 2 Jun 2022 09:14:43 -0400 Subject: [PATCH 14/18] Simplify NumericAttributeTraits for BitMask --- .../util/attribute-storage-null-handling.h | 38 +------------------ 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/src/app/util/attribute-storage-null-handling.h b/src/app/util/attribute-storage-null-handling.h index ecd29138506ad2..e1167e6d57a1e7 100644 --- a/src/app/util/attribute-storage-null-handling.h +++ b/src/app/util/attribute-storage-null-handling.h @@ -174,48 +174,12 @@ struct NumericAttributeTraits> }; template -struct NumericAttributeTraits> +struct NumericAttributeTraits> : public NumericAttributeTraits> { using StorageType = T; using WorkingType = BitMask; - 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. - // - constexpr 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 uint8_t * ToAttributeStoreRepresentation(StorageType & value) { return reinterpret_cast(&value); } }; template <> From 35a4324f685434a3420fe1a836428650b6f7c477 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 2 Jun 2022 09:17:12 -0400 Subject: [PATCH 15/18] Remove unused asserts --- src/lib/support/BitMask.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index 7eec937bf6c84f..c20edc60844da8 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -17,10 +17,6 @@ #pragma once -#include - -#include - #include namespace chip { From 34961e802f63f986b2b6e8b5076ff5f6254b2568 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 2 Jun 2022 09:18:39 -0400 Subject: [PATCH 16/18] Slight comment update --- src/lib/support/BitMask.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index c20edc60844da8..64b028be467627 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -69,7 +69,7 @@ class BitMask : public BitFlags * Fields are assumed to be contiguous bits within the underlying integer, for example: * A mask of 0x70 == 0b01110000 means that a 3 bit value is encoded at bits [4;6]. * - * Calling SetField(0x70, n) is equivalent to "((value & ~0x70) | (n << 4)" + * Calling SetField(0x70, n) is equivalent to "(value & ~0x70) | (n << 4)" * * @param mask The mask, code assumes a continous bit mask * @param value The value, NOT shifted, MUST fit within the number of bits of the mask @@ -85,6 +85,7 @@ class BitMask : public BitFlags // Clear bits overlayed by the mask IntegerType updated = static_cast(BitFlags::Raw() & ~bitMask); + // Set the right bits updated |= static_cast(bitMask & (value << shift)); From dcfa742cdc87f876916c0b84af83652806f199ac Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 2 Jun 2022 09:19:22 -0400 Subject: [PATCH 17/18] Slight comment update --- src/lib/support/BitMask.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/support/BitMask.h b/src/lib/support/BitMask.h index 64b028be467627..313f113ad80154 100644 --- a/src/lib/support/BitMask.h +++ b/src/lib/support/BitMask.h @@ -98,7 +98,7 @@ class BitMask : public BitFlags * Gets an underlying field that is contained within a bit subset of the integer. * Examples: * GetField(0x70) == GetField(0b01110000) == ((n & 0x70) >> 4) == ((n >> 4) 0x07) - * GetField(0xB0) == GetField(0b11000000) == ((n & 0xB0) >> 6) == ((n >> 6) 0x03) + * GetField(0xC0) == GetField(0b11000000) == ((n & 0xC0) >> 6) == ((n >> 6) 0x03) * * @param mask The bit mask to be used, assumed to be a contigous bit mask */ From 6f202ed979e64ca2bc0d340c39f42bb53e5b7b9d Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Fri, 3 Jun 2022 13:52:13 -0400 Subject: [PATCH 18/18] Zap regen --- zzz_generated/chip-tool/zap-generated/test/Commands.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index c95289d0c67bdf..5d1391e71e837c 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -35699,8 +35699,8 @@ class Test_TC_WNCV_2_1Suite : public TestCommand LogStep(6, "1f: write a value into the RW mandatory attribute:: Mode"); VerifyOrDo(!ShouldSkip("A_MODE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; - chip::BitFlags value; - value = static_cast>(0); + chip::BitMask value; + value = static_cast>(0); return WriteAttribute(kIdentityAlpha, GetEndpoint(1), WindowCovering::Id, WindowCovering::Attributes::Mode::Id, value, chip::NullOptional, chip::NullOptional); }