diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index ebf78d1228fe3a..6fde7c3f05d557 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -2762,6 +2762,7 @@ server cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; + kReplacementProductList = 0x3; } struct ReplacementProductStruct { @@ -2774,6 +2775,7 @@ server cluster HepaFilterMonitoring = 113 { readonly attribute ChangeIndicationEnum changeIndication = 2; readonly attribute boolean inPlaceIndicator = 3; attribute nullable epoch_s lastChangedTime = 4; + readonly attribute nullable ReplacementProductStruct replacementProductList[] = 5; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2808,6 +2810,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; + kReplacementProductList = 0x3; } struct ReplacementProductStruct { @@ -2820,6 +2823,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { readonly attribute ChangeIndicationEnum changeIndication = 2; readonly attribute boolean inPlaceIndicator = 3; attribute nullable epoch_s lastChangedTime = 4; + readonly attribute nullable ReplacementProductStruct replacementProductList[] = 5; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6332,6 +6336,7 @@ endpoint 1 { callback attribute changeIndication default = 0; callback attribute inPlaceIndicator; callback attribute lastChangedTime; + callback attribute replacementProductList; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; @@ -6346,6 +6351,7 @@ endpoint 1 { callback attribute changeIndication default = 0; callback attribute inPlaceIndicator; callback attribute lastChangedTime; + callback attribute replacementProductList; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap index cdf2aad9cb23a8..b70594a7c2cd7d 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap @@ -14982,7 +14982,23 @@ "side": "server", "type": "epoch_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReplacementProductList", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -15220,7 +15236,23 @@ "side": "server", "type": "epoch_s", "included": 1, - "storageOption": "RAM", + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ReplacementProductList", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", "singleton": 0, "bounded": 0, "defaultValue": null, @@ -31611,4 +31643,4 @@ } ], "log": [] -} \ No newline at end of file +} diff --git a/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp b/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp index 00f681a09e416e..056cbc4be450b3 100644 --- a/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/resource-monitoring-instances.cpp @@ -28,11 +28,13 @@ using namespace chip::app::Clusters::ResourceMonitoring; using chip::Protocols::InteractionModel::Status; constexpr std::bitset<4> gHepaFilterFeatureMap{ static_cast(Feature::kCondition) | - static_cast(Feature::kWarning) }; + static_cast(Feature::kWarning) | + static_cast(Feature::kReplacementProductList) }; constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast(Feature::kCondition) | - static_cast(Feature::kWarning) }; + static_cast(Feature::kWarning) | + static_cast(Feature::kReplacementProductList) }; -static HepaFilterMonitoringInstance * gHepafilterInstance = nullptr; +static HepaFilterMonitoringInstance * gHepaFilterInstance = nullptr; static ActivatedCarbonFilterMonitoringInstance * gActivatedCarbonFilterInstance = nullptr; //-- Activated Carbon Filter Monitoring Instance methods @@ -82,8 +84,7 @@ void emberAfActivatedCarbonFilterMonitoringClusterInitCallback(chip::EndpointId } void emberAfHepaFilterMonitoringClusterInitCallback(chip::EndpointId endpoint) { - VerifyOrDie(gActivatedCarbonFilterInstance == nullptr); - gHepafilterInstance = new HepaFilterMonitoringInstance(endpoint, static_cast(gHepaFilterFeatureMap.to_ulong()), + gHepaFilterInstance = new HepaFilterMonitoringInstance(endpoint, static_cast(gHepaFilterFeatureMap.to_ulong()), DegradationDirectionEnum::kDown, true); - gHepafilterInstance->Init(); + gHepaFilterInstance->Init(); } diff --git a/examples/resource-monitoring-app/linux/BUILD.gn b/examples/resource-monitoring-app/linux/BUILD.gn index 98301831b1b4a4..2c1903ee210fc4 100644 --- a/examples/resource-monitoring-app/linux/BUILD.gn +++ b/examples/resource-monitoring-app/linux/BUILD.gn @@ -31,7 +31,8 @@ config("includes") { executable("chip-resource-monitoring-app") { sources = [ "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common/src/instances/ActivatedCarbonFilterMonitoring.cpp", - "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepafilterMonitoring.cpp", + "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepaFilterMonitoring.cpp", + "${chip_root}/examples/resource-monitoring-app/resource-monitoring-common/src/instances/StaticReplacementProductListManager.cpp", "include/CHIPProjectAppConfig.h", "src/main.cpp", ] diff --git a/examples/resource-monitoring-app/linux/src/main.cpp b/examples/resource-monitoring-app/linux/src/main.cpp index 04e05aa16c2497..19f3409145fb40 100644 --- a/examples/resource-monitoring-app/linux/src/main.cpp +++ b/examples/resource-monitoring-app/linux/src/main.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include using namespace chip; @@ -29,9 +30,11 @@ using namespace chip::app::Clusters; using namespace chip::app::Clusters::ResourceMonitoring; constexpr std::bitset<4> gHepaFilterFeatureMap{ static_cast(Feature::kCondition) | - static_cast(Feature::kWarning) }; + static_cast(Feature::kWarning) | + static_cast(Feature::kReplacementProductList) }; constexpr std::bitset<4> gActivatedCarbonFeatureMap{ static_cast(Feature::kCondition) | - static_cast(Feature::kWarning) }; + static_cast(Feature::kWarning) | + static_cast(Feature::kReplacementProductList) }; static HepaFilterMonitoringInstance gHepaFilterInstance(0x1, static_cast(gHepaFilterFeatureMap.to_ulong()), Clusters::ResourceMonitoring::DegradationDirectionEnum::kDown, true); diff --git a/examples/resource-monitoring-app/resource-monitoring-common/include/instances/StaticReplacementProductListManager.h b/examples/resource-monitoring-app/resource-monitoring-common/include/instances/StaticReplacementProductListManager.h new file mode 100644 index 00000000000000..cb83148302f8b6 --- /dev/null +++ b/examples/resource-monitoring-app/resource-monitoring-common/include/instances/StaticReplacementProductListManager.h @@ -0,0 +1,57 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * 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 +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ResourceMonitoring { + +/** + * This implementation statically defines the options. + */ + +class StaticReplacementProductListManager : public ReplacementProductListManager +{ +public: + uint8_t Size() override { return mReplacementProductListSize; }; + + CHIP_ERROR Next(Attributes::ReplacementProductStruct::Type & item) override; + + ~StaticReplacementProductListManager() {} + StaticReplacementProductListManager(Attributes::ReplacementProductStruct::Type * aReplacementProductsList, + uint8_t aReplacementProductListSize) + { + mReplacementProductsList = aReplacementProductsList; + mReplacementProductListSize = aReplacementProductListSize; + } + +private: + Attributes::ReplacementProductStruct::Type * mReplacementProductsList; + uint8_t mReplacementProductListSize; +}; + +} // namespace ResourceMonitoring +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter index 33710cbe1c87ed..9b036513bcb8ff 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.matter @@ -1519,6 +1519,7 @@ server cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; + kReplacementProductList = 0x3; } struct ReplacementProductStruct { @@ -1531,6 +1532,7 @@ server cluster HepaFilterMonitoring = 113 { readonly attribute ChangeIndicationEnum changeIndication = 2; readonly attribute boolean inPlaceIndicator = 3; attribute nullable epoch_s lastChangedTime = 4; + readonly attribute nullable ReplacementProductStruct replacementProductList[] = 5; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1565,6 +1567,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; + kReplacementProductList = 0x3; } struct ReplacementProductStruct { @@ -1577,6 +1580,7 @@ server cluster ActivatedCarbonFilterMonitoring = 114 { readonly attribute ChangeIndicationEnum changeIndication = 2; readonly attribute boolean inPlaceIndicator = 3; attribute nullable epoch_s lastChangedTime = 4; + readonly attribute nullable ReplacementProductStruct replacementProductList[] = 5; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1984,6 +1988,7 @@ endpoint 1 { callback attribute changeIndication default = 0; callback attribute inPlaceIndicator; callback attribute lastChangedTime; + callback attribute replacementProductList; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; @@ -1998,6 +2003,7 @@ endpoint 1 { callback attribute changeIndication default = 0; callback attribute inPlaceIndicator; callback attribute lastChangedTime; + callback attribute replacementProductList; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; diff --git a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap index 28fa23e068c377..fc6b03ba7dcd40 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap +++ b/examples/resource-monitoring-app/resource-monitoring-common/resource-monitoring-app.zap @@ -6241,6 +6241,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "ReplacementProductList", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, @@ -6479,6 +6495,22 @@ "maxInterval": 65534, "reportableChange": 0 }, + { + "name": "ReplacementProductList", + "code": 5, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, { "name": "GeneratedCommandList", "code": 65528, diff --git a/examples/resource-monitoring-app/resource-monitoring-common/src/instances/ActivatedCarbonFilterMonitoring.cpp b/examples/resource-monitoring-app/resource-monitoring-common/src/instances/ActivatedCarbonFilterMonitoring.cpp index f22c9590e1c8c3..9c12f2367d54de 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/src/instances/ActivatedCarbonFilterMonitoring.cpp +++ b/examples/resource-monitoring-app/resource-monitoring-common/src/instances/ActivatedCarbonFilterMonitoring.cpp @@ -22,20 +22,39 @@ #include #include #include +#include #include #include #include #include +#define ACTIVATED_CARBON_FILTER_REPLACEMENT_PRODUCT_LIST_SIZE 3 + using namespace chip::app::Clusters; using namespace chip::app::Clusters::ActivatedCarbonFilterMonitoring; using namespace chip::app::Clusters::ResourceMonitoring; using chip::Protocols::InteractionModel::Status; -//-- Hepa filter Monitoring Instance methods +static ResourceMonitoring::Attributes::ReplacementProductStruct::Type + sActivatedCarbonFilterReplacementProductsList[ACTIVATED_CARBON_FILTER_REPLACEMENT_PRODUCT_LIST_SIZE]; +StaticReplacementProductListManager + sActivatedCarbonFilterReplacementProductListManager(&sActivatedCarbonFilterReplacementProductsList[0], + ACTIVATED_CARBON_FILTER_REPLACEMENT_PRODUCT_LIST_SIZE); + +//-- Activated carbon filter Monitoring Instance methods CHIP_ERROR ActivatedCarbonFilterMonitoringInstance::AppInit() { ChipLogDetail(Zcl, "ActivatedCarbonFilterMonitoringDelegate::Init()"); + + sActivatedCarbonFilterReplacementProductsList[0].productIdentifierType = ProductIdentifierTypeEnum::kUpc; + sActivatedCarbonFilterReplacementProductsList[0].productIdentifierValue = "upc12xcarbon"; + sActivatedCarbonFilterReplacementProductsList[1].productIdentifierType = ProductIdentifierTypeEnum::kGtin8; + sActivatedCarbonFilterReplacementProductsList[1].productIdentifierValue = "gtin8xca"; + sActivatedCarbonFilterReplacementProductsList[2].productIdentifierType = ProductIdentifierTypeEnum::kEan; + sActivatedCarbonFilterReplacementProductsList[2].productIdentifierValue = "ean13xacarbon"; + + SetReplacementProductListManagerInstance(&sActivatedCarbonFilterReplacementProductListManager); + return CHIP_NO_ERROR; } diff --git a/examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepafilterMonitoring.cpp b/examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepafilterMonitoring.cpp index ae93411a38b902..565536f2c98ebd 100644 --- a/examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepafilterMonitoring.cpp +++ b/examples/resource-monitoring-app/resource-monitoring-common/src/instances/HepafilterMonitoring.cpp @@ -20,22 +20,41 @@ #include #include #include +#include #include #include +#include #include #include #include #include +#include + +#define HEPA_FILTER_REPLACEMENT_PRODUCT_LIST_SIZE 3 using namespace chip::app::Clusters; -using namespace chip::app::Clusters::HepaFilterMonitoring; using namespace chip::app::Clusters::ResourceMonitoring; using chip::Protocols::InteractionModel::Status; +static ResourceMonitoring::Attributes::ReplacementProductStruct::Type + sHepaFilterReplacementProductsList[HEPA_FILTER_REPLACEMENT_PRODUCT_LIST_SIZE]; +StaticReplacementProductListManager sHepaFilterReplacementProductListManager(&sHepaFilterReplacementProductsList[0], + HEPA_FILTER_REPLACEMENT_PRODUCT_LIST_SIZE); + //-- Hepa filter Monitoring instance methods CHIP_ERROR HepaFilterMonitoringInstance::AppInit() { ChipLogDetail(Zcl, "HepaFilterMonitoringInstance::Init()"); + + sHepaFilterReplacementProductsList[0].productIdentifierType = ProductIdentifierTypeEnum::kUpc; + sHepaFilterReplacementProductsList[0].productIdentifierValue = "upc12xhepaxx"; + sHepaFilterReplacementProductsList[1].productIdentifierType = ProductIdentifierTypeEnum::kGtin8; + sHepaFilterReplacementProductsList[1].productIdentifierValue = "gtin8xhe"; + sHepaFilterReplacementProductsList[2].productIdentifierType = ProductIdentifierTypeEnum::kEan; + sHepaFilterReplacementProductsList[2].productIdentifierValue = "ean13xhepaxxx"; + + SetReplacementProductListManagerInstance(&sHepaFilterReplacementProductListManager); + return CHIP_NO_ERROR; } diff --git a/examples/resource-monitoring-app/resource-monitoring-common/src/instances/StaticReplacementProductListManager.cpp b/examples/resource-monitoring-app/resource-monitoring-common/src/instances/StaticReplacementProductListManager.cpp new file mode 100644 index 00000000000000..5acdcbf2fcc37e --- /dev/null +++ b/examples/resource-monitoring-app/resource-monitoring-common/src/instances/StaticReplacementProductListManager.cpp @@ -0,0 +1,40 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * 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 + +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::ResourceMonitoring; + +CHIP_ERROR StaticReplacementProductListManager::Next(Attributes::ReplacementProductStruct::Type & item) +{ + ChipLogDetail(Zcl, "StaticReplacementProductListManager::Next()"); + + if (mReplacementProductListSize > mIndex) + { + item = mReplacementProductsList[mIndex]; + mIndex++; + return CHIP_NO_ERROR; + } + + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; +} diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index 0f4dd4fe183d91..51bee460f09346 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -271,6 +271,7 @@ template("chip_data_model") { sources += [ "${_app_root}/clusters/${cluster}/${cluster}.cpp", "${_app_root}/clusters/${cluster}/${cluster}.h", + "${_app_root}/clusters/${cluster}/replacement-product-list-manager.h", "${_app_root}/clusters/${cluster}/resource-monitoring-cluster-objects.cpp", "${_app_root}/clusters/${cluster}/resource-monitoring-cluster-objects.h", ] diff --git a/src/app/clusters/fan-control-server/fan-control-server.cpp b/src/app/clusters/fan-control-server/fan-control-server.cpp index ca50fb06662283..9437d821c0631b 100644 --- a/src/app/clusters/fan-control-server/fan-control-server.cpp +++ b/src/app/clusters/fan-control-server/fan-control-server.cpp @@ -68,7 +68,7 @@ Delegate * GetDelegate(EndpointId endpoint) void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) { uint16_t ep = - emberAfGetClusterServerEndpointIndex(endpoint, FanControl::Id, EMBER_AF_APPLICATION_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT); + emberAfGetClusterServerEndpointIndex(endpoint, FanControl::Id, EMBER_AF_FAN_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT); // if endpoint is found if (ep < kFanControlDelegateTableSize) { diff --git a/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h b/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h new file mode 100644 index 00000000000000..b252597306c21a --- /dev/null +++ b/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h @@ -0,0 +1,54 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * 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 +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ResourceMonitoring { + +/** + * Interface to help manage the replacement product list in the Resource Monitoring Cluster. + */ +class ReplacementProductListManager +{ +public: + ReplacementProductListManager() {} + virtual ~ReplacementProductListManager() = default; + + void Reset() { mIndex = 0; } + + // Returns total size of Replacement Products List. + virtual uint8_t Size() = 0; + + virtual CHIP_ERROR Next(Attributes::ReplacementProductStruct::Type & item) = 0; + +protected: + uint8_t mIndex; +}; + +} // namespace ResourceMonitoring +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.cpp b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.cpp index 34388cba90c4d9..932c95ce3a77ee 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.cpp +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.cpp @@ -44,6 +44,22 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace ResetCondition. } // namespace Commands +namespace Attributes { +namespace ReplacementProductStruct { + +CHIP_ERROR Type::Encode(TLV::TLVWriter & writer, TLV::Tag tag) const +{ + TLV::TLVType outer; + ReturnErrorOnFailure(writer.StartContainer(tag, TLV::kTLVType_Structure, outer)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kProductIdentifierType), productIdentifierType)); + ReturnErrorOnFailure(DataModel::Encode(writer, TLV::ContextTag(Fields::kProductIdentifierValue), productIdentifierValue)); + ReturnErrorOnFailure(writer.EndContainer(outer)); + return CHIP_NO_ERROR; +} + +} // namespace ReplacementProductStruct +} // namespace Attributes + } // namespace ResourceMonitoring } // namespace Clusters } // namespace app diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h index e6fdf35dfce6ba..2ae312e350820c 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-cluster-objects.h @@ -29,7 +29,10 @@ namespace app { namespace Clusters { namespace ResourceMonitoring { -static constexpr std::array AliasedClusters = { 0x0071, 0x0072 }; +#define HEPA_FILTER_CLUSTER_ID 0x0071 +#define ACTIVATED_CARBON_FILTER_CLUSTER_ID 0x0072 + +static constexpr std::array AliasedClusters = { HEPA_FILTER_CLUSTER_ID, ACTIVATED_CARBON_FILTER_CLUSTER_ID }; // Enum for ChangeIndicationEnum enum class ChangeIndicationEnum : uint8_t @@ -57,11 +60,31 @@ enum class DegradationDirectionEnum : uint8_t }; // Bitmap for Feature -enum class Feature : uint32_t +enum class Feature : uint8_t { - kCondition = 0x1, - kWarning = 0x2, - // TODO(#27577): add server support for REP feature (ReplacementProductList) + kCondition = 0x1, + kWarning = 0x2, + kReplacementProductList = 0x3, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = UINT8_MAX, +}; + +// Enum for ProductIdentifierTypeEnum +enum class ProductIdentifierTypeEnum : uint8_t +{ + kUpc = 0x00, + kGtin8 = 0x01, + kEan = 0x02, + kGtin14 = 0x03, + kOem = 0x04, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = UINT8_MAX, }; namespace Attributes { @@ -131,6 +154,43 @@ struct TypeInfo }; } // namespace LastChangedTime +namespace ReplacementProductStruct { +enum class Fields : uint8_t +{ + kProductIdentifierType = 0, + kProductIdentifierValue = 1, +}; + +struct Type +{ +public: + ProductIdentifierTypeEnum productIdentifierType = static_cast(0); + chip::CharSpan productIdentifierValue; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & writer, TLV::Tag tag) const; +}; + +using DecodableType = Type; + +} // namespace ReplacementProductStruct + +namespace ReplacementProductList { +static constexpr AttributeId Id = 0x00000005; +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = const chip::app::DataModel::DecodableList &; + + static constexpr AttributeId GetAttributeId() { return Attributes::ReplacementProductList::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ReplacementProductList + namespace GeneratedCommandList { static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp index 17a19fa89f2e08..4aabb4e957a35c 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp @@ -123,6 +123,11 @@ chip::Protocols::InteractionModel::Status Instance::UpdateLastChangedTime(DataMo return Protocols::InteractionModel::Status::Success; } +void Instance::SetReplacementProductListManagerInstance(ReplacementProductListManager * aReplacementProductListManager) +{ + mReplacementProductListManager = aReplacementProductListManager; +} + uint8_t Instance::GetCondition() const { return mCondition; @@ -147,6 +152,11 @@ DataModel::Nullable Instance::GetLastChangedTime() const return mLastChangedTime; } +ReplacementProductListManager * Instance::GetReplacementProductListManagerInstance() +{ + return mReplacementProductListManager; +} + Status Instance::OnResetCondition() { ChipLogDetail(Zcl, "ResourceMonitoringServer::OnResetCondition()"); @@ -232,6 +242,32 @@ CHIP_ERROR Instance::EnumerateAcceptedCommands(const ConcreteClusterPath & clust return CHIP_NO_ERROR; } +CHIP_ERROR Instance::ReadReplacableProductList(AttributeValueEncoder & aEncoder) +{ + CHIP_ERROR err; + if (Instance::HasFeature(ResourceMonitoring::Feature::kReplacementProductList)) + { + ReplacementProductListManager * instance = Instance::GetReplacementProductListManagerInstance(); + if (nullptr == instance) + { + aEncoder.EncodeEmptyList(); + return CHIP_NO_ERROR; + } + + instance->Reset(); + + err = aEncoder.EncodeList([&](const auto & encoder) -> CHIP_ERROR { + Attributes::ReplacementProductStruct::Type replacementProductStruct; + while (instance->Next(replacementProductStruct) == CHIP_NO_ERROR) + { + ReturnErrorOnFailure(encoder.Encode(replacementProductStruct)); + } + return CHIP_NO_ERROR; + }); + } + return CHIP_NO_ERROR; +} + // Implements the read functionality for non-standard attributes. CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) { @@ -261,6 +297,10 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu ReturnErrorOnFailure(aEncoder.Encode(mLastChangedTime)); break; } + case Attributes::ReplacementProductList::Id: { + return ReadReplacableProductList(aEncoder); + break; + } } return CHIP_NO_ERROR; } diff --git a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h index cc846bab94420d..f025c01383ba81 100644 --- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h +++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -68,12 +69,15 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface chip::Protocols::InteractionModel::Status UpdateInPlaceIndicator(bool aNewInPlaceIndicator); chip::Protocols::InteractionModel::Status UpdateLastChangedTime(DataModel::Nullable aNewLastChangedTime); + void SetReplacementProductListManagerInstance(ReplacementProductListManager * instance); + // Attribute getters uint8_t GetCondition() const; ChangeIndicationEnum GetChangeIndication() const; DegradationDirectionEnum GetDegradationDirection() const; bool GetInPlaceIndicator() const; DataModel::Nullable GetLastChangedTime() const; + EndpointId GetEndpointId() const { return mEndpointId; } /** @@ -161,11 +165,16 @@ class Instance : public CommandHandlerInterface, public AttributeAccessInterface ChangeIndicationEnum mChangeIndication = ChangeIndicationEnum::kOk; bool mInPlaceIndicator = true; DataModel::Nullable mLastChangedTime; + ReplacementProductListManager * mReplacementProductListManager; uint32_t mFeatureMap; bool mResetConditionCommandSupported = false; + ReplacementProductListManager * GetReplacementProductListManagerInstance(); + + CHIP_ERROR ReadReplacableProductList(AttributeValueEncoder & aEncoder); + // CommandHandlerInterface void InvokeCommand(HandlerContext & ctx) override; CHIP_ERROR EnumerateAcceptedCommands(const ConcreteClusterPath & cluster, CommandIdCallback callback, void * context) override; diff --git a/src/app/tests/suites/certification/PICS.yaml b/src/app/tests/suites/certification/PICS.yaml index a03094011180d9..ecadf80a87ea1b 100644 --- a/src/app/tests/suites/certification/PICS.yaml +++ b/src/app/tests/suites/certification/PICS.yaml @@ -3880,6 +3880,12 @@ PICS: - label: "Does the device implement the InPlaceIndicator attribute?" id: HEPAFREMON.S.A0003 + - label: "Does the device implement the LastChangedTime attribute?" + id: HEPAFREMON.S.A0004 + + - label: "Does the device implement the ReplacementProductList attribute?" + id: HEPAFREMON.S.A0005 + # # server / features # @@ -3889,6 +3895,9 @@ PICS: - label: "Does the device support the Warning feature?" id: HEPAFREMON.S.F01 + - label: "Does the device support the ReplacementProductList feature?" + id: HEPAFREMON.S.F02 + # # server / commandsReceived # @@ -3921,6 +3930,12 @@ PICS: - label: "Does the device implement the InPlaceIndicator attribute?" id: ACFREMON.S.A0003 + - label: "Does the device implement the LastChangedTime attribute?" + id: ACFREMON.S.A0004 + + - label: "Does the device implement the ReplacementProductList attribute?" + id: ACFREMON.S.A0005 + # # server / features # @@ -3930,6 +3945,9 @@ PICS: - label: "Does the device support the Warning feature?" id: ACFREMON.S.F01 + - label: "Does the device support the ReplacementProductList feature?" + id: ACFREMON.S.F02 + # # server / commandsReceived # diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml index a52bec17438e32..183a3569dc265e 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_1_1.yaml @@ -42,7 +42,7 @@ tests: - label: "Step 3a: Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: "!ACFREMON.S.F00 && !ACFREMON.S.F01" + PICS: "!ACFREMON.S.F00 && !ACFREMON.S.F01 && !ACFREMON.S.F02" response: value: 0 constraints: @@ -70,6 +70,17 @@ tests: type: bitmap32 hasMasksSet: [0x2] + - label: + "Step 3d: Given ACFREMON.S.F01(ReplacementProductList) ensure + featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: ACFREMON.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x3] + - label: "Step 4a: Read the global attribute: AttributeList" command: "readAttribute" attribute: "AttributeList" @@ -87,7 +98,7 @@ tests: response: constraints: type: list - contains: [0, 1] + contains: [0, 1, 2] - label: "Step 4c: Read the optional attribute InPlaceIndicator diff --git a/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml index b4b6cd2e6f91a5..797e87c5adfe18 100644 --- a/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_ACFREMON_2_1.yaml @@ -69,3 +69,20 @@ tests: response: constraints: type: boolean + + - label: "Step 6: TH reads from the DUT the LastChangedTime attribute" + PICS: ACFREMON.S.A0004 + command: "readAttribute" + attribute: "LastChangedTime" + response: + constraints: + type: epoch_s + + - label: + "Step 7: TH reads from the DUT the ReplacementProductList attribute" + PICS: ACFREMON.S.A0005 + command: "readAttribute" + attribute: "ReplacementProductList" + response: + constraints: + type: list diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml index 5b35a2d2765108..e45f21f5278bfb 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_1_1.yaml @@ -42,7 +42,7 @@ tests: - label: "Step 3a: Read the global attribute: FeatureMap" command: "readAttribute" attribute: "FeatureMap" - PICS: "!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01" + PICS: "!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01 && !HEPAFREMON.S.F02" response: value: 0 constraints: @@ -70,6 +70,17 @@ tests: type: bitmap32 hasMasksSet: [0x2] + - label: + "Step 3d: Given HEPAFREMON.S.F02(ReplacementProductList) ensure + featuremap has the correct bit set" + command: "readAttribute" + attribute: "FeatureMap" + PICS: HEPAFREMON.S.F02 + response: + constraints: + type: bitmap32 + hasMasksSet: [0x3] + - label: "Step 4: Read the global attribute: AttributeList" command: "readAttribute" attribute: "AttributeList" @@ -87,7 +98,7 @@ tests: response: constraints: type: list - contains: [0, 1] + contains: [0, 1, 2] - label: "Step 4b: Read the optional attribute InPlaceIndicator diff --git a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml index cb2f281eebdc48..d232c3af497b2c 100644 --- a/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml +++ b/src/app/tests/suites/certification/Test_TC_HEPAFREMON_2_1.yaml @@ -69,3 +69,20 @@ tests: response: constraints: type: boolean + + - label: "Step 6: TH reads from the DUT the LastChangedTime attribute" + PICS: HEPAFREMON.S.A0004 + command: "readAttribute" + attribute: "LastChangedTime" + response: + constraints: + type: epoch_s + + - label: + "Step 7: TH reads from the DUT the ReplacementProductList attribute" + PICS: HEPAFREMON.S.A0005 + command: "readAttribute" + attribute: "ReplacementProductList" + response: + constraints: + type: list diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index 4673d65346c08f..c80ac9169fd963 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -2171,10 +2171,13 @@ HEPAFREMON.S=1 HEPAFREMON.C=0 HEPAFREMON.S.F00=1 HEPAFREMON.S.F01=1 +HEPAFREMON.S.F02=1 HEPAFREMON.S.A0000=1 HEPAFREMON.S.A0001=1 HEPAFREMON.S.A0002=1 HEPAFREMON.S.A0003=1 +HEPAFREMON.S.A0004=1 +HEPAFREMON.S.A0005=1 HEPAFREMON.S.C00.Rsp=0 # Activated Carbon Filter Monitoring Cluster @@ -2182,10 +2185,13 @@ ACFREMON.S=1 ACFREMON.C=0 ACFREMON.S.F00=1 ACFREMON.S.F01=1 +ACFREMON.S.F02=1 ACFREMON.S.A0000=1 ACFREMON.S.A0001=1 ACFREMON.S.A0002=1 ACFREMON.S.A0003=1 +ACFREMON.S.A0004=1 +ACFREMON.S.A0005=1 ACFREMON.S.C00.Rsp=0 # Air Quality @@ -2541,4 +2547,4 @@ RVCCLEANMS.S.A0005=1 #Commands: RVCCLEANMS.S.C00.Rsp=1 RVCCLEANMS.S.C01.Rsp=1 -RVCCLEANMS.S.C03.Tx=1 \ No newline at end of file +RVCCLEANMS.S.C03.Tx=1 diff --git a/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml index add05a191d4a75..02000a81ba6d64 100644 --- a/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml @@ -31,7 +31,7 @@ limitations under the License. ChangeIndication InPlaceIndicator LastChangedTime - ReplacementProductList + ReplacementProductList @@ -54,7 +54,7 @@ limitations under the License. ChangeIndication InPlaceIndicator LastChangedTime - ReplacementProductList + ReplacementProductList @@ -68,6 +68,7 @@ limitations under the License. + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index d958e671819f20..59d5ba3e1a03f1 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -332,6 +332,7 @@ "ChangeIndication", "InPlaceIndicator", "LastChangedTime", + "ReplacementProductList", "FeatureMap" ], "HEPA Filter Monitoring": [ @@ -340,6 +341,7 @@ "ChangeIndication", "InPlaceIndicator", "LastChangedTime", + "ReplacementProductList", "FeatureMap" ] }, diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 3187abd98c7aaf..7d4d89ec6b4107 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -330,6 +330,7 @@ "ChangeIndication", "InPlaceIndicator", "LastChangedTime", + "ReplacementProductList", "FeatureMap" ], "HEPA Filter Monitoring": [ @@ -338,6 +339,7 @@ "ChangeIndication", "InPlaceIndicator", "LastChangedTime", + "ReplacementProductList", "FeatureMap" ] }, diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index a565b48f760df6..2d42db65f0c58a 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -3469,6 +3469,7 @@ client cluster HepaFilterMonitoring = 113 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; + kReplacementProductList = 0x3; } struct ReplacementProductStruct { @@ -3481,7 +3482,7 @@ client cluster HepaFilterMonitoring = 113 { readonly attribute ChangeIndicationEnum changeIndication = 2; readonly attribute optional boolean inPlaceIndicator = 3; attribute optional nullable epoch_s lastChangedTime = 4; - readonly attribute optional ReplacementProductStruct replacementProductList[] = 5; + readonly attribute optional nullable ReplacementProductStruct replacementProductList[] = 5; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3517,6 +3518,7 @@ client cluster ActivatedCarbonFilterMonitoring = 114 { bitmap Feature : BITMAP32 { kCondition = 0x1; kWarning = 0x2; + kReplacementProductList = 0x3; } struct ReplacementProductStruct { @@ -3529,7 +3531,7 @@ client cluster ActivatedCarbonFilterMonitoring = 114 { readonly attribute ChangeIndicationEnum changeIndication = 2; readonly attribute optional boolean inPlaceIndicator = 3; attribute optional nullable epoch_s lastChangedTime = 4; - readonly attribute optional ReplacementProductStruct replacementProductList[] = 5; + readonly attribute optional nullable ReplacementProductStruct replacementProductList[] = 5; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index ac21a7212f3ecb..f9b1516c920d9f 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -15769,43 +15769,52 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) + if (cppValue.IsNull()) { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - jobject newElement_0_productIdentifierType; - std::string newElement_0_productIdentifierTypeClassName = "java/lang/Integer"; - std::string newElement_0_productIdentifierTypeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_productIdentifierTypeClassName.c_str(), newElement_0_productIdentifierTypeCtorSignature.c_str(), - static_cast(entry_0.productIdentifierType), newElement_0_productIdentifierType); - jobject newElement_0_productIdentifierValue; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.productIdentifierValue, - newElement_0_productIdentifierValue)); + value = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(value); - jclass replacementProductStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct", - replacementProductStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct"); - return nullptr; - } - jmethodID replacementProductStructStructCtor_1 = - env->GetMethodID(replacementProductStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); - if (replacementProductStructStructCtor_1 == nullptr) + auto iter_value_1 = cppValue.Value().begin(); + while (iter_value_1.Next()) { - ChipLogError(Zcl, "Could not find ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct constructor"); - return nullptr; - } + auto & entry_1 = iter_value_1.GetValue(); + jobject newElement_1; + jobject newElement_1_productIdentifierType; + std::string newElement_1_productIdentifierTypeClassName = "java/lang/Integer"; + std::string newElement_1_productIdentifierTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1_productIdentifierTypeClassName.c_str(), + newElement_1_productIdentifierTypeCtorSignature.c_str(), + static_cast(entry_1.productIdentifierType), newElement_1_productIdentifierType); + jobject newElement_1_productIdentifierValue; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.productIdentifierValue, + newElement_1_productIdentifierValue)); + + jclass replacementProductStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct", + replacementProductStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct"); + return nullptr; + } + jmethodID replacementProductStructStructCtor_2 = env->GetMethodID( + replacementProductStructStructClass_2, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (replacementProductStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct constructor"); + return nullptr; + } - newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, - newElement_0_productIdentifierType, newElement_0_productIdentifierValue); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); + newElement_1 = env->NewObject(replacementProductStructStructClass_2, replacementProductStructStructCtor_2, + newElement_1_productIdentifierType, newElement_1_productIdentifierValue); + chip::JniReferences::GetInstance().AddToList(value, newElement_1); + } } return value; } @@ -16036,46 +16045,54 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) + if (cppValue.IsNull()) { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - jobject newElement_0_productIdentifierType; - std::string newElement_0_productIdentifierTypeClassName = "java/lang/Integer"; - std::string newElement_0_productIdentifierTypeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_productIdentifierTypeClassName.c_str(), newElement_0_productIdentifierTypeCtorSignature.c_str(), - static_cast(entry_0.productIdentifierType), newElement_0_productIdentifierType); - jobject newElement_0_productIdentifierValue; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.productIdentifierValue, - newElement_0_productIdentifierValue)); + value = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(value); - jclass replacementProductStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct", - replacementProductStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, - "Could not find class ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct"); - return nullptr; - } - jmethodID replacementProductStructStructCtor_1 = - env->GetMethodID(replacementProductStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); - if (replacementProductStructStructCtor_1 == nullptr) + auto iter_value_1 = cppValue.Value().begin(); + while (iter_value_1.Next()) { - ChipLogError( - Zcl, - "Could not find ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct constructor"); - return nullptr; - } + auto & entry_1 = iter_value_1.GetValue(); + jobject newElement_1; + jobject newElement_1_productIdentifierType; + std::string newElement_1_productIdentifierTypeClassName = "java/lang/Integer"; + std::string newElement_1_productIdentifierTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1_productIdentifierTypeClassName.c_str(), + newElement_1_productIdentifierTypeCtorSignature.c_str(), + static_cast(entry_1.productIdentifierType), newElement_1_productIdentifierType); + jobject newElement_1_productIdentifierValue; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.productIdentifierValue, + newElement_1_productIdentifierValue)); + + jclass replacementProductStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct", + replacementProductStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError( + Zcl, "Could not find class ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct"); + return nullptr; + } + jmethodID replacementProductStructStructCtor_2 = env->GetMethodID( + replacementProductStructStructClass_2, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (replacementProductStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct " + "constructor"); + return nullptr; + } - newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, - newElement_0_productIdentifierType, newElement_0_productIdentifierValue); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); + newElement_1 = env->NewObject(replacementProductStructStructClass_2, replacementProductStructStructCtor_2, + newElement_1_productIdentifierType, newElement_1_productIdentifierValue); + chip::JniReferences::GetInstance().AddToList(value, newElement_1); + } } return value; } diff --git a/src/controller/java/zap-generated/CHIPClientCallbacks.h b/src/controller/java/zap-generated/CHIPClientCallbacks.h index bb720087e2f2ad..fc97070afc763f 100644 --- a/src/controller/java/zap-generated/CHIPClientCallbacks.h +++ b/src/controller/java/zap-generated/CHIPClientCallbacks.h @@ -618,8 +618,8 @@ typedef void (*RvcOperationalStateAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringReplacementProductListListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::HepaFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> & data); + const chip::app::DataModel::Nullable> & data); typedef void (*HepaFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*HepaFilterMonitoringAcceptedCommandListListAttributeCallback)( @@ -630,8 +630,8 @@ typedef void (*HepaFilterMonitoringAttributeListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ActivatedCarbonFilterMonitoringReplacementProductListListAttributeCallback)( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> & data); + const chip::app::DataModel::Nullable> & data); typedef void (*ActivatedCarbonFilterMonitoringGeneratedCommandListListAttributeCallback)( void * context, const chip::app::DataModel::DecodableList & data); typedef void (*ActivatedCarbonFilterMonitoringAcceptedCommandListListAttributeCallback)( diff --git a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp index cebbeeb5f631ae..c119edc9dbc678 100644 --- a/src/controller/java/zap-generated/CHIPReadCallbacks.cpp +++ b/src/controller/java/zap-generated/CHIPReadCallbacks.cpp @@ -25676,8 +25676,8 @@ CHIPHepaFilterMonitoringReplacementProductListAttributeCallback::~CHIPHepaFilter void CHIPHepaFilterMonitoringReplacementProductListAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::HepaFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> & list) + const chip::app::DataModel::Nullable> & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -25699,43 +25699,50 @@ void CHIPHepaFilterMonitoringReplacementProductListAttributeCallback::CallbackFn VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) + if (list.IsNull()) { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - jobject newElement_0_productIdentifierType; - std::string newElement_0_productIdentifierTypeClassName = "java/lang/Integer"; - std::string newElement_0_productIdentifierTypeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_productIdentifierTypeClassName.c_str(), newElement_0_productIdentifierTypeCtorSignature.c_str(), - static_cast(entry_0.productIdentifierType), newElement_0_productIdentifierType); - jobject newElement_0_productIdentifierValue; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.productIdentifierValue, - newElement_0_productIdentifierValue)); + arrayListObj = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - jclass replacementProductStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct", - replacementProductStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct"); - return; - } - jmethodID replacementProductStructStructCtor_1 = - env->GetMethodID(replacementProductStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); - if (replacementProductStructStructCtor_1 == nullptr) + auto iter_arrayListObj_1 = list.Value().begin(); + while (iter_arrayListObj_1.Next()) { - ChipLogError(Zcl, "Could not find ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct constructor"); - return; - } + auto & entry_1 = iter_arrayListObj_1.GetValue(); + jobject newElement_1; + jobject newElement_1_productIdentifierType; + std::string newElement_1_productIdentifierTypeClassName = "java/lang/Integer"; + std::string newElement_1_productIdentifierTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1_productIdentifierTypeClassName.c_str(), newElement_1_productIdentifierTypeCtorSignature.c_str(), + static_cast(entry_1.productIdentifierType), newElement_1_productIdentifierType); + jobject newElement_1_productIdentifierValue; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.productIdentifierValue, + newElement_1_productIdentifierValue)); - newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, - newElement_0_productIdentifierType, newElement_0_productIdentifierValue); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + jclass replacementProductStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct", + replacementProductStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct"); + return; + } + jmethodID replacementProductStructStructCtor_2 = + env->GetMethodID(replacementProductStructStructClass_2, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (replacementProductStructStructCtor_2 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$HepaFilterMonitoringClusterReplacementProductStruct constructor"); + return; + } + + newElement_1 = env->NewObject(replacementProductStructStructClass_2, replacementProductStructStructCtor_2, + newElement_1_productIdentifierType, newElement_1_productIdentifierValue); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_1); + } } env->ExceptionClear(); @@ -26128,8 +26135,8 @@ CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback:: void CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback::CallbackFn( void * context, - const chip::app::DataModel::DecodableList< - chip::app::Clusters::ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> & list) + const chip::app::DataModel::Nullable> & list) { chip::DeviceLayer::StackUnlock unlock; CHIP_ERROR err = CHIP_NO_ERROR; @@ -26152,44 +26159,52 @@ void CHIPActivatedCarbonFilterMonitoringReplacementProductListAttributeCallback: VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(Zcl, "Could not find onSuccess() method")); jobject arrayListObj; - chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - - auto iter_arrayListObj_0 = list.begin(); - while (iter_arrayListObj_0.Next()) + if (list.IsNull()) { - auto & entry_0 = iter_arrayListObj_0.GetValue(); - jobject newElement_0; - jobject newElement_0_productIdentifierType; - std::string newElement_0_productIdentifierTypeClassName = "java/lang/Integer"; - std::string newElement_0_productIdentifierTypeCtorSignature = "(I)V"; - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_productIdentifierTypeClassName.c_str(), newElement_0_productIdentifierTypeCtorSignature.c_str(), - static_cast(entry_0.productIdentifierType), newElement_0_productIdentifierType); - jobject newElement_0_productIdentifierValue; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.productIdentifierValue, - newElement_0_productIdentifierValue)); + arrayListObj = nullptr; + } + else + { + chip::JniReferences::GetInstance().CreateArrayList(arrayListObj); - jclass replacementProductStructStructClass_1; - err = chip::JniReferences::GetInstance().GetClassRef( - env, "chip/devicecontroller/ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct", - replacementProductStructStructClass_1); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct"); - return; - } - jmethodID replacementProductStructStructCtor_1 = - env->GetMethodID(replacementProductStructStructClass_1, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); - if (replacementProductStructStructCtor_1 == nullptr) + auto iter_arrayListObj_1 = list.Value().begin(); + while (iter_arrayListObj_1.Next()) { - ChipLogError(Zcl, - "Could not find ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct constructor"); - return; - } + auto & entry_1 = iter_arrayListObj_1.GetValue(); + jobject newElement_1; + jobject newElement_1_productIdentifierType; + std::string newElement_1_productIdentifierTypeClassName = "java/lang/Integer"; + std::string newElement_1_productIdentifierTypeCtorSignature = "(I)V"; + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_1_productIdentifierTypeClassName.c_str(), newElement_1_productIdentifierTypeCtorSignature.c_str(), + static_cast(entry_1.productIdentifierType), newElement_1_productIdentifierType); + jobject newElement_1_productIdentifierValue; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_1.productIdentifierValue, + newElement_1_productIdentifierValue)); - newElement_0 = env->NewObject(replacementProductStructStructClass_1, replacementProductStructStructCtor_1, - newElement_0_productIdentifierType, newElement_0_productIdentifierValue); - chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_0); + jclass replacementProductStructStructClass_2; + err = chip::JniReferences::GetInstance().GetClassRef( + env, "chip/devicecontroller/ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct", + replacementProductStructStructClass_2); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, + "Could not find class ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct"); + return; + } + jmethodID replacementProductStructStructCtor_2 = + env->GetMethodID(replacementProductStructStructClass_2, "", "(Ljava/lang/Integer;Ljava/lang/String;)V"); + if (replacementProductStructStructCtor_2 == nullptr) + { + ChipLogError( + Zcl, "Could not find ChipStructs$ActivatedCarbonFilterMonitoringClusterReplacementProductStruct constructor"); + return; + } + + newElement_1 = env->NewObject(replacementProductStructStructClass_2, replacementProductStructStructCtor_2, + newElement_1_productIdentifierType, newElement_1_productIdentifierValue); + chip::JniReferences::GetInstance().AddToList(arrayListObj, newElement_1); + } } env->ExceptionClear(); diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java index 97185a802f168f..1d0bea3f59178e 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ChipClusters.java @@ -17419,7 +17419,7 @@ public interface LastChangedTimeAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } public interface ReplacementProductListAttributeCallback { - void onSuccess( List valueList); + void onSuccess(@Nullable List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } @@ -17712,7 +17712,7 @@ public interface LastChangedTimeAttributeCallback { default void onSubscriptionEstablished(long subscriptionId) {} } public interface ReplacementProductListAttributeCallback { - void onSuccess( List valueList); + void onSuccess(@Nullable List valueList); void onError(Exception ex); default void onSubscriptionEstablished(long subscriptionId) {} } diff --git a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java index 6c95b04dc6569b..81bbfd5f2a0e3f 100644 --- a/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/zap-generated/chip/devicecontroller/ClusterInfoMapping.java @@ -7689,7 +7689,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess(@Nullable List valueList) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); @@ -7804,7 +7804,7 @@ public void setCallbackDelegate(ClusterCommandCallback callback) { } @Override - public void onSuccess( List valueList) { + public void onSuccess(@Nullable List valueList) { Map responseValues = new LinkedHashMap<>(); CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); responseValues.put(commandResponseInfo, valueList); diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 2518ca44d774cb..ece40f25c0b304 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -19047,7 +19047,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="changeIndication", Tag=0x00000002, Type=HepaFilterMonitoring.Enums.ChangeIndicationEnum), ClusterObjectFieldDescriptor(Label="inPlaceIndicator", Tag=0x00000003, Type=typing.Optional[bool]), ClusterObjectFieldDescriptor(Label="lastChangedTime", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="replacementProductList", Tag=0x00000005, Type=typing.Optional[typing.List[HepaFilterMonitoring.Structs.ReplacementProductStruct]]), + ClusterObjectFieldDescriptor(Label="replacementProductList", Tag=0x00000005, Type=typing.Union[None, Nullable, typing.List[HepaFilterMonitoring.Structs.ReplacementProductStruct]]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -19061,7 +19061,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: changeIndication: 'HepaFilterMonitoring.Enums.ChangeIndicationEnum' = None inPlaceIndicator: 'typing.Optional[bool]' = None lastChangedTime: 'typing.Union[None, Nullable, uint]' = None - replacementProductList: 'typing.Optional[typing.List[HepaFilterMonitoring.Structs.ReplacementProductStruct]]' = None + replacementProductList: 'typing.Union[None, Nullable, typing.List[HepaFilterMonitoring.Structs.ReplacementProductStruct]]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -19105,6 +19105,7 @@ class Bitmaps: class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 + kReplacementProductList = 0x3 class Structs: @dataclass @@ -19227,9 +19228,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[HepaFilterMonitoring.Structs.ReplacementProductStruct]]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, typing.List[HepaFilterMonitoring.Structs.ReplacementProductStruct]]) - value: 'typing.Optional[typing.List[HepaFilterMonitoring.Structs.ReplacementProductStruct]]' = None + value: 'typing.Union[None, Nullable, typing.List[HepaFilterMonitoring.Structs.ReplacementProductStruct]]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): @@ -19341,7 +19342,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="changeIndication", Tag=0x00000002, Type=ActivatedCarbonFilterMonitoring.Enums.ChangeIndicationEnum), ClusterObjectFieldDescriptor(Label="inPlaceIndicator", Tag=0x00000003, Type=typing.Optional[bool]), ClusterObjectFieldDescriptor(Label="lastChangedTime", Tag=0x00000004, Type=typing.Union[None, Nullable, uint]), - ClusterObjectFieldDescriptor(Label="replacementProductList", Tag=0x00000005, Type=typing.Optional[typing.List[ActivatedCarbonFilterMonitoring.Structs.ReplacementProductStruct]]), + ClusterObjectFieldDescriptor(Label="replacementProductList", Tag=0x00000005, Type=typing.Union[None, Nullable, typing.List[ActivatedCarbonFilterMonitoring.Structs.ReplacementProductStruct]]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), @@ -19355,7 +19356,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: changeIndication: 'ActivatedCarbonFilterMonitoring.Enums.ChangeIndicationEnum' = None inPlaceIndicator: 'typing.Optional[bool]' = None lastChangedTime: 'typing.Union[None, Nullable, uint]' = None - replacementProductList: 'typing.Optional[typing.List[ActivatedCarbonFilterMonitoring.Structs.ReplacementProductStruct]]' = None + replacementProductList: 'typing.Union[None, Nullable, typing.List[ActivatedCarbonFilterMonitoring.Structs.ReplacementProductStruct]]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None eventList: 'typing.List[uint]' = None @@ -19399,6 +19400,7 @@ class Bitmaps: class Feature(IntFlag): kCondition = 0x1 kWarning = 0x2 + kReplacementProductList = 0x3 class Structs: @dataclass @@ -19521,9 +19523,9 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[typing.List[ActivatedCarbonFilterMonitoring.Structs.ReplacementProductStruct]]) + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, typing.List[ActivatedCarbonFilterMonitoring.Structs.ReplacementProductStruct]]) - value: 'typing.Optional[typing.List[ActivatedCarbonFilterMonitoring.Structs.ReplacementProductStruct]]' = None + value: 'typing.Union[None, Nullable, typing.List[ActivatedCarbonFilterMonitoring.Structs.ReplacementProductStruct]]' = None @dataclass class GeneratedCommandList(ClusterAttributeDescriptor): diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index ef24e566aed90d..5a071759a2b2ee 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -1904,8 +1904,9 @@ enum class ProductIdentifierTypeEnum : uint8_t // Bitmap for Feature enum class Feature : uint32_t { - kCondition = 0x1, - kWarning = 0x2, + kCondition = 0x1, + kWarning = 0x2, + kReplacementProductList = 0x3, }; } // namespace HepaFilterMonitoring @@ -1954,8 +1955,9 @@ enum class ProductIdentifierTypeEnum : uint8_t // Bitmap for Feature enum class Feature : uint32_t { - kCondition = 0x1, - kWarning = 0x2, + kCondition = 0x1, + kWarning = 0x2, + kReplacementProductList = 0x3, }; } // namespace ActivatedCarbonFilterMonitoring 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 70871295b2c8ce..c8d421523708c3 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 @@ -17617,12 +17617,12 @@ struct TypeInfo namespace ReplacementProductList { struct TypeInfo { - using Type = - chip::app::DataModel::List; - using DecodableType = chip::app::DataModel::DecodableList< - chip::app::Clusters::HepaFilterMonitoring::Structs::ReplacementProductStruct::DecodableType>; - using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::HepaFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> &; + using Type = chip::app::DataModel::Nullable< + chip::app::DataModel::List>; + using DecodableType = chip::app::DataModel::Nullable>; + using DecodableArgType = const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::HepaFilterMonitoring::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ReplacementProductList::Id; } @@ -17825,12 +17825,12 @@ struct TypeInfo namespace ReplacementProductList { struct TypeInfo { - using Type = chip::app::DataModel::List< - const chip::app::Clusters::ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::Type>; - using DecodableType = chip::app::DataModel::DecodableList< - chip::app::Clusters::ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::DecodableType>; - using DecodableArgType = const chip::app::DataModel::DecodableList< - chip::app::Clusters::ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> &; + using Type = chip::app::DataModel::Nullable>; + using DecodableType = chip::app::DataModel::Nullable>; + using DecodableArgType = const chip::app::DataModel::Nullable> &; static constexpr ClusterId GetClusterId() { return Clusters::ActivatedCarbonFilterMonitoring::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::ReplacementProductList::Id; } diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 9b7ee566019cc9..f4fe62f6940bcb 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -15228,8 +15228,8 @@ void registerClusterHepaFilterMonitoring(Commands & commands, CredentialIssuerCo make_unique>>(Id, "last-changed-time", 0, UINT32_MAX, Attributes::LastChangedTime::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>>( + make_unique>>>( Id, "replacement-product-list", Attributes::ReplacementProductList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( @@ -15310,8 +15310,8 @@ void registerClusterActivatedCarbonFilterMonitoring(Commands & commands, Credent make_unique>>(Id, "last-changed-time", 0, UINT32_MAX, Attributes::LastChangedTime::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>>( + make_unique>>>( Id, "replacement-product-list", Attributes::ReplacementProductList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( 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 3dbc344679c856..d530b0664077aa 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -8846,8 +8846,8 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("LastChangedTime", 1, value); } case HepaFilterMonitoring::Attributes::ReplacementProductList::Id: { - chip::app::DataModel::DecodableList< - chip::app::Clusters::HepaFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> + chip::app::DataModel::Nullable> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ReplacementProductList", 1, value); @@ -8914,8 +8914,8 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("LastChangedTime", 1, value); } case ActivatedCarbonFilterMonitoring::Attributes::ReplacementProductList::Id: { - chip::app::DataModel::DecodableList< - chip::app::Clusters::ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::DecodableType> + chip::app::DataModel::Nullable> value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ReplacementProductList", 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 f6b45551ee0649..b7d051ae99ef8e 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -107983,7 +107983,7 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand { public: Test_TC_ACFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ACFREMON_1_1", 12, credsIssuerConfig) + TestCommand("Test_TC_ACFREMON_1_1", 13, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -108057,6 +108057,15 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand } break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 3UL)); + } + break; + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108071,7 +108080,7 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; - case 6: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108079,9 +108088,10 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); } break; - case 7: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108090,7 +108100,7 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; - case 8: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108102,7 +108112,7 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108110,7 +108120,7 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 10: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108119,7 +108129,7 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); } break; - case 11: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108160,7 +108170,8 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip("!ACFREMON.S.F00 && !ACFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!ACFREMON.S.F00 && !ACFREMON.S.F01 && !ACFREMON.S.F02"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -108177,40 +108188,46 @@ class Test_TC_ACFREMON_1_1Suite : public TestCommand ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "Step 4a: Read the global attribute: AttributeList"); + LogStep(5, "Step 3d: Given ACFREMON.S.F01(ReplacementProductList) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, - ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + ActivatedCarbonFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } case 6: { - LogStep(6, "Step 4b: Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList"); - VerifyOrDo(!ShouldSkip("ACFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(6, "Step 4a: Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Step 4c: Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in AttributeList"); - VerifyOrDo(!ShouldSkip("ACFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(7, "Step 4b: Read the feature dependent(ACFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Step 5: TH reads EventList attribute from DUT"); + LogStep(8, "Step 4c: Read the optional attribute InPlaceIndicator (ACFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, - ActivatedCarbonFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + ActivatedCarbonFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "Step 6a: Read the global attribute: AcceptedCommandList"); + LogStep(9, "Step 5: TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, - ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + ActivatedCarbonFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } case 10: { - LogStep(10, "Step 6b: Read the optional command (ResetCondition) in AcceptedCommandList"); - VerifyOrDo(!ShouldSkip("ACFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(10, "Step 6a: Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 11: { - LogStep(11, "Step 7: Read the global attribute: GeneratedCommandList"); + LogStep(11, "Step 6b: Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 7: Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, ActivatedCarbonFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); } @@ -108223,7 +108240,7 @@ class Test_TC_ACFREMON_2_1Suite : public TestCommand { public: Test_TC_ACFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_ACFREMON_2_1", 5, credsIssuerConfig) + TestCommand("Test_TC_ACFREMON_2_1", 7, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -108298,6 +108315,24 @@ class Test_TC_ACFREMON_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); } break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "epoch_s", "epoch_s")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -108344,6 +108379,18 @@ class Test_TC_ACFREMON_2_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, ActivatedCarbonFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the LastChangedTime attribute"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::LastChangedTime::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the ReplacementProductList attribute"); + VerifyOrDo(!ShouldSkip("ACFREMON.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), ActivatedCarbonFilterMonitoring::Id, + ActivatedCarbonFilterMonitoring::Attributes::ReplacementProductList::Id, true, chip::NullOptional); + } } return CHIP_NO_ERROR; } @@ -108353,7 +108400,7 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand { public: Test_TC_HEPAFREMON_1_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_HEPAFREMON_1_1", 12, credsIssuerConfig) + TestCommand("Test_TC_HEPAFREMON_1_1", 13, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -108427,6 +108474,15 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand } break; case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + uint32_t value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "bitmap32", "bitmap32")); + VerifyOrReturn(CheckConstraintHasMasksSet("value", value, 3UL)); + } + break; + case 6: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108441,7 +108497,7 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 65533UL)); } break; - case 6: + case 7: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108449,9 +108505,10 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); VerifyOrReturn(CheckConstraintContains("value", value, 1UL)); + VerifyOrReturn(CheckConstraintContains("value", value, 2UL)); } break; - case 7: + case 8: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108460,7 +108517,7 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 3UL)); } break; - case 8: + case 9: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108472,7 +108529,7 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 9: + case 10: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108480,7 +108537,7 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "list", "list")); } break; - case 10: + case 11: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108489,7 +108546,7 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand VerifyOrReturn(CheckConstraintContains("value", value, 0UL)); } break; - case 11: + case 12: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::DataModel::DecodableList value; @@ -108530,7 +108587,8 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand } case 2: { LogStep(2, "Step 3a: Read the global attribute: FeatureMap"); - VerifyOrDo(!ShouldSkip("!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + VerifyOrDo(!ShouldSkip("!HEPAFREMON.S.F00 && !HEPAFREMON.S.F01 && !HEPAFREMON.S.F02"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } @@ -108547,40 +108605,46 @@ class Test_TC_HEPAFREMON_1_1Suite : public TestCommand HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } case 5: { - LogStep(5, "Step 4: Read the global attribute: AttributeList"); + LogStep(5, "Step 3d: Given HEPAFREMON.S.F02(ReplacementProductList) ensure featuremap has the correct bit set"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F02"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, - HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); + HepaFilterMonitoring::Attributes::FeatureMap::Id, true, chip::NullOptional); } case 6: { - LogStep(6, "Step 4a: Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList"); - VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(6, "Step 4: Read the global attribute: AttributeList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 7: { - LogStep(7, "Step 4b: Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in AttributeList"); - VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(7, "Step 4a: Read the feature dependent(HEPAFREMON.S.F00) attribute in AttributeList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.F00"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 8: { - LogStep(8, "Step 5: TH reads EventList attribute from DUT"); + LogStep(8, "Step 4b: Read the optional attribute InPlaceIndicator (HEPAFREMON.S.A0002) in AttributeList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0002"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, - HepaFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); + HepaFilterMonitoring::Attributes::AttributeList::Id, true, chip::NullOptional); } case 9: { - LogStep(9, "Step 6a: Read the global attribute: AcceptedCommandList"); + LogStep(9, "Step 5: TH reads EventList attribute from DUT"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, - HepaFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + HepaFilterMonitoring::Attributes::EventList::Id, true, chip::NullOptional); } case 10: { - LogStep(10, "Step 6b: Read the optional command (ResetCondition) in AcceptedCommandList"); - VerifyOrDo(!ShouldSkip("HEPAFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + LogStep(10, "Step 6a: Read the global attribute: AcceptedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, HepaFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); } case 11: { - LogStep(11, "Step 7: Read the global attribute: GeneratedCommandList"); + LogStep(11, "Step 6b: Read the optional command (ResetCondition) in AcceptedCommandList"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.C00.Rsp"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::AcceptedCommandList::Id, true, chip::NullOptional); + } + case 12: { + LogStep(12, "Step 7: Read the global attribute: GeneratedCommandList"); return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, HepaFilterMonitoring::Attributes::GeneratedCommandList::Id, true, chip::NullOptional); } @@ -108593,7 +108657,7 @@ class Test_TC_HEPAFREMON_2_1Suite : public TestCommand { public: Test_TC_HEPAFREMON_2_1Suite(CredentialIssuerCommands * credsIssuerConfig) : - TestCommand("Test_TC_HEPAFREMON_2_1", 5, credsIssuerConfig) + TestCommand("Test_TC_HEPAFREMON_2_1", 7, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("cluster", &mCluster); @@ -108668,6 +108732,24 @@ class Test_TC_HEPAFREMON_2_1Suite : public TestCommand VerifyOrReturn(CheckConstraintType("value", "boolean", "boolean")); } break; + case 5: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "epoch_s", "epoch_s")); + } + break; + case 6: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::DataModel::Nullable> + value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintType("value", "list", "list")); + } + break; default: LogErrorOnFailure(ContinueOnChipMainThread(CHIP_ERROR_INVALID_ARGUMENT)); } @@ -108714,6 +108796,18 @@ class Test_TC_HEPAFREMON_2_1Suite : public TestCommand return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, HepaFilterMonitoring::Attributes::InPlaceIndicator::Id, true, chip::NullOptional); } + case 5: { + LogStep(5, "Step 6: TH reads from the DUT the LastChangedTime attribute"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0004"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::LastChangedTime::Id, true, chip::NullOptional); + } + case 6: { + LogStep(6, "Step 7: TH reads from the DUT the ReplacementProductList attribute"); + VerifyOrDo(!ShouldSkip("HEPAFREMON.S.A0005"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), HepaFilterMonitoring::Id, + HepaFilterMonitoring::Attributes::ReplacementProductList::Id, true, chip::NullOptional); + } } return CHIP_NO_ERROR; }