Fixing feature map for resource monitoring cluster (#29074)

* Fixing feature map for resource monitoring cluster

The replacement product list feature bitmask was set to 0x3 when it
should have been set to 0x4. Fixing it here.

Verified by looking reading the feature map in the all clusters app and
the resource monitoring app:

```
> hepafiltermonitoring read feature-map 1 1
...
[1693934613437] [9078:18462448] [DMG]   AttributeReportIBs =
[1693934613437] [9078:18462448] [DMG]   [
[1693934613437] [9078:18462448] [DMG]           AttributeReportIB =
[1693934613437] [9078:18462448] [DMG]           {
[1693934613437] [9078:18462448] [DMG]                   AttributeDataIB =
[1693934613437] [9078:18462448] [DMG]                   {
[1693934613437] [9078:18462448] [DMG]                           DataVersion = 0x443616af,
[1693934613437] [9078:18462448] [DMG]                           AttributePathIB =
[1693934613437] [9078:18462448] [DMG]                           {
[1693934613437] [9078:18462448] [DMG]                                   Endpoint = 0x1,
[1693934613437] [9078:18462448] [DMG]                                   Cluster = 0x72,
[1693934613437] [9078:18462448] [DMG]                                   Attribute = 0x0000_FFFC,
[1693934613437] [9078:18462448] [DMG]                           }
[1693934613437] [9078:18462448] [DMG]
[1693934613437] [9078:18462448] [DMG]                           Data = 7,
[1693934613437] [9078:18462448] [DMG]                   },
[1693934613437] [9078:18462448] [DMG]
[1693934613437] [9078:18462448] [DMG]           },
[1693934613437] [9078:18462448] [DMG]
[1693934613437] [9078:18462448] [DMG]   ],
```

This fixes #28197 and #28198

* Updating and adding feature flag tests
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 f4b5dfb..58f7446 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
@@ -3162,7 +3162,7 @@
   bitmap Feature : BITMAP32 {
     kCondition = 0x1;
     kWarning = 0x2;
-    kReplacementProductList = 0x3;
+    kReplacementProductList = 0x4;
   }
 
   struct ReplacementProductStruct {
@@ -3210,7 +3210,7 @@
   bitmap Feature : BITMAP32 {
     kCondition = 0x1;
     kWarning = 0x2;
-    kReplacementProductList = 0x3;
+    kReplacementProductList = 0x4;
   }
 
   struct ReplacementProductStruct {
@@ -6914,7 +6914,7 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 3;
+    ram      attribute featureMap default = 7;
     ram      attribute clusterRevision default = 1;
   }
 
@@ -6928,7 +6928,7 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 3;
+    ram      attribute featureMap default = 7;
     ram      attribute clusterRevision default = 1;
   }
 
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 570a498..bcd0bb2 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
@@ -18456,7 +18456,7 @@
               "storageOption": "RAM",
               "singleton": 0,
               "bounded": 0,
-              "defaultValue": "3",
+              "defaultValue": "7",
               "reportable": 1,
               "minInterval": 1,
               "maxInterval": 65534,
@@ -18710,7 +18710,7 @@
               "storageOption": "RAM",
               "singleton": 0,
               "bounded": 0,
-              "defaultValue": "3",
+              "defaultValue": "7",
               "reportable": 1,
               "minInterval": 1,
               "maxInterval": 65534,
@@ -35392,5 +35392,6 @@
       "endpointId": 65534,
       "networkId": 0
     }
-  ]
+  ],
+  "log": []
 }
diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter
index 411c2ab..d047d19 100644
--- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter
+++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter
@@ -967,7 +967,7 @@
   bitmap Feature : BITMAP32 {
     kCondition = 0x1;
     kWarning = 0x2;
-    kReplacementProductList = 0x3;
+    kReplacementProductList = 0x4;
   }
 
   struct ReplacementProductStruct {
@@ -1011,7 +1011,7 @@
   bitmap Feature : BITMAP32 {
     kCondition = 0x1;
     kWarning = 0x2;
-    kReplacementProductList = 0x3;
+    kReplacementProductList = 0x4;
   }
 
   struct ReplacementProductStruct {
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 85a69ad..60ebc01 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
@@ -1538,7 +1538,7 @@
   bitmap Feature : BITMAP32 {
     kCondition = 0x1;
     kWarning = 0x2;
-    kReplacementProductList = 0x3;
+    kReplacementProductList = 0x4;
   }
 
   struct ReplacementProductStruct {
@@ -1586,7 +1586,7 @@
   bitmap Feature : BITMAP32 {
     kCondition = 0x1;
     kWarning = 0x2;
-    kReplacementProductList = 0x3;
+    kReplacementProductList = 0x4;
   }
 
   struct ReplacementProductStruct {
@@ -2010,7 +2010,7 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
+    ram      attribute featureMap default = 7;
     ram      attribute clusterRevision default = 1;
   }
 
@@ -2024,7 +2024,7 @@
     callback attribute generatedCommandList;
     callback attribute acceptedCommandList;
     callback attribute attributeList;
-    ram      attribute featureMap default = 0;
+    ram      attribute featureMap default = 7;
     ram      attribute clusterRevision default = 1;
   }
 
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 012f9b9..60857f1 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
@@ -18,17 +18,17 @@
   "package": [
     {
       "pathRelativity": "relativeToZap",
+      "path": "../../../src/app/zap-templates/app-templates.json",
+      "type": "gen-templates-json",
+      "version": "chip-v1"
+    },
+    {
+      "pathRelativity": "relativeToZap",
       "path": "../../../src/app/zap-templates/zcl/zcl.json",
       "type": "zcl-properties",
       "category": "matter",
       "version": 1,
       "description": "Matter SDK ZCL data"
-    },
-    {
-      "pathRelativity": "relativeToZap",
-      "path": "../../../src/app/zap-templates/app-templates.json",
-      "type": "gen-templates-json",
-      "version": "chip-v1"
     }
   ],
   "endpointTypes": [
@@ -6373,7 +6373,7 @@
               "storageOption": "RAM",
               "singleton": 0,
               "bounded": 0,
-              "defaultValue": "0",
+              "defaultValue": "7",
               "reportable": 1,
               "minInterval": 1,
               "maxInterval": 65534,
@@ -6627,7 +6627,7 @@
               "storageOption": "RAM",
               "singleton": 0,
               "bounded": 0,
-              "defaultValue": "0",
+              "defaultValue": "7",
               "reportable": 1,
               "minInterval": 1,
               "maxInterval": 65534,
@@ -6993,5 +6993,6 @@
       "endpointId": 1,
       "networkId": 0
     }
-  ]
+  ],
+  "log": []
 }
\ No newline at end of file
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 61d90da..03598ce 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
@@ -62,7 +62,7 @@
 {
     kCondition              = 0x1,
     kWarning                = 0x2,
-    kReplacementProductList = 0x3
+    kReplacementProductList = 0x4
 };
 
 // Enum for ProductIdentifierTypeEnum
diff --git a/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml b/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml
index c47e01f..c1a1a95 100644
--- a/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml
+++ b/src/app/tests/suites/TestActivatedCarbonFilterMonitoring.yaml
@@ -28,6 +28,14 @@
               - name: "nodeId"
                 value: nodeId
 
+    - label: "Validate the feature map"
+      command: "readAttribute"
+      attribute: "FeatureMap"
+      response:
+          constraints:
+              type: bitmap32
+              hasMasksSet: [0x7]
+
     - label: "Read Replacement Product List"
       command: "readAttribute"
       attribute: "ReplacementProductList"
diff --git a/src/app/tests/suites/TestHepaFilterMonitoring.yaml b/src/app/tests/suites/TestHepaFilterMonitoring.yaml
index 44b79ee..9492ef1 100644
--- a/src/app/tests/suites/TestHepaFilterMonitoring.yaml
+++ b/src/app/tests/suites/TestHepaFilterMonitoring.yaml
@@ -28,6 +28,14 @@
               - name: "nodeId"
                 value: nodeId
 
+    - label: "Validate the feature map"
+      command: "readAttribute"
+      attribute: "FeatureMap"
+      response:
+          constraints:
+              type: bitmap32
+              hasMasksSet: [0x7]
+
     - label: "Read Replacement Product List"
       command: "readAttribute"
       attribute: "ReplacementProductList"
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 2d5b61e..a96963e 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
@@ -79,7 +79,7 @@
       response:
           constraints:
               type: bitmap32
-              hasMasksSet: [0x3]
+              hasMasksSet: [0x4]
 
     - label: "Step 4a: Read the global attribute: AttributeList"
       PICS: PICS_EVENT_LIST_ENABLED
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 7814f98..acc422b 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
@@ -79,7 +79,7 @@
       response:
           constraints:
               type: bitmap32
-              hasMasksSet: [0x3]
+              hasMasksSet: [0x4]
 
     - label: "Step 4: Read the global attribute: AttributeList"
       PICS: PICS_EVENT_LIST_ENABLED
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 a6be42b..efce0ea 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
@@ -68,7 +68,7 @@
     <cluster code="0x0072" />
     <field name="Condition" mask="0x01" />
     <field name="Warning" mask="0x02" />
-    <field name="ReplacementProductList" mask="0x03" />
+    <field name="ReplacementProductList" mask="0x04" />
   </bitmap>
 
   <!-- Cluster Data Types -->
diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter
index ebd2a1c..8a62307 100644
--- a/src/controller/data_model/controller-clusters.matter
+++ b/src/controller/data_model/controller-clusters.matter
@@ -3497,7 +3497,7 @@
   bitmap Feature : BITMAP32 {
     kCondition = 0x1;
     kWarning = 0x2;
-    kReplacementProductList = 0x3;
+    kReplacementProductList = 0x4;
   }
 
   struct ReplacementProductStruct {
@@ -3546,7 +3546,7 @@
   bitmap Feature : BITMAP32 {
     kCondition = 0x1;
     kWarning = 0x2;
-    kReplacementProductList = 0x3;
+    kReplacementProductList = 0x4;
   }
 
   struct ReplacementProductStruct {
diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py
index 9666245..a3a72f4 100644
--- a/src/controller/python/chip/clusters/Objects.py
+++ b/src/controller/python/chip/clusters/Objects.py
@@ -19176,7 +19176,7 @@
         class Feature(IntFlag):
             kCondition = 0x1
             kWarning = 0x2
-            kReplacementProductList = 0x3
+            kReplacementProductList = 0x4
 
     class Structs:
         @dataclass
@@ -19471,7 +19471,7 @@
         class Feature(IntFlag):
             kCondition = 0x1
             kWarning = 0x2
-            kReplacementProductList = 0x3
+            kReplacementProductList = 0x4
 
     class Structs:
         @dataclass
diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
index 6475030..8385b0a 100644
--- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
+++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h
@@ -26673,7 +26673,7 @@
 typedef NS_OPTIONS(uint32_t, MTRHEPAFilterMonitoringFeature) {
     MTRHEPAFilterMonitoringFeatureCondition MTR_PROVISIONALLY_AVAILABLE = 0x1,
     MTRHEPAFilterMonitoringFeatureWarning MTR_PROVISIONALLY_AVAILABLE = 0x2,
-    MTRHEPAFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x3,
+    MTRHEPAFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x4,
 } MTR_PROVISIONALLY_AVAILABLE;
 
 typedef NS_ENUM(uint8_t, MTRActivatedCarbonFilterMonitoringChangeIndication) {
@@ -26698,7 +26698,7 @@
 typedef NS_OPTIONS(uint32_t, MTRActivatedCarbonFilterMonitoringFeature) {
     MTRActivatedCarbonFilterMonitoringFeatureCondition MTR_PROVISIONALLY_AVAILABLE = 0x1,
     MTRActivatedCarbonFilterMonitoringFeatureWarning MTR_PROVISIONALLY_AVAILABLE = 0x2,
-    MTRActivatedCarbonFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x3,
+    MTRActivatedCarbonFilterMonitoringFeatureReplacementProductList MTR_PROVISIONALLY_AVAILABLE = 0x4,
 } MTR_PROVISIONALLY_AVAILABLE;
 
 typedef NS_ENUM(uint8_t, MTRDoorLockAlarmCode) {
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 40cef50..c5badb6 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
@@ -1934,7 +1934,7 @@
 {
     kCondition              = 0x1,
     kWarning                = 0x2,
-    kReplacementProductList = 0x3,
+    kReplacementProductList = 0x4,
 };
 } // namespace HepaFilterMonitoring
 
@@ -1985,7 +1985,7 @@
 {
     kCondition              = 0x1,
     kWarning                = 0x2,
-    kReplacementProductList = 0x3,
+    kReplacementProductList = 0x4,
 };
 } // namespace ActivatedCarbonFilterMonitoring
 
diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
index 35a6c29..c3b182f 100644
--- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
+++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h
@@ -177436,8 +177436,12 @@
             err = TestWaitForTheCommissionedDeviceToBeRetrieved_0();
             break;
         case 1:
-            ChipLogProgress(chipTool, " ***** Test Step 1 : Read Replacement Product List\n");
-            err = TestReadReplacementProductList_1();
+            ChipLogProgress(chipTool, " ***** Test Step 1 : Validate the feature map\n");
+            err = TestValidateTheFeatureMap_1();
+            break;
+        case 2:
+            ChipLogProgress(chipTool, " ***** Test Step 2 : Read Replacement Product List\n");
+            err = TestReadReplacementProductList_2();
             break;
         }
 
@@ -177456,6 +177460,9 @@
         case 1:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
             break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
         }
 
         // Go on to the next test.
@@ -177469,7 +177476,7 @@
 
 private:
     std::atomic_uint16_t mTestIndex;
-    const uint16_t mTestCount = 2;
+    const uint16_t mTestCount = 3;
 
     chip::Optional<chip::NodeId> mNodeId;
     chip::Optional<chip::CharSpan> mCluster;
@@ -177484,7 +177491,28 @@
         return WaitForCommissionee("alpha", value);
     }
 
-    CHIP_ERROR TestReadReplacementProductList_1()
+    CHIP_ERROR TestValidateTheFeatureMap_1()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterActivatedCarbonFilterMonitoring alloc] initWithDevice:device
+                                                                                           endpointID:@(1)
+                                                                                                queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) {
+            NSLog(@"Validate the feature map Error: %@", err);
+
+            VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+            VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32"));
+            NextTest();
+        }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestReadReplacementProductList_2()
     {
 
         MTRBaseDevice * device = GetDevice("alpha");
@@ -177583,8 +177611,12 @@
             err = TestWaitForTheCommissionedDeviceToBeRetrieved_0();
             break;
         case 1:
-            ChipLogProgress(chipTool, " ***** Test Step 1 : Read Replacement Product List\n");
-            err = TestReadReplacementProductList_1();
+            ChipLogProgress(chipTool, " ***** Test Step 1 : Validate the feature map\n");
+            err = TestValidateTheFeatureMap_1();
+            break;
+        case 2:
+            ChipLogProgress(chipTool, " ***** Test Step 2 : Read Replacement Product List\n");
+            err = TestReadReplacementProductList_2();
             break;
         }
 
@@ -177603,6 +177635,9 @@
         case 1:
             VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
             break;
+        case 2:
+            VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0));
+            break;
         }
 
         // Go on to the next test.
@@ -177616,7 +177651,7 @@
 
 private:
     std::atomic_uint16_t mTestIndex;
-    const uint16_t mTestCount = 2;
+    const uint16_t mTestCount = 3;
 
     chip::Optional<chip::NodeId> mNodeId;
     chip::Optional<chip::CharSpan> mCluster;
@@ -177631,7 +177666,28 @@
         return WaitForCommissionee("alpha", value);
     }
 
-    CHIP_ERROR TestReadReplacementProductList_1()
+    CHIP_ERROR TestValidateTheFeatureMap_1()
+    {
+
+        MTRBaseDevice * device = GetDevice("alpha");
+        __auto_type * cluster = [[MTRBaseClusterHEPAFilterMonitoring alloc] initWithDevice:device
+                                                                                endpointID:@(1)
+                                                                                     queue:mCallbackQueue];
+        VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE);
+
+        [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) {
+            NSLog(@"Validate the feature map Error: %@", err);
+
+            VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0));
+
+            VerifyOrReturn(CheckConstraintType("featureMap", "bitmap32", "bitmap32"));
+            NextTest();
+        }];
+
+        return CHIP_NO_ERROR;
+    }
+
+    CHIP_ERROR TestReadReplacementProductList_2()
     {
 
         MTRBaseDevice * device = GetDevice("alpha");