Move declarations from `af.h` into the corresponding storage/table/... headers (#32776)
* move emberAfLocateAttributeMetadata to attribute-storage.h as it is implemented in attribute-storage.cpp
* Move more methods
* Global endpoints extern should not exist
* move more things
* restyle
* Move the last bits from af.h into the corresponding headers. Remove af.h (this will cause compile issues)
* Remove all references to af.h
* Restyle and zap regen
* All-clusters now compiles on linux
* Fix ota requester compile
* Make tests compile
* Restyle
* Fix lint.yml: af.h does not exist anymore
* Fix door lock compile
* Ensure everything using emberAfEndpointEnableDisable includes endpoint-config-api
* Fix emberAfContainsServer include needs
* Include attribute-storage.h whenever kEmberinvalidEndpointIndex is defined
* Include attribute-storage.h whenever kEmberinvalidEndpointIndex is used
* Fix linter
* Another lint cleanup
* Fix all includes referencing EnabledEndpointsWithServerCluster
* Restyle
* Fix andorid tv compile
* Fix linter complain: application basic delegate was already stl-bound, add string as well
* Fix Attributes.h using emberAfWriteAttribute
* Fix dependencies on AccountLogingManager ... needs config to access SERVER_ENDPOINT_COUNT
* Add a lot of includes for std::string where std::string is used
* Fix checkincludes
* Fix one more build
* Zap regen ... some string adds were in generated code
* make android compile: fix dynamic server dependencies on attribute-storage.h
* Refactor a bit to make gn linter happy
* Restyle
* Split out attribute-storage/table into a -detail and non-detail header
* Restyle
* Fix lint typo
* Make tv app compile: need dynamic endpoints defines accessible
* Restyle
* Remove code from storage-detail
* Fix code again: FIXED_ENDPOINT_COUNT must be defined, so config has to be included
* More includes to make compile work. At least now boufallolab compiles
* Fix linux builds ... apparently mock attribute storage is a copy & paste ... this is probably not good...
* Direct include of endpoint_config in attribute-storage.h
* Minor comment update: alignment and fix typo
* Some code review comments
---------
Co-authored-by: Andrei Litvin <andreilitvin@google.com>
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 3090720..36a5a0b 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -101,11 +101,12 @@
--known-failure app/reporting/tests/MockReportScheduler.cpp \
--known-failure app/reporting/tests/MockReportScheduler.h \
--known-failure app/TestEventTriggerDelegate.h \
- --known-failure app/util/af.h \
--known-failure app/util/attribute-storage.cpp \
--known-failure app/util/attribute-storage.h \
+ --known-failure app/util/attribute-storage-detail.h \
--known-failure app/util/attribute-table.cpp \
--known-failure app/util/attribute-table.h \
+ --known-failure app/util/attribute-table-detail.h \
--known-failure app/util/binding-table.cpp \
--known-failure app/util/binding-table.h \
--known-failure app/util/config.h \
@@ -253,7 +254,7 @@
- name: Check for use of 'emberAfReadAttribute' instead of the type-safe getters
if: always()
run: |
- git grep -I -n 'emberAfReadAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' && exit 1 || exit 0
+ git grep -I -n 'emberAfReadAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/attribute-table.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' && exit 1 || exit 0
# git grep exits with 0 if it finds a match, but we want
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -263,7 +264,7 @@
- name: Check for use of 'emberAfWriteAttribute' instead of the type-safe setters
if: always()
run: |
- git grep -I -n 'emberAfWriteAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)src/app/util/af.h' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' ':(exclude)src/app/util/attribute-table.h' ':(exclude)src/app/util/ember-compatibility-functions.cpp' && exit 1 || exit 0
+ git grep -I -n 'emberAfWriteAttribute' -- './*' ':(exclude).github/workflows/lint.yml' ':(exclude)zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp' ':(exclude)src/app/zap-templates/templates/app/attributes/Accessors-src.zapt' ':(exclude)src/app/util/attribute-table.cpp' ':(exclude)examples/common/pigweed/rpc_services/Attributes.h' ':(exclude)src/app/util/attribute-table.h' ':(exclude)src/app/util/ember-compatibility-functions.cpp' && exit 1 || exit 0
# Run ruff python linter
- name: Check for errors using ruff Python linter
diff --git a/examples/air-purifier-app/ameba/main/DeviceCallbacks.cpp b/examples/air-purifier-app/ameba/main/DeviceCallbacks.cpp
index 42551f7..deb3731 100644
--- a/examples/air-purifier-app/ameba/main/DeviceCallbacks.cpp
+++ b/examples/air-purifier-app/ameba/main/DeviceCallbacks.cpp
@@ -29,7 +29,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/air-purifier-app/ameba/main/chipinterface.cpp b/examples/air-purifier-app/ameba/main/chipinterface.cpp
index 264ad53..fd1c568 100644
--- a/examples/air-purifier-app/ameba/main/chipinterface.cpp
+++ b/examples/air-purifier-app/ameba/main/chipinterface.cpp
@@ -30,7 +30,7 @@
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
#include <platform/Ameba/NetworkCommissioningDriver.h>
diff --git a/examples/air-purifier-app/linux/main.cpp b/examples/air-purifier-app/linux/main.cpp
index 98d8d40..0335ebc 100644
--- a/examples/air-purifier-app/linux/main.cpp
+++ b/examples/air-purifier-app/linux/main.cpp
@@ -20,7 +20,6 @@
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
-#include <app/util/af.h>
#include <lib/support/logging/CHIPLogging.h>
#define AIR_PURIFIER_ENDPOINT 1
diff --git a/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp b/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp
index 41a53d4..7aaa873 100644
--- a/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp
+++ b/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp
@@ -30,6 +30,7 @@
#include <limits>
#include <map>
+#include <string>
using namespace chip;
using namespace chip::app;
diff --git a/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.h b/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.h
index e608b7a..88b60d1 100644
--- a/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.h
+++ b/examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.h
@@ -23,6 +23,8 @@
#include <json/json.h>
#include <platform/DiagnosticDataProvider.h>
+#include <string>
+
class AirQualitySensorAttrUpdateHandler
{
public:
diff --git a/examples/air-quality-sensor-app/linux/main.cpp b/examples/air-quality-sensor-app/linux/main.cpp
index 9dee0c2..39a13ba 100644
--- a/examples/air-quality-sensor-app/linux/main.cpp
+++ b/examples/air-quality-sensor-app/linux/main.cpp
@@ -20,9 +20,10 @@
#include <AppMain.h>
#include <air-quality-sensor-manager.h>
-#include <app/util/af.h>
#include <platform/CHIPDeviceConfig.h>
+#include <string>
+
#if defined(CHIP_IMGUI_ENABLED) && CHIP_IMGUI_ENABLED
#include <imgui_ui/ui.h>
#include <imgui_ui/windows/qrcode.h>
diff --git a/examples/all-clusters-app/all-clusters-common/include/dishwasher-mode.h b/examples/all-clusters-app/all-clusters-common/include/dishwasher-mode.h
index 604496f..2ff1696 100644
--- a/examples/all-clusters-app/all-clusters-common/include/dishwasher-mode.h
+++ b/examples/all-clusters-app/all-clusters-common/include/dishwasher-mode.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/all-clusters-app/all-clusters-common/include/laundry-dryer-controls-delegate-impl.h b/examples/all-clusters-app/all-clusters-common/include/laundry-dryer-controls-delegate-impl.h
index 898cf88..920d703 100644
--- a/examples/all-clusters-app/all-clusters-common/include/laundry-dryer-controls-delegate-impl.h
+++ b/examples/all-clusters-app/all-clusters-common/include/laundry-dryer-controls-delegate-impl.h
@@ -20,7 +20,6 @@
#include <app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-delegate.h>
#include <app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
diff --git a/examples/all-clusters-app/all-clusters-common/include/laundry-washer-controls-delegate-impl.h b/examples/all-clusters-app/all-clusters-common/include/laundry-washer-controls-delegate-impl.h
index 15a7248..f9d3d1b 100644
--- a/examples/all-clusters-app/all-clusters-common/include/laundry-washer-controls-delegate-impl.h
+++ b/examples/all-clusters-app/all-clusters-common/include/laundry-washer-controls-delegate-impl.h
@@ -20,7 +20,6 @@
#include <app/clusters/laundry-washer-controls-server/laundry-washer-controls-delegate.h>
#include <app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
diff --git a/examples/all-clusters-app/all-clusters-common/include/laundry-washer-mode.h b/examples/all-clusters-app/all-clusters-common/include/laundry-washer-mode.h
index 2f59b0d..5d35c03 100644
--- a/examples/all-clusters-app/all-clusters-common/include/laundry-washer-mode.h
+++ b/examples/all-clusters-app/all-clusters-common/include/laundry-washer-mode.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/all-clusters-app/all-clusters-common/include/microwave-oven-mode.h b/examples/all-clusters-app/all-clusters-common/include/microwave-oven-mode.h
index dd5d5b4..df06d23 100644
--- a/examples/all-clusters-app/all-clusters-common/include/microwave-oven-mode.h
+++ b/examples/all-clusters-app/all-clusters-common/include/microwave-oven-mode.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/all-clusters-app/all-clusters-common/include/oven-modes.h b/examples/all-clusters-app/all-clusters-common/include/oven-modes.h
index 7e264a4..2c58229 100644
--- a/examples/all-clusters-app/all-clusters-common/include/oven-modes.h
+++ b/examples/all-clusters-app/all-clusters-common/include/oven-modes.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/all-clusters-app/all-clusters-common/include/rvc-modes.h b/examples/all-clusters-app/all-clusters-common/include/rvc-modes.h
index 8af4aa5..8449878 100644
--- a/examples/all-clusters-app/all-clusters-common/include/rvc-modes.h
+++ b/examples/all-clusters-app/all-clusters-common/include/rvc-modes.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/all-clusters-app/all-clusters-common/include/static-supported-modes-manager.h b/examples/all-clusters-app/all-clusters-common/include/static-supported-modes-manager.h
index ef90de3..b4ce50b 100644
--- a/examples/all-clusters-app/all-clusters-common/include/static-supported-modes-manager.h
+++ b/examples/all-clusters-app/all-clusters-common/include/static-supported-modes-manager.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-select-server/supported-modes-manager.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
diff --git a/examples/all-clusters-app/all-clusters-common/include/static-supported-temperature-levels.h b/examples/all-clusters-app/all-clusters-common/include/static-supported-temperature-levels.h
index 3fdce87..9698df8 100644
--- a/examples/all-clusters-app/all-clusters-common/include/static-supported-temperature-levels.h
+++ b/examples/all-clusters-app/all-clusters-common/include/static-supported-temperature-levels.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/temperature-control-server/supported-temperature-levels-manager.h>
-#include <app/util/af.h>
#include <app/util/config.h>
namespace chip {
diff --git a/examples/all-clusters-app/all-clusters-common/include/tcc-mode.h b/examples/all-clusters-app/all-clusters-common/include/tcc-mode.h
index dcd9024..8d8cdb0 100644
--- a/examples/all-clusters-app/all-clusters-common/include/tcc-mode.h
+++ b/examples/all-clusters-app/all-clusters-common/include/tcc-mode.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
index 338a469..ef4a733 100644
--- a/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
+++ b/examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
@@ -29,7 +29,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/all-clusters-app/ameba/main/chipinterface.cpp b/examples/all-clusters-app/ameba/main/chipinterface.cpp
index c954713..aa7cc4a 100644
--- a/examples/all-clusters-app/ameba/main/chipinterface.cpp
+++ b/examples/all-clusters-app/ameba/main/chipinterface.cpp
@@ -34,7 +34,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <laundry-dryer-controls-delegate-impl.h>
#include <laundry-washer-controls-delegate-impl.h>
#include <lib/core/ErrorStr.h>
diff --git a/examples/all-clusters-app/asr/src/AppTask.cpp b/examples/all-clusters-app/asr/src/AppTask.cpp
index 92b6aae..1a829ca 100644
--- a/examples/all-clusters-app/asr/src/AppTask.cpp
+++ b/examples/all-clusters-app/asr/src/AppTask.cpp
@@ -34,6 +34,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <lega_rtos_api.h>
#include <platform/ASR/NetworkCommissioningDriver.h>
diff --git a/examples/all-clusters-app/asr/src/DeviceCallbacks.cpp b/examples/all-clusters-app/asr/src/DeviceCallbacks.cpp
index cc48488..459b3e9 100644
--- a/examples/all-clusters-app/asr/src/DeviceCallbacks.cpp
+++ b/examples/all-clusters-app/asr/src/DeviceCallbacks.cpp
@@ -30,7 +30,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp
index b6b9bf1..234458d 100644
--- a/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -21,10 +21,10 @@
#include "AppConfig.h"
#include "AppEvent.h"
#include <app/server/Server.h>
-#include <app/util/af.h>
#include "FreeRTOS.h"
#include "Globals.h"
+#include <app/util/endpoint-config-api.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
diff --git a/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp
index ba3f7bd..f2668ec 100644
--- a/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp
+++ b/examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp
@@ -31,7 +31,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
using namespace ::chip;
diff --git a/examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp b/examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp
index 6df3ff3..24d0894 100644
--- a/examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp
+++ b/examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp
@@ -20,10 +20,10 @@
#include "AppConfig.h"
#include "AppEvent.h"
#include <app/server/Server.h>
-#include <app/util/af.h>
#include "FreeRTOS.h"
#include "Globals.h"
+#include <app/util/endpoint-config-api.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <examples/platform/cc13x4_26x4/CC13X4_26X4DeviceAttestationCreds.h>
diff --git a/examples/all-clusters-app/cc13x4_26x4/main/ZclCallbacks.cpp b/examples/all-clusters-app/cc13x4_26x4/main/ZclCallbacks.cpp
index 0950550..b21e2ad 100644
--- a/examples/all-clusters-app/cc13x4_26x4/main/ZclCallbacks.cpp
+++ b/examples/all-clusters-app/cc13x4_26x4/main/ZclCallbacks.cpp
@@ -30,7 +30,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
using namespace ::chip;
diff --git a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp
index 0668411..6f35995 100644
--- a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp
+++ b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp
@@ -22,6 +22,10 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
+#include <string>
+#include <tuple>
+#include <vector>
+
#if CONFIG_HAVE_DISPLAY
using namespace ::chip;
using namespace ::chip::Credentials;
diff --git a/examples/all-clusters-app/esp32/main/QRCodeScreen.cpp b/examples/all-clusters-app/esp32/main/QRCodeScreen.cpp
index 578f440..ac39b94 100644
--- a/examples/all-clusters-app/esp32/main/QRCodeScreen.cpp
+++ b/examples/all-clusters-app/esp32/main/QRCodeScreen.cpp
@@ -42,6 +42,8 @@
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
+#include <string>
+
// TODO need sensible library tag when put in library
extern const char TAG[];
diff --git a/examples/all-clusters-app/esp32/main/StatusScreen.cpp b/examples/all-clusters-app/esp32/main/StatusScreen.cpp
index 55f42a3..0013bda 100644
--- a/examples/all-clusters-app/esp32/main/StatusScreen.cpp
+++ b/examples/all-clusters-app/esp32/main/StatusScreen.cpp
@@ -45,6 +45,8 @@
#include <app/server/Server.h>
#include <lib/core/DataModelTypes.h>
+#include <string>
+
#define MAX_LENGTH_SMALL_FONT 30
using namespace chip;
diff --git a/examples/all-clusters-app/esp32/main/include/QRCodeScreen.h b/examples/all-clusters-app/esp32/main/include/QRCodeScreen.h
index ced5be2..9599280 100644
--- a/examples/all-clusters-app/esp32/main/include/QRCodeScreen.h
+++ b/examples/all-clusters-app/esp32/main/include/QRCodeScreen.h
@@ -31,6 +31,7 @@
#include "ScreenManager.h"
#include <cstdint>
+#include <string>
#include <vector>
class QRCodeScreen : public Screen
diff --git a/examples/all-clusters-app/esp32/main/main.cpp b/examples/all-clusters-app/esp32/main/main.cpp
index a3af54f..af94d2b 100644
--- a/examples/all-clusters-app/esp32/main/main.cpp
+++ b/examples/all-clusters-app/esp32/main/main.cpp
@@ -34,7 +34,7 @@
#include "platform/PlatformManager.h"
#include "shell_extension/launch.h"
#include <app/server/OnboardingCodesUtil.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <binding-handler.h>
#include <common/CHIPDeviceManager.h>
#include <common/Esp32AppServer.h>
diff --git a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
index b75b5ab..0d0ba0f 100644
--- a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
@@ -29,6 +29,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp
index d1bab36..8effe64 100644
--- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp
+++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp
@@ -25,6 +25,7 @@
#include <app/clusters/switch-server/switch-server.h>
#include <app/server/Server.h>
#include <app/util/att-storage.h>
+#include <app/util/attribute-storage.h>
#include <platform/PlatformManager.h>
#include <air-quality-instance.h>
@@ -35,6 +36,8 @@
#include <oven-operational-state-delegate.h>
#include <rvc-modes.h>
+#include <string>
+
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;
diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h
index 4022b06..f097c53 100644
--- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h
+++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h
@@ -23,6 +23,8 @@
#include <json/json.h>
#include <platform/DiagnosticDataProvider.h>
+#include <string>
+
class AllClustersAppCommandHandler
{
public:
diff --git a/examples/all-clusters-app/linux/AppOptions.cpp b/examples/all-clusters-app/linux/AppOptions.cpp
index 50be656..bd51471 100644
--- a/examples/all-clusters-app/linux/AppOptions.cpp
+++ b/examples/all-clusters-app/linux/AppOptions.cpp
@@ -21,6 +21,8 @@
#include <app/server/CommissioningWindowManager.h>
#include <app/server/Server.h>
+#include <string>
+
using namespace chip::ArgParser;
using chip::ArgParser::OptionDef;
diff --git a/examples/all-clusters-app/linux/AppOptions.h b/examples/all-clusters-app/linux/AppOptions.h
index dfdd2c0..69c1af8 100644
--- a/examples/all-clusters-app/linux/AppOptions.h
+++ b/examples/all-clusters-app/linux/AppOptions.h
@@ -22,6 +22,8 @@
#include <app/tests/suites/credentials/TestHarnessDACProvider.h>
+#include <string>
+
class AppOptions
{
public:
diff --git a/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp b/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp
index 4dc94da..afb75a7 100644
--- a/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp
+++ b/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp
@@ -20,6 +20,8 @@
#include <lib/support/SafeInt.h>
+#include <string>
+
using namespace chip;
using namespace chip::app::Clusters::DiagnosticLogs;
diff --git a/examples/all-clusters-app/linux/include/diagnostic-logs-provider-delegate-impl.h b/examples/all-clusters-app/linux/include/diagnostic-logs-provider-delegate-impl.h
index c0e69f1..f90c8d6 100644
--- a/examples/all-clusters-app/linux/include/diagnostic-logs-provider-delegate-impl.h
+++ b/examples/all-clusters-app/linux/include/diagnostic-logs-provider-delegate-impl.h
@@ -22,6 +22,7 @@
#include <fstream>
#include <map>
+#include <string>
namespace chip {
namespace app {
diff --git a/examples/all-clusters-app/linux/main-common.cpp b/examples/all-clusters-app/linux/main-common.cpp
index 8760bcb..73af031 100644
--- a/examples/all-clusters-app/linux/main-common.cpp
+++ b/examples/all-clusters-app/linux/main-common.cpp
@@ -48,7 +48,6 @@
#include <app/clusters/time-synchronization-server/time-synchronization-server.h>
#include <app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
#include <app/util/attribute-storage.h>
#include <lib/support/CHIPMem.h>
@@ -61,6 +60,8 @@
#include <transport/SessionManager.h>
#include <transport/raw/PeerAddress.h>
+#include <string>
+
using namespace chip;
using namespace chip::app;
using namespace chip::DeviceLayer;
diff --git a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp
index efdee71..3551087 100644
--- a/examples/all-clusters-app/nrfconnect/main/AppTask.cpp
+++ b/examples/all-clusters-app/nrfconnect/main/AppTask.cpp
@@ -31,6 +31,7 @@
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/ota-requestor/OTATestEventTriggerHandler.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
diff --git a/examples/all-clusters-app/nxp/common/main/AppTask.cpp b/examples/all-clusters-app/nxp/common/main/AppTask.cpp
index 7f4c1f2..0b945d4 100644
--- a/examples/all-clusters-app/nxp/common/main/AppTask.cpp
+++ b/examples/all-clusters-app/nxp/common/main/AppTask.cpp
@@ -23,6 +23,7 @@
#include "ICDUtil.h"
#include <app/InteractionModelEngine.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
using namespace chip;
using namespace chip::app::Clusters;
diff --git a/examples/all-clusters-app/nxp/common/main/ZclCallbacks.cpp b/examples/all-clusters-app/nxp/common/main/ZclCallbacks.cpp
index 86ea10f..d4be6f1 100644
--- a/examples/all-clusters-app/nxp/common/main/ZclCallbacks.cpp
+++ b/examples/all-clusters-app/nxp/common/main/ZclCallbacks.cpp
@@ -25,7 +25,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
using namespace ::chip;
diff --git a/examples/all-clusters-app/tizen/src/main.cpp b/examples/all-clusters-app/tizen/src/main.cpp
index e3e8aa7..49c9f06 100644
--- a/examples/all-clusters-app/tizen/src/main.cpp
+++ b/examples/all-clusters-app/tizen/src/main.cpp
@@ -20,7 +20,7 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <platform/Tizen/NetworkCommissioningDriver.h>
#include <static-supported-temperature-levels.h>
diff --git a/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp b/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp
index 67b13d9..a02dd61 100644
--- a/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp
+++ b/examples/all-clusters-minimal-app/ameba/main/DeviceCallbacks.cpp
@@ -29,7 +29,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/all-clusters-minimal-app/ameba/main/chipinterface.cpp b/examples/all-clusters-minimal-app/ameba/main/chipinterface.cpp
index bc297df..abb0791 100644
--- a/examples/all-clusters-minimal-app/ameba/main/chipinterface.cpp
+++ b/examples/all-clusters-minimal-app/ameba/main/chipinterface.cpp
@@ -28,7 +28,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/core/ErrorStr.h>
diff --git a/examples/all-clusters-minimal-app/asr/src/AppTask.cpp b/examples/all-clusters-minimal-app/asr/src/AppTask.cpp
index d6f77d2..f9d05c2 100644
--- a/examples/all-clusters-minimal-app/asr/src/AppTask.cpp
+++ b/examples/all-clusters-minimal-app/asr/src/AppTask.cpp
@@ -34,6 +34,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <event_groups.h>
#include <platform/ASR/NetworkCommissioningDriver.h>
diff --git a/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp b/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp
index 8926659..c40de8c 100644
--- a/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp
+++ b/examples/all-clusters-minimal-app/asr/src/DeviceCallbacks.cpp
@@ -29,7 +29,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp
index c588c84..f56a3e6 100644
--- a/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp
+++ b/examples/all-clusters-minimal-app/esp32/main/DeviceWithDisplay.cpp
@@ -21,6 +21,9 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
+#include <string>
+#include <tuple>
+
#if CONFIG_HAVE_DISPLAY
using namespace ::chip;
using namespace ::chip::Credentials;
diff --git a/examples/all-clusters-minimal-app/esp32/main/QRCodeScreen.cpp b/examples/all-clusters-minimal-app/esp32/main/QRCodeScreen.cpp
index 578f440..ac39b94 100644
--- a/examples/all-clusters-minimal-app/esp32/main/QRCodeScreen.cpp
+++ b/examples/all-clusters-minimal-app/esp32/main/QRCodeScreen.cpp
@@ -42,6 +42,8 @@
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
+#include <string>
+
// TODO need sensible library tag when put in library
extern const char TAG[];
diff --git a/examples/all-clusters-minimal-app/esp32/main/StatusScreen.cpp b/examples/all-clusters-minimal-app/esp32/main/StatusScreen.cpp
index 55f42a3..0013bda 100644
--- a/examples/all-clusters-minimal-app/esp32/main/StatusScreen.cpp
+++ b/examples/all-clusters-minimal-app/esp32/main/StatusScreen.cpp
@@ -45,6 +45,8 @@
#include <app/server/Server.h>
#include <lib/core/DataModelTypes.h>
+#include <string>
+
#define MAX_LENGTH_SMALL_FONT 30
using namespace chip;
diff --git a/examples/all-clusters-minimal-app/esp32/main/include/QRCodeScreen.h b/examples/all-clusters-minimal-app/esp32/main/include/QRCodeScreen.h
index da0ca8d..c02cd61 100644
--- a/examples/all-clusters-minimal-app/esp32/main/include/QRCodeScreen.h
+++ b/examples/all-clusters-minimal-app/esp32/main/include/QRCodeScreen.h
@@ -32,6 +32,7 @@
#include "ScreenManager.h"
#include <cstdint>
+#include <string>
#include <vector>
class QRCodeScreen : public Screen
diff --git a/examples/all-clusters-minimal-app/esp32/main/main.cpp b/examples/all-clusters-minimal-app/esp32/main/main.cpp
index 0ac5386..993dc60 100644
--- a/examples/all-clusters-minimal-app/esp32/main/main.cpp
+++ b/examples/all-clusters-minimal-app/esp32/main/main.cpp
@@ -36,7 +36,7 @@
#include <common/CHIPDeviceManager.h>
#include <app/server/OnboardingCodesUtil.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <binding-handler.h>
#include <common/Esp32AppServer.h>
#include <common/Esp32ThreadInit.h>
diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp
index 7cbaf6f..ccc271d 100644
--- a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp
@@ -29,6 +29,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
diff --git a/examples/all-clusters-minimal-app/linux/main-common.cpp b/examples/all-clusters-minimal-app/linux/main-common.cpp
index d9f0a51..f0bf3ca 100644
--- a/examples/all-clusters-minimal-app/linux/main-common.cpp
+++ b/examples/all-clusters-minimal-app/linux/main-common.cpp
@@ -21,7 +21,6 @@
#include <app/CommandHandler.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
#include <lib/support/CHIPMem.h>
#include <new>
diff --git a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp
index b3c8b95..86bfe7a 100644
--- a/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp
+++ b/examples/all-clusters-minimal-app/nrfconnect/main/AppTask.cpp
@@ -26,6 +26,7 @@
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
diff --git a/examples/all-clusters-minimal-app/tizen/src/main.cpp b/examples/all-clusters-minimal-app/tizen/src/main.cpp
index 3276239..fd2a345 100644
--- a/examples/all-clusters-minimal-app/tizen/src/main.cpp
+++ b/examples/all-clusters-minimal-app/tizen/src/main.cpp
@@ -20,7 +20,7 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <platform/Tizen/NetworkCommissioningDriver.h>
#include <TizenServiceAppMain.h>
diff --git a/examples/android/CHIPTool/app/src/main/cpp/native-lib.cpp b/examples/android/CHIPTool/app/src/main/cpp/native-lib.cpp
index 4a0235a..abf5715 100644
--- a/examples/android/CHIPTool/app/src/main/cpp/native-lib.cpp
+++ b/examples/android/CHIPTool/app/src/main/cpp/native-lib.cpp
@@ -26,6 +26,8 @@
#include <jni.h>
#include <lib/support/CodeUtils.h>
+#include <string>
+
// This is just a sample function to demonstrate end-to-end calling in/out of CHIP stack
// is working.
std::string base38Encode(void)
diff --git a/examples/bridge-app/asr/src/AppTask.cpp b/examples/bridge-app/asr/src/AppTask.cpp
index 9583fb3..ea95500 100755
--- a/examples/bridge-app/asr/src/AppTask.cpp
+++ b/examples/bridge-app/asr/src/AppTask.cpp
@@ -26,6 +26,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <platform/ASR/NetworkCommissioningDriver.h>
#include <platform/CHIPDeviceLayer.h>
diff --git a/examples/bridge-app/asr/src/DeviceCallbacks.cpp b/examples/bridge-app/asr/src/DeviceCallbacks.cpp
index f16b4c9..232e227 100644
--- a/examples/bridge-app/asr/src/DeviceCallbacks.cpp
+++ b/examples/bridge-app/asr/src/DeviceCallbacks.cpp
@@ -32,7 +32,6 @@
#include <app/InteractionModelEngine.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp b/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp
index 9d4eda9..3508068 100644
--- a/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp
+++ b/examples/bridge-app/asr/subdevice/SubDeviceManager.cpp
@@ -27,6 +27,7 @@
#include <app/reporting/reporting.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <lib/core/CHIPError.h>
#include <lib/core/ErrorStr.h>
diff --git a/examples/bridge-app/esp32/main/main.cpp b/examples/bridge-app/esp32/main/main.cpp
index 07db2ba..016b758 100644
--- a/examples/bridge-app/esp32/main/main.cpp
+++ b/examples/bridge-app/esp32/main/main.cpp
@@ -26,6 +26,7 @@
#include <app/reporting/reporting.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <common/Esp32AppServer.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
diff --git a/examples/bridge-app/linux/Device.cpp b/examples/bridge-app/linux/Device.cpp
index e049e27..d786226 100644
--- a/examples/bridge-app/linux/Device.cpp
+++ b/examples/bridge-app/linux/Device.cpp
@@ -22,6 +22,8 @@
#include <cstdio>
#include <platform/CHIPDeviceLayer.h>
+#include <string>
+
using namespace chip::app::Clusters::Actions;
Device::Device(const char * szDeviceName, std::string szLocation)
diff --git a/examples/bridge-app/linux/include/Device.h b/examples/bridge-app/linux/include/Device.h
index d5c8434..1a5f5bb 100644
--- a/examples/bridge-app/linux/include/Device.h
+++ b/examples/bridge-app/linux/include/Device.h
@@ -24,6 +24,7 @@
#include <stdint.h>
#include <functional>
+#include <string>
#include <vector>
class Device
diff --git a/examples/bridge-app/linux/main.cpp b/examples/bridge-app/linux/main.cpp
index c569e7c..3016ece 100644
--- a/examples/bridge-app/linux/main.cpp
+++ b/examples/bridge-app/linux/main.cpp
@@ -26,8 +26,8 @@
#include <app/EventLogging.h>
#include <app/reporting/reporting.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <app/util/util.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
@@ -48,6 +48,7 @@
#include <cassert>
#include <iostream>
+#include <string>
#include <vector>
using namespace chip;
diff --git a/examples/bridge-app/telink/include/Device.h b/examples/bridge-app/telink/include/Device.h
index bd91dcb..19b3b1b 100644
--- a/examples/bridge-app/telink/include/Device.h
+++ b/examples/bridge-app/telink/include/Device.h
@@ -20,6 +20,7 @@
#include <functional>
#include <stdbool.h>
+#include <string>
#include <stdint.h>
diff --git a/examples/bridge-app/telink/src/AppTask.cpp b/examples/bridge-app/telink/src/AppTask.cpp
index 72a997c..d70f9c0 100644
--- a/examples/bridge-app/telink/src/AppTask.cpp
+++ b/examples/bridge-app/telink/src/AppTask.cpp
@@ -21,6 +21,7 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/reporting/reporting.h>
+#include <app/util/endpoint-config-api.h>
#include <lib/support/ZclString.h>
LOG_MODULE_DECLARE(app, CONFIG_CHIP_APP_LOG_LEVEL);
diff --git a/examples/bridge-app/telink/src/Device.cpp b/examples/bridge-app/telink/src/Device.cpp
index 053bf2c..769f1ec 100644
--- a/examples/bridge-app/telink/src/Device.cpp
+++ b/examples/bridge-app/telink/src/Device.cpp
@@ -21,6 +21,8 @@
#include <lib/support/CHIPMemString.h>
#include <platform/CHIPDeviceLayer.h>
+#include <string>
+
using namespace ::chip::Platform;
Device::Device(const char * szDeviceName, const char * szLocation)
diff --git a/examples/chef/ameba/main/DeviceCallbacks.cpp b/examples/chef/ameba/main/DeviceCallbacks.cpp
index fd8a63e..90c783a 100644
--- a/examples/chef/ameba/main/DeviceCallbacks.cpp
+++ b/examples/chef/ameba/main/DeviceCallbacks.cpp
@@ -29,7 +29,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/chef/ameba/main/chipinterface.cpp b/examples/chef/ameba/main/chipinterface.cpp
index ad9946e..f747cbb 100644
--- a/examples/chef/ameba/main/chipinterface.cpp
+++ b/examples/chef/ameba/main/chipinterface.cpp
@@ -29,7 +29,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <lib/core/ErrorStr.h>
diff --git a/examples/chef/common/chef-laundry-washer-controls-delegate-impl.h b/examples/chef/common/chef-laundry-washer-controls-delegate-impl.h
index 15a7248..f9d3d1b 100644
--- a/examples/chef/common/chef-laundry-washer-controls-delegate-impl.h
+++ b/examples/chef/common/chef-laundry-washer-controls-delegate-impl.h
@@ -20,7 +20,6 @@
#include <app/clusters/laundry-washer-controls-server/laundry-washer-controls-delegate.h>
#include <app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
diff --git a/examples/chef/common/chef-laundry-washer-mode.h b/examples/chef/common/chef-laundry-washer-mode.h
index 2f59b0d..5d35c03 100644
--- a/examples/chef/common/chef-laundry-washer-mode.h
+++ b/examples/chef/common/chef-laundry-washer-mode.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/chef/common/chef-rvc-mode-delegate.h b/examples/chef/common/chef-rvc-mode-delegate.h
index 3b08552..5f96957 100644
--- a/examples/chef/common/chef-rvc-mode-delegate.h
+++ b/examples/chef/common/chef-rvc-mode-delegate.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/chef/common/clusters/audio-output/AudioOutputManager.h b/examples/chef/common/clusters/audio-output/AudioOutputManager.h
index 5f9157d..ad64b7c 100644
--- a/examples/chef/common/clusters/audio-output/AudioOutputManager.h
+++ b/examples/chef/common/clusters/audio-output/AudioOutputManager.h
@@ -19,6 +19,7 @@
#pragma once
#include <app/clusters/audio-output-server/audio-output-server.h>
+#include <string>
#include <vector>
class AudioOutputManager : public chip::app::Clusters::AudioOutput::Delegate
diff --git a/examples/chef/common/clusters/channel/ChannelManager.cpp b/examples/chef/common/clusters/channel/ChannelManager.cpp
index 36df31a..c47bf44 100644
--- a/examples/chef/common/clusters/channel/ChannelManager.cpp
+++ b/examples/chef/common/clusters/channel/ChannelManager.cpp
@@ -23,6 +23,7 @@
#include <iostream>
#include <sstream>
+#include <string>
#include <vector>
using namespace chip;
diff --git a/examples/chef/common/clusters/door-lock/chef-doorlock-stubs.cpp b/examples/chef/common/clusters/door-lock/chef-doorlock-stubs.cpp
index 7d92300..90b9fd0 100644
--- a/examples/chef/common/clusters/door-lock/chef-doorlock-stubs.cpp
+++ b/examples/chef/common/clusters/door-lock/chef-doorlock-stubs.cpp
@@ -17,7 +17,6 @@
*/
#include <app/data-model/Nullable.h>
-#include <app/util/af.h>
#include <lib/core/DataModelTypes.h>
#ifdef MATTER_DM_PLUGIN_DOOR_LOCK_SERVER
diff --git a/examples/chef/common/clusters/door-lock/chef-lock-endpoint.cpp b/examples/chef/common/clusters/door-lock/chef-lock-endpoint.cpp
index 4770a9c..c7fe569 100644
--- a/examples/chef/common/clusters/door-lock/chef-lock-endpoint.cpp
+++ b/examples/chef/common/clusters/door-lock/chef-lock-endpoint.cpp
@@ -17,7 +17,6 @@
*/
#include <app-common/zap-generated/attributes/Accessors.h>
-#include <app/util/af.h>
#include <cstring>
#include <platform/CHIPDeviceLayer.h>
#include <platform/internal/CHIPDeviceLayerInternal.h>
diff --git a/examples/chef/common/clusters/door-lock/chef-lock-manager.cpp b/examples/chef/common/clusters/door-lock/chef-lock-manager.cpp
index 0b81cce..b6c3f7a 100644
--- a/examples/chef/common/clusters/door-lock/chef-lock-manager.cpp
+++ b/examples/chef/common/clusters/door-lock/chef-lock-manager.cpp
@@ -15,7 +15,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include <app/util/af.h>
#include <iostream>
#include <lib/support/logging/CHIPLogging.h>
diff --git a/examples/chef/common/clusters/door-lock/chef-lock-manager.h b/examples/chef/common/clusters/door-lock/chef-lock-manager.h
index 709f13c..f941620 100644
--- a/examples/chef/common/clusters/door-lock/chef-lock-manager.h
+++ b/examples/chef/common/clusters/door-lock/chef-lock-manager.h
@@ -22,8 +22,6 @@
#include <app/clusters/door-lock-server/door-lock-server.h>
#include <cstdint>
-#include <app/util/af.h>
-
class LockManager
{
public:
diff --git a/examples/chef/common/clusters/media-input/MediaInputManager.h b/examples/chef/common/clusters/media-input/MediaInputManager.h
index 104db65..ebd4a43 100644
--- a/examples/chef/common/clusters/media-input/MediaInputManager.h
+++ b/examples/chef/common/clusters/media-input/MediaInputManager.h
@@ -20,6 +20,8 @@
#include <app/AttributeAccessInterface.h>
#include <app/clusters/media-input-server/media-input-server.h>
+
+#include <string>
#include <vector>
class MediaInputManager : public chip::app::Clusters::MediaInput::Delegate
diff --git a/examples/chef/common/clusters/media-playback/MediaPlaybackManager.cpp b/examples/chef/common/clusters/media-playback/MediaPlaybackManager.cpp
index 512da29..14be124 100644
--- a/examples/chef/common/clusters/media-playback/MediaPlaybackManager.cpp
+++ b/examples/chef/common/clusters/media-playback/MediaPlaybackManager.cpp
@@ -21,6 +21,8 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>
+#include <string>
+
using namespace std;
using namespace chip::app::DataModel;
using namespace chip::app::Clusters::MediaPlayback;
diff --git a/examples/chef/common/clusters/target-navigator/TargetNavigatorManager.cpp b/examples/chef/common/clusters/target-navigator/TargetNavigatorManager.cpp
index 17acf11..be20f92 100644
--- a/examples/chef/common/clusters/target-navigator/TargetNavigatorManager.cpp
+++ b/examples/chef/common/clusters/target-navigator/TargetNavigatorManager.cpp
@@ -20,6 +20,9 @@
#include "TargetNavigatorManager.h"
#include <app-common/zap-generated/attributes/Accessors.h>
+#include <list>
+#include <string>
+
using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::TargetNavigator;
diff --git a/examples/chef/common/clusters/target-navigator/TargetNavigatorManager.h b/examples/chef/common/clusters/target-navigator/TargetNavigatorManager.h
index 21a08b9..e952808 100644
--- a/examples/chef/common/clusters/target-navigator/TargetNavigatorManager.h
+++ b/examples/chef/common/clusters/target-navigator/TargetNavigatorManager.h
@@ -19,6 +19,8 @@
#include <app/clusters/target-navigator-server/target-navigator-server.h>
+#include <string>
+
class TargetNavigatorManager : public chip::app::Clusters::TargetNavigator::Delegate
{
using TargetInfoType = chip::app::Clusters::TargetNavigator::Structs::TargetInfoStruct::Type;
diff --git a/examples/chef/esp32/main/QRCodeScreen.cpp b/examples/chef/esp32/main/QRCodeScreen.cpp
index 578f440..ac39b94 100644
--- a/examples/chef/esp32/main/QRCodeScreen.cpp
+++ b/examples/chef/esp32/main/QRCodeScreen.cpp
@@ -42,6 +42,8 @@
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
+#include <string>
+
// TODO need sensible library tag when put in library
extern const char TAG[];
diff --git a/examples/chef/esp32/main/include/QRCodeScreen.h b/examples/chef/esp32/main/include/QRCodeScreen.h
index e24fcd8..f4994a3 100644
--- a/examples/chef/esp32/main/include/QRCodeScreen.h
+++ b/examples/chef/esp32/main/include/QRCodeScreen.h
@@ -31,6 +31,7 @@
#if CONFIG_HAVE_DISPLAY
#include <cstdint>
+#include <string>
#include <vector>
class QRCodeScreen : public Screen
diff --git a/examples/chef/esp32/main/main.cpp b/examples/chef/esp32/main/main.cpp
index 3744cac..c5f29dc 100644
--- a/examples/chef/esp32/main/main.cpp
+++ b/examples/chef/esp32/main/main.cpp
@@ -41,7 +41,6 @@
#include <app-common/zap-generated/callback.h>
#include <app-common/zap-generated/cluster-objects.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
diff --git a/examples/chip-tool/commands/clusters/CustomArgument.h b/examples/chip-tool/commands/clusters/CustomArgument.h
index f977cd2..c7d8141 100644
--- a/examples/chip-tool/commands/clusters/CustomArgument.h
+++ b/examples/chip-tool/commands/clusters/CustomArgument.h
@@ -24,6 +24,8 @@
#include <lib/support/CHIPMemString.h>
#include <lib/support/SafeInt.h>
+#include <string>
+
#include "JsonParser.h"
namespace {
diff --git a/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp b/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp
index 2a5b2d5..9be365a 100644
--- a/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp
+++ b/examples/chip-tool/commands/common/BDXDiagnosticLogsServerDelegate.cpp
@@ -18,6 +18,7 @@
#include "BDXDiagnosticLogsServerDelegate.h"
+#include <string>
#include <unistd.h>
constexpr const char kTmpDir[] = "/tmp/";
diff --git a/examples/chip-tool/commands/common/CHIPCommand.cpp b/examples/chip-tool/commands/common/CHIPCommand.cpp
index 29de06b..c35eb11 100644
--- a/examples/chip-tool/commands/common/CHIPCommand.cpp
+++ b/examples/chip-tool/commands/common/CHIPCommand.cpp
@@ -27,6 +27,8 @@
#include <lib/support/TestGroupData.h>
#include <platform/LockTracker.h>
+#include <string>
+
#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED
#include "TraceDecoder.h"
#include "TraceHandlers.h"
diff --git a/examples/chip-tool/commands/common/CHIPCommand.h b/examples/chip-tool/commands/common/CHIPCommand.h
index 55817b5..50ab851 100644
--- a/examples/chip-tool/commands/common/CHIPCommand.h
+++ b/examples/chip-tool/commands/common/CHIPCommand.h
@@ -37,7 +37,7 @@
#include <crypto/PersistentStorageOperationalKeystore.h>
#include <crypto/RawKeySessionKeystore.h>
-#pragma once
+#include <string>
inline constexpr char kIdentityAlpha[] = "alpha";
inline constexpr char kIdentityBeta[] = "beta";
diff --git a/examples/chip-tool/commands/common/Command.cpp b/examples/chip-tool/commands/common/Command.cpp
index 8d32a3f..2c4f1eb 100644
--- a/examples/chip-tool/commands/common/Command.cpp
+++ b/examples/chip-tool/commands/common/Command.cpp
@@ -24,6 +24,7 @@
#include <functional>
#include <netdb.h>
#include <sstream>
+#include <string>
#include <sys/socket.h>
#include <sys/types.h>
diff --git a/examples/chip-tool/commands/common/Command.h b/examples/chip-tool/commands/common/Command.h
index 26b80e5..556716a 100644
--- a/examples/chip-tool/commands/common/Command.h
+++ b/examples/chip-tool/commands/common/Command.h
@@ -30,6 +30,7 @@
#include <condition_variable>
#include <memory>
#include <mutex>
+#include <string>
#include <vector>
class Command;
diff --git a/examples/chip-tool/commands/common/Commands.h b/examples/chip-tool/commands/common/Commands.h
index bb6c62d..e6a392c 100644
--- a/examples/chip-tool/commands/common/Commands.h
+++ b/examples/chip-tool/commands/common/Commands.h
@@ -24,6 +24,7 @@
#include "Command.h"
#include <map>
+#include <string>
class Commands
{
diff --git a/examples/chip-tool/commands/common/DeviceScanner.h b/examples/chip-tool/commands/common/DeviceScanner.h
index bcdcf26..0f29c87 100644
--- a/examples/chip-tool/commands/common/DeviceScanner.h
+++ b/examples/chip-tool/commands/common/DeviceScanner.h
@@ -25,6 +25,7 @@
#include <controller/CHIPDeviceController.h>
#include <lib/dnssd/platform/Dnssd.h>
+#include <string>
#include <unordered_map>
#include <vector>
diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp
index 284c145..92861f7 100644
--- a/examples/chip-tool/commands/interactive/InteractiveCommands.cpp
+++ b/examples/chip-tool/commands/interactive/InteractiveCommands.cpp
@@ -22,6 +22,9 @@
#include <editline.h>
+#include <string>
+#include <vector>
+
constexpr char kInteractiveModePrompt[] = ">>> ";
constexpr char kInteractiveModeHistoryFileName[] = "chip_tool_history";
constexpr char kInteractiveModeStopCommand[] = "quit()";
diff --git a/examples/chip-tool/commands/interactive/InteractiveCommands.h b/examples/chip-tool/commands/interactive/InteractiveCommands.h
index 88a33dc..a3b6676 100644
--- a/examples/chip-tool/commands/interactive/InteractiveCommands.h
+++ b/examples/chip-tool/commands/interactive/InteractiveCommands.h
@@ -24,6 +24,8 @@
#include <websocket-server/WebSocketServer.h>
+#include <string>
+
class Commands;
class InteractiveCommand : public CHIPCommand
diff --git a/examples/chip-tool/commands/pairing/GetCommissionerRootCertificateCommand.h b/examples/chip-tool/commands/pairing/GetCommissionerRootCertificateCommand.h
index 7a350a9..88fa95a 100644
--- a/examples/chip-tool/commands/pairing/GetCommissionerRootCertificateCommand.h
+++ b/examples/chip-tool/commands/pairing/GetCommissionerRootCertificateCommand.h
@@ -22,6 +22,8 @@
#include "ToTLVCert.h"
+#include <string>
+
class GetCommissionerRootCertificateCommand : public CHIPCommand
{
public:
diff --git a/examples/chip-tool/commands/pairing/IssueNOCChainCommand.h b/examples/chip-tool/commands/pairing/IssueNOCChainCommand.h
index 8b89f07..6f18db9 100644
--- a/examples/chip-tool/commands/pairing/IssueNOCChainCommand.h
+++ b/examples/chip-tool/commands/pairing/IssueNOCChainCommand.h
@@ -22,6 +22,8 @@
#include "ToTLVCert.h"
+#include <string>
+
class IssueNOCChainCommand : public CHIPCommand
{
public:
diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp
index f872692..0f47e48 100644
--- a/examples/chip-tool/commands/pairing/PairingCommand.cpp
+++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp
@@ -28,6 +28,8 @@
#include <setup_payload/ManualSetupPayloadParser.h>
#include <setup_payload/QRCodeSetupPayloadParser.h>
+#include <string>
+
using namespace ::chip;
using namespace ::chip::Controller;
diff --git a/examples/chip-tool/commands/pairing/ToTLVCert.cpp b/examples/chip-tool/commands/pairing/ToTLVCert.cpp
index 2c06b7f..3a54d37 100644
--- a/examples/chip-tool/commands/pairing/ToTLVCert.cpp
+++ b/examples/chip-tool/commands/pairing/ToTLVCert.cpp
@@ -21,6 +21,8 @@
#include <credentials/CHIPCert.h>
#include <lib/support/Base64.h>
+#include <string>
+
constexpr char kBase64Header[] = "base64:";
constexpr size_t kBase64HeaderLen = ArraySize(kBase64Header) - 1;
diff --git a/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.cpp b/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.cpp
index c6afc4a..1a9a7e4 100644
--- a/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.cpp
+++ b/examples/chip-tool/commands/payload/SetupPayloadGenerateCommand.cpp
@@ -24,6 +24,8 @@
#include <setup_payload/QRCodeSetupPayloadParser.h>
#include <setup_payload/SetupPayload.h>
+#include <string>
+
using namespace ::chip;
void SetupPayloadGenerateCommand::ConfigurePayload(SetupPayload & payload)
diff --git a/examples/chip-tool/commands/payload/SetupPayloadParseCommand.cpp b/examples/chip-tool/commands/payload/SetupPayloadParseCommand.cpp
index 1bec630..7ab62c7 100644
--- a/examples/chip-tool/commands/payload/SetupPayloadParseCommand.cpp
+++ b/examples/chip-tool/commands/payload/SetupPayloadParseCommand.cpp
@@ -22,6 +22,8 @@
#include <setup_payload/QRCodeSetupPayloadParser.h>
#include <setup_payload/SetupPayload.h>
+#include <string>
+
using namespace ::chip;
namespace {
diff --git a/examples/chip-tool/commands/payload/SetupPayloadParseCommand.h b/examples/chip-tool/commands/payload/SetupPayloadParseCommand.h
index 0847402..925df0a 100644
--- a/examples/chip-tool/commands/payload/SetupPayloadParseCommand.h
+++ b/examples/chip-tool/commands/payload/SetupPayloadParseCommand.h
@@ -21,6 +21,8 @@
#include "../common/Command.h"
#include <setup_payload/SetupPayload.h>
+#include <string>
+
class SetupPayloadParseCommand : public Command
{
public:
diff --git a/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.cpp b/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.cpp
index 238e753..d0dcc8f 100644
--- a/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.cpp
+++ b/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.cpp
@@ -21,6 +21,8 @@
#include <setup_payload/SetupPayload.h>
#include <support/verhoeff/Verhoeff.h>
+#include <string>
+
using namespace ::chip;
CHIP_ERROR SetupPayloadVerhoeffVerify::Run()
diff --git a/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.h b/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.h
index 0f531e3..bf61ead 100644
--- a/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.h
+++ b/examples/chip-tool/commands/payload/SetupPayloadVerhoeff.h
@@ -21,6 +21,8 @@
#include "../common/Command.h"
#include <setup_payload/SetupPayload.h>
+#include <string>
+
class SetupPayloadVerhoeffVerify : public Command
{
public:
diff --git a/examples/common/pigweed/rpc_services/Attributes.h b/examples/common/pigweed/rpc_services/Attributes.h
index 78e310f..e246c53 100644
--- a/examples/common/pigweed/rpc_services/Attributes.h
+++ b/examples/common/pigweed/rpc_services/Attributes.h
@@ -25,6 +25,7 @@
#include <app/InteractionModelEngine.h>
#include <app/MessageDef/AttributeReportIBs.h>
#include <app/util/attribute-storage.h>
+#include <app/util/attribute-table.h>
#include <app/util/ember-compatibility-functions.h>
#include <lib/core/TLV.h>
#include <lib/core/TLVTags.h>
diff --git a/examples/common/pigweed/rpc_services/Descriptor.h b/examples/common/pigweed/rpc_services/Descriptor.h
index 4803883..a6760cd 100644
--- a/examples/common/pigweed/rpc_services/Descriptor.h
+++ b/examples/common/pigweed/rpc_services/Descriptor.h
@@ -23,6 +23,7 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
+#include <app/util/endpoint-config-api.h>
#include <platform/PlatformManager.h>
namespace chip {
diff --git a/examples/common/screen-framework/ScreenManager.cpp b/examples/common/screen-framework/ScreenManager.cpp
index 0d35259..6e2dfe1 100644
--- a/examples/common/screen-framework/ScreenManager.cpp
+++ b/examples/common/screen-framework/ScreenManager.cpp
@@ -30,6 +30,7 @@
#include <lib/support/CHIPMem.h>
#include <cassert>
+#include <string>
#include <vector>
uint16_t ScreenFontHeight;
diff --git a/examples/common/tracing/TraceDecoder.cpp b/examples/common/tracing/TraceDecoder.cpp
index 1d6828b..115c5d0 100644
--- a/examples/common/tracing/TraceDecoder.cpp
+++ b/examples/common/tracing/TraceDecoder.cpp
@@ -25,7 +25,9 @@
#include <lib/support/BytesToHex.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/StringBuilder.h>
+#include <string>
#include <transport/raw/MessageHeader.h>
+#include <vector>
constexpr uint16_t kMaxLineLen = 4096;
constexpr const char jsonPrefix[] = " json\t";
diff --git a/examples/common/tracing/TraceDecoder.h b/examples/common/tracing/TraceDecoder.h
index 4630b55..9a99041 100644
--- a/examples/common/tracing/TraceDecoder.h
+++ b/examples/common/tracing/TraceDecoder.h
@@ -24,6 +24,8 @@
#include <json/json.h>
#include <lib/core/CHIPError.h>
+#include <string>
+
namespace chip {
namespace trace {
diff --git a/examples/common/websocket-server/WebSocketServer.cpp b/examples/common/websocket-server/WebSocketServer.cpp
index 2dba035..2f5fb9f 100644
--- a/examples/common/websocket-server/WebSocketServer.cpp
+++ b/examples/common/websocket-server/WebSocketServer.cpp
@@ -23,6 +23,7 @@
#include <deque>
#include <mutex>
+#include <string>
constexpr uint16_t kDefaultWebSocketServerPort = 9002;
constexpr uint16_t kMaxMessageBufferLen = 8192;
diff --git a/examples/contact-sensor-app/linux/main.cpp b/examples/contact-sensor-app/linux/main.cpp
index 0b520bd..f1d2889 100644
--- a/examples/contact-sensor-app/linux/main.cpp
+++ b/examples/contact-sensor-app/linux/main.cpp
@@ -17,7 +17,6 @@
*/
#include <AppMain.h>
-#include <app/util/af.h>
#include <platform/CHIPDeviceConfig.h>
#if defined(CHIP_IMGUI_ENABLED) && CHIP_IMGUI_ENABLED
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp b/examples/contact-sensor-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
index fafcb37..2a38dd8 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
+++ b/examples/contact-sensor-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
@@ -27,7 +27,6 @@
#include <app/ConcreteAttributePath.h>
#include <app/EventLogging.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
using namespace ::chip;
using namespace ::chip::app;
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp b/examples/contact-sensor-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
index 5937d13..e69daab 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
@@ -28,7 +28,6 @@
#include <app/ConcreteAttributePath.h>
#include <app/EventLogging.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
#if CONFIG_DIAG_LOGS_DEMO
#include "DiagnosticLogsProviderDelegateImpl.h"
diff --git a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm
index 205b56d..bb232e3 100644
--- a/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm
+++ b/examples/darwin-framework-tool/commands/common/CHIPCommandBridge.mm
@@ -26,6 +26,9 @@
#include "MTRError_Utils.h"
+#include <map>
+#include <string>
+
static CHIPToolPersistentStorageDelegate * storage = nil;
std::set<CHIPCommandBridge *> CHIPCommandBridge::sDeferredCleanups;
std::map<std::string, MTRDeviceController *> CHIPCommandBridge::mControllers;
diff --git a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm
index 2219b62..2652e2c 100644
--- a/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm
+++ b/examples/darwin-framework-tool/commands/interactive/InteractiveCommands.mm
@@ -22,6 +22,8 @@
#include <logging/logging.h>
#include <platform/logging/LogV.h>
+#include <string>
+
#include <editline.h>
#include <stdlib.h>
diff --git a/examples/dishwasher-app/asr/src/AppTask.cpp b/examples/dishwasher-app/asr/src/AppTask.cpp
index 8e9cb88..8c038cf 100644
--- a/examples/dishwasher-app/asr/src/AppTask.cpp
+++ b/examples/dishwasher-app/asr/src/AppTask.cpp
@@ -23,6 +23,7 @@
#include "qrcodegen.h"
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
diff --git a/examples/dishwasher-app/asr/src/DeviceCallbacks.cpp b/examples/dishwasher-app/asr/src/DeviceCallbacks.cpp
index 23e6de9..9f9e7fd 100644
--- a/examples/dishwasher-app/asr/src/DeviceCallbacks.cpp
+++ b/examples/dishwasher-app/asr/src/DeviceCallbacks.cpp
@@ -31,7 +31,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h
index 973e1e6..a61be0f 100644
--- a/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h
+++ b/examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h
@@ -20,7 +20,6 @@
#include "app/clusters/device-energy-management-server/device-energy-management-server.h"
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
diff --git a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h
index e6f5c8c..df0d08b 100644
--- a/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h
+++ b/examples/energy-management-app/energy-management-common/include/EnergyEvseDelegateImpl.h
@@ -21,7 +21,6 @@
#include "app/clusters/energy-evse-server/energy-evse-server.h"
#include <EVSECallbacks.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
diff --git a/examples/energy-management-app/energy-management-common/include/device-energy-management-modes.h b/examples/energy-management-app/energy-management-common/include/device-energy-management-modes.h
index 75d1a66..61c6589 100644
--- a/examples/energy-management-app/energy-management-common/include/device-energy-management-modes.h
+++ b/examples/energy-management-app/energy-management-common/include/device-energy-management-modes.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/energy-management-app/energy-management-common/include/energy-evse-modes.h b/examples/energy-management-app/energy-management-common/include/energy-evse-modes.h
index 97189b0..0e8fd42 100644
--- a/examples/energy-management-app/energy-management-common/include/energy-evse-modes.h
+++ b/examples/energy-management-app/energy-management-common/include/energy-evse-modes.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/laundry-washer-app/nxp/common/main/ZclCallbacks.cpp b/examples/laundry-washer-app/nxp/common/main/ZclCallbacks.cpp
index 0a26df6..7602ab4 100644
--- a/examples/laundry-washer-app/nxp/common/main/ZclCallbacks.cpp
+++ b/examples/laundry-washer-app/nxp/common/main/ZclCallbacks.cpp
@@ -25,7 +25,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
#include "laundry-washer-controls-delegate-impl.h"
diff --git a/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp b/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp
index 8463ccc..119fb71 100644
--- a/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp
+++ b/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp
@@ -28,7 +28,6 @@
#include <app-common/zap-generated/ids/Attributes.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/light-switch-app/ameba/main/chipinterface.cpp b/examples/light-switch-app/ameba/main/chipinterface.cpp
index 98bf216..c141769 100644
--- a/examples/light-switch-app/ameba/main/chipinterface.cpp
+++ b/examples/light-switch-app/ameba/main/chipinterface.cpp
@@ -30,7 +30,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
#include <platform/Ameba/NetworkCommissioningDriver.h>
diff --git a/examples/light-switch-app/asr/src/AppTask.cpp b/examples/light-switch-app/asr/src/AppTask.cpp
index f398b34..6dcabc8 100755
--- a/examples/light-switch-app/asr/src/AppTask.cpp
+++ b/examples/light-switch-app/asr/src/AppTask.cpp
@@ -33,6 +33,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
diff --git a/examples/light-switch-app/asr/src/DeviceCallbacks.cpp b/examples/light-switch-app/asr/src/DeviceCallbacks.cpp
index e967094..80d2893 100644
--- a/examples/light-switch-app/asr/src/DeviceCallbacks.cpp
+++ b/examples/light-switch-app/asr/src/DeviceCallbacks.cpp
@@ -31,7 +31,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/lighting-app/ameba/main/DeviceCallbacks.cpp b/examples/lighting-app/ameba/main/DeviceCallbacks.cpp
index 0ba785b..7783e68 100644
--- a/examples/lighting-app/ameba/main/DeviceCallbacks.cpp
+++ b/examples/lighting-app/ameba/main/DeviceCallbacks.cpp
@@ -29,7 +29,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/lighting-app/ameba/main/chipinterface.cpp b/examples/lighting-app/ameba/main/chipinterface.cpp
index 1f05a9e..461b8be 100644
--- a/examples/lighting-app/ameba/main/chipinterface.cpp
+++ b/examples/lighting-app/ameba/main/chipinterface.cpp
@@ -31,7 +31,7 @@
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
#include <platform/Ameba/NetworkCommissioningDriver.h>
diff --git a/examples/lighting-app/asr/src/AppTask.cpp b/examples/lighting-app/asr/src/AppTask.cpp
index b72ff5c..9bbd40a 100755
--- a/examples/lighting-app/asr/src/AppTask.cpp
+++ b/examples/lighting-app/asr/src/AppTask.cpp
@@ -25,6 +25,7 @@
#include "qrcodegen.h"
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
diff --git a/examples/lighting-app/asr/src/DeviceCallbacks.cpp b/examples/lighting-app/asr/src/DeviceCallbacks.cpp
index f486aba..10dc52e 100644
--- a/examples/lighting-app/asr/src/DeviceCallbacks.cpp
+++ b/examples/lighting-app/asr/src/DeviceCallbacks.cpp
@@ -32,7 +32,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/lighting-app/beken/main/DeviceCallbacks.cpp b/examples/lighting-app/beken/main/DeviceCallbacks.cpp
index f2e5b09..48b715f 100644
--- a/examples/lighting-app/beken/main/DeviceCallbacks.cpp
+++ b/examples/lighting-app/beken/main/DeviceCallbacks.cpp
@@ -30,7 +30,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/lighting-app/esp32/main/DeviceWithDisplay.cpp b/examples/lighting-app/esp32/main/DeviceWithDisplay.cpp
index b869ba5..2027bbf 100644
--- a/examples/lighting-app/esp32/main/DeviceWithDisplay.cpp
+++ b/examples/lighting-app/esp32/main/DeviceWithDisplay.cpp
@@ -25,6 +25,8 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
+#include <string>
+
using namespace ::chip;
using namespace ::chip::Credentials;
using namespace ::chip::DeviceManager;
diff --git a/examples/lighting-app/esp32/main/QRCodeScreen.cpp b/examples/lighting-app/esp32/main/QRCodeScreen.cpp
index d4113c4..a75c29e 100644
--- a/examples/lighting-app/esp32/main/QRCodeScreen.cpp
+++ b/examples/lighting-app/esp32/main/QRCodeScreen.cpp
@@ -42,6 +42,8 @@
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
+#include <string>
+
namespace {
constexpr int kVersion = 4;
diff --git a/examples/lighting-app/esp32/main/StatusScreen.cpp b/examples/lighting-app/esp32/main/StatusScreen.cpp
index 698a12d..b97da9d 100644
--- a/examples/lighting-app/esp32/main/StatusScreen.cpp
+++ b/examples/lighting-app/esp32/main/StatusScreen.cpp
@@ -45,6 +45,8 @@
#include <app/server/Server.h>
#include <lib/core/DataModelTypes.h>
+#include <string>
+
#define MAX_LENGTH_SMALL_FONT 30
using namespace chip;
diff --git a/examples/lighting-app/esp32/main/include/QRCodeScreen.h b/examples/lighting-app/esp32/main/include/QRCodeScreen.h
index 3479c7d..e6eb45d 100644
--- a/examples/lighting-app/esp32/main/include/QRCodeScreen.h
+++ b/examples/lighting-app/esp32/main/include/QRCodeScreen.h
@@ -25,6 +25,7 @@
#include "ScreenManager.h"
#include <cstdint>
+#include <string>
#include <vector>
class QRCodeScreen : public Screen
diff --git a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp
index 3d750b9..a121801 100644
--- a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp
+++ b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp
@@ -19,7 +19,6 @@
#include "LightingManager.h"
#include <app-common/zap-generated/attributes/Accessors.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
#include <stdio.h>
diff --git a/examples/lighting-app/linux/LightingAppCommandDelegate.cpp b/examples/lighting-app/linux/LightingAppCommandDelegate.cpp
index 6194693..cc5af97 100644
--- a/examples/lighting-app/linux/LightingAppCommandDelegate.cpp
+++ b/examples/lighting-app/linux/LightingAppCommandDelegate.cpp
@@ -24,8 +24,11 @@
#include <app/clusters/switch-server/switch-server.h>
#include <app/server/Server.h>
#include <app/util/att-storage.h>
+#include <app/util/attribute-storage.h>
#include <platform/PlatformManager.h>
+#include <string>
+
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;
diff --git a/examples/lighting-app/linux/main.cpp b/examples/lighting-app/linux/main.cpp
index 149898b..56cafc2 100644
--- a/examples/lighting-app/linux/main.cpp
+++ b/examples/lighting-app/linux/main.cpp
@@ -26,6 +26,8 @@
#include <app/server/Server.h>
#include <lib/support/logging/CHIPLogging.h>
+#include <string>
+
#if defined(CHIP_IMGUI_ENABLED) && CHIP_IMGUI_ENABLED
#include <imgui_ui/ui.h>
#include <imgui_ui/windows/light.h>
diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
index 5a4eee6..caccdf5 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w0/main/ZclCallbacks.cpp
@@ -25,7 +25,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
using namespace ::chip;
using namespace ::chip::app::Clusters;
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp b/examples/lighting-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
index a9c6aee..97a3fb9 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/ZclCallbacks.cpp
@@ -25,7 +25,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
using namespace ::chip;
using namespace ::chip::app::Clusters;
diff --git a/examples/lock-app/asr/src/AppTask.cpp b/examples/lock-app/asr/src/AppTask.cpp
index a90d001..4d359a4 100644
--- a/examples/lock-app/asr/src/AppTask.cpp
+++ b/examples/lock-app/asr/src/AppTask.cpp
@@ -32,6 +32,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
diff --git a/examples/lock-app/asr/src/DeviceCallbacks.cpp b/examples/lock-app/asr/src/DeviceCallbacks.cpp
index 8782f03..c4670d5 100644
--- a/examples/lock-app/asr/src/DeviceCallbacks.cpp
+++ b/examples/lock-app/asr/src/DeviceCallbacks.cpp
@@ -33,7 +33,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/lock-app/linux/src/LockAppCommandDelegate.cpp b/examples/lock-app/linux/src/LockAppCommandDelegate.cpp
index 356888b..7f2a1c8 100644
--- a/examples/lock-app/linux/src/LockAppCommandDelegate.cpp
+++ b/examples/lock-app/linux/src/LockAppCommandDelegate.cpp
@@ -21,6 +21,7 @@
#include <platform/PlatformManager.h>
#include <LockManager.h>
+#include <string>
#include <utility>
using chip::to_underlying;
diff --git a/examples/lock-app/lock-common/include/LockManager.h b/examples/lock-app/lock-common/include/LockManager.h
index eea60d5..71dcf6f 100644
--- a/examples/lock-app/lock-common/include/LockManager.h
+++ b/examples/lock-app/lock-common/include/LockManager.h
@@ -22,8 +22,6 @@
#include <app/clusters/door-lock-server/door-lock-server.h>
#include <cstdint>
-#include <app/util/af.h>
-
class LockManager
{
public:
diff --git a/examples/lock-app/lock-common/src/ZCLDoorLockCallbacks.cpp b/examples/lock-app/lock-common/src/ZCLDoorLockCallbacks.cpp
index 2b0b881..a67c51b 100644
--- a/examples/lock-app/lock-common/src/ZCLDoorLockCallbacks.cpp
+++ b/examples/lock-app/lock-common/src/ZCLDoorLockCallbacks.cpp
@@ -18,7 +18,6 @@
#include <app/clusters/door-lock-server/door-lock-server.h>
#include <app/data-model/Nullable.h>
-#include <app/util/af.h>
#include <lib/core/DataModelTypes.h>
#include "LockManager.h"
diff --git a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp
index 234ee94..381d3b4 100644
--- a/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp
+++ b/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp
@@ -22,7 +22,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/ota-provider/ota-provider-delegate.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <credentials/FabricTable.h>
#include <crypto/RandUtils.h>
#include <lib/core/TLV.h>
diff --git a/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp b/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp
index bd53af4..61223f9 100644
--- a/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp
+++ b/examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp
@@ -29,7 +29,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/ota-requestor-app/ameba/main/chipinterface.cpp b/examples/ota-requestor-app/ameba/main/chipinterface.cpp
index 841e95c..dfac5c9 100644
--- a/examples/ota-requestor-app/ameba/main/chipinterface.cpp
+++ b/examples/ota-requestor-app/ameba/main/chipinterface.cpp
@@ -24,7 +24,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <lib/core/ErrorStr.h>
#include <platform/Ameba/AmebaConfig.h>
diff --git a/examples/ota-requestor-app/asr/src/AppTask.cpp b/examples/ota-requestor-app/asr/src/AppTask.cpp
index 56910e9..78c4ec4 100755
--- a/examples/ota-requestor-app/asr/src/AppTask.cpp
+++ b/examples/ota-requestor-app/asr/src/AppTask.cpp
@@ -26,6 +26,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <platform/ASR/NetworkCommissioningDriver.h>
#include <platform/CHIPDeviceLayer.h>
diff --git a/examples/ota-requestor-app/asr/src/DeviceCallbacks.cpp b/examples/ota-requestor-app/asr/src/DeviceCallbacks.cpp
index a1fa28e..2ad405f 100644
--- a/examples/ota-requestor-app/asr/src/DeviceCallbacks.cpp
+++ b/examples/ota-requestor-app/asr/src/DeviceCallbacks.cpp
@@ -30,7 +30,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/ota-requestor-app/esp32/main/main.cpp b/examples/ota-requestor-app/esp32/main/main.cpp
index c3ee1d5..e375ded 100644
--- a/examples/ota-requestor-app/esp32/main/main.cpp
+++ b/examples/ota-requestor-app/esp32/main/main.cpp
@@ -16,7 +16,6 @@
*/
#include "DeviceCallbacks.h"
-#include "app/util/af.h"
#include "esp_heap_caps_init.h"
#include "esp_log.h"
#include "esp_netif.h"
@@ -26,6 +25,7 @@
#include "freertos/task.h"
#include "nvs_flash.h"
#include <app/server/OnboardingCodesUtil.h>
+#include <app/util/endpoint-config-api.h>
#include <common/CHIPDeviceManager.h>
#include <common/Esp32AppServer.h>
#include <credentials/DeviceAttestationCredsProvider.h>
diff --git a/examples/ota-requestor-app/genio/src/AppTask.cpp b/examples/ota-requestor-app/genio/src/AppTask.cpp
index 50d1d08..ff78e70 100644
--- a/examples/ota-requestor-app/genio/src/AppTask.cpp
+++ b/examples/ota-requestor-app/genio/src/AppTask.cpp
@@ -21,6 +21,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
diff --git a/examples/ota-requestor-app/linux/main.cpp b/examples/ota-requestor-app/linux/main.cpp
index 0cc7271..80b1622 100644
--- a/examples/ota-requestor-app/linux/main.cpp
+++ b/examples/ota-requestor-app/linux/main.cpp
@@ -22,7 +22,6 @@
#include <app/clusters/ota-requestor/DefaultOTARequestorStorage.h>
#include <app/clusters/ota-requestor/DefaultOTARequestorUserConsent.h>
#include <app/clusters/ota-requestor/ExtendedOTARequestorDriver.h>
-#include <app/util/af.h>
#include <platform/Linux/OTAImageProcessorImpl.h>
using chip::BDXDownloader;
diff --git a/examples/placeholder/linux/InteractiveServer.cpp b/examples/placeholder/linux/InteractiveServer.cpp
index daebcb6..e9ca422 100644
--- a/examples/placeholder/linux/InteractiveServer.cpp
+++ b/examples/placeholder/linux/InteractiveServer.cpp
@@ -23,6 +23,8 @@
#include <platform/CHIPDeviceLayer.h>
#include <platform/logging/LogV.h>
+#include <string>
+
using namespace chip::DeviceLayer;
namespace {
diff --git a/examples/placeholder/linux/include/static-supported-modes-manager.h b/examples/placeholder/linux/include/static-supported-modes-manager.h
index ef90de3..b4ce50b 100644
--- a/examples/placeholder/linux/include/static-supported-modes-manager.h
+++ b/examples/placeholder/linux/include/static-supported-modes-manager.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-select-server/supported-modes-manager.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
diff --git a/examples/placeholder/linux/include/static-supported-temperature-levels.h b/examples/placeholder/linux/include/static-supported-temperature-levels.h
index 3fdce87..9698df8 100644
--- a/examples/placeholder/linux/include/static-supported-temperature-levels.h
+++ b/examples/placeholder/linux/include/static-supported-temperature-levels.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/temperature-control-server/supported-temperature-levels-manager.h>
-#include <app/util/af.h>
#include <app/util/config.h>
namespace chip {
diff --git a/examples/platform/esp32/mode-support/static-supported-modes-manager.h b/examples/platform/esp32/mode-support/static-supported-modes-manager.h
index cdd7968..8d6bb3c 100644
--- a/examples/platform/esp32/mode-support/static-supported-modes-manager.h
+++ b/examples/platform/esp32/mode-support/static-supported-modes-manager.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-select-server/supported-modes-manager.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/examples/platform/esp32/pw_sys_io/sys_io_esp32.cc b/examples/platform/esp32/pw_sys_io/sys_io_esp32.cc
index c5591a1..5991b9c 100644
--- a/examples/platform/esp32/pw_sys_io/sys_io_esp32.cc
+++ b/examples/platform/esp32/pw_sys_io/sys_io_esp32.cc
@@ -29,6 +29,7 @@
#include <cinttypes>
#include <stdio.h>
#include <string.h>
+#include <string>
#define ECHO_TEST_TXD (CONFIG_EXAMPLE_UART_TXD)
#define ECHO_TEST_RXD (CONFIG_EXAMPLE_UART_RXD)
diff --git a/examples/platform/linux/NamedPipeCommands.cpp b/examples/platform/linux/NamedPipeCommands.cpp
index 9ec28b0..c77165e 100644
--- a/examples/platform/linux/NamedPipeCommands.cpp
+++ b/examples/platform/linux/NamedPipeCommands.cpp
@@ -26,6 +26,8 @@
#include <sys/types.h>
#include <unistd.h>
+#include <string>
+
static constexpr const size_t kChipEventCmdBufSize = 256;
CHIP_ERROR NamedPipeCommands::Start(std::string & path, NamedPipeCommandDelegate * delegate)
diff --git a/examples/platform/linux/Options.cpp b/examples/platform/linux/Options.cpp
index 8bf5c0b..083b8dd 100644
--- a/examples/platform/linux/Options.cpp
+++ b/examples/platform/linux/Options.cpp
@@ -19,6 +19,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <string>
#include "Options.h"
diff --git a/examples/platform/linux/system_rpc_server.cc b/examples/platform/linux/system_rpc_server.cc
index c4e45be..6323ad5 100644
--- a/examples/platform/linux/system_rpc_server.cc
+++ b/examples/platform/linux/system_rpc_server.cc
@@ -32,6 +32,8 @@
#include "pw_rpc_system_server/rpc_server.h"
#include "pw_stream/socket_stream.h"
+#include <string>
+
namespace pw::rpc::system_server {
namespace {
diff --git a/examples/platform/openiotsdk/app/openiotsdk_platform.cpp b/examples/platform/openiotsdk/app/openiotsdk_platform.cpp
index 29662d6..761b548 100644
--- a/examples/platform/openiotsdk/app/openiotsdk_platform.cpp
+++ b/examples/platform/openiotsdk/app/openiotsdk_platform.cpp
@@ -32,6 +32,7 @@
#endif
#include <DeviceInfoProviderImpl.h>
+#include <app/util/endpoint-config-api.h>
#include <lib/support/CHIPMem.h>
#include <lib/support/logging/CHIPLogging.h>
#include <platform/openiotsdk/Logging.h>
@@ -43,7 +44,6 @@
#ifdef USE_CHIP_DATA_MODEL
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#endif // USE_CHIP_DATA_MODEL
diff --git a/examples/platform/silabs/SilabsDeviceDataProvider.cpp b/examples/platform/silabs/SilabsDeviceDataProvider.cpp
index eb0f8fe..c487c33 100644
--- a/examples/platform/silabs/SilabsDeviceDataProvider.cpp
+++ b/examples/platform/silabs/SilabsDeviceDataProvider.cpp
@@ -30,6 +30,8 @@
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
#endif // SIWX917_USE_COMISSIONABLE_DATA
+#include <string>
+
namespace chip {
namespace DeviceLayer {
namespace Silabs {
diff --git a/examples/platform/silabs/SoftwareFaultReports.cpp b/examples/platform/silabs/SoftwareFaultReports.cpp
index eab4278..813a660 100644
--- a/examples/platform/silabs/SoftwareFaultReports.cpp
+++ b/examples/platform/silabs/SoftwareFaultReports.cpp
@@ -20,7 +20,7 @@
#include "FreeRTOS.h"
#include "silabs_utils.h"
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <lib/support/CHIPMemString.h>
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>
diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp
index a77f436..3d93aa3 100644
--- a/examples/platform/telink/common/src/AppTaskCommon.cpp
+++ b/examples/platform/telink/common/src/AppTaskCommon.cpp
@@ -29,6 +29,7 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#if CONFIG_BOOTLOADER_MCUBOOT
#include <OTAUtil.h>
diff --git a/examples/platform/tizen/OptionsProxy.cpp b/examples/platform/tizen/OptionsProxy.cpp
index c00ac17..1c2d41c 100644
--- a/examples/platform/tizen/OptionsProxy.cpp
+++ b/examples/platform/tizen/OptionsProxy.cpp
@@ -25,6 +25,8 @@
#include <lib/core/CHIPConfig.h>
#include <platform/CHIPDeviceConfig.h>
+#include <string>
+
namespace {
struct Option
diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
index 8ac373b..49ba548 100644
--- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -28,7 +28,7 @@
#include "FreeRTOS.h"
#include <app/EventLogging.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <examples/platform/cc13x2_26x2/CC13X2_26X2DeviceAttestationCreds.h>
diff --git a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp
index 402339b..4450b09 100644
--- a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp
+++ b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp
@@ -32,7 +32,7 @@
#include <app/EventLogging.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
#include <app/clusters/ota-requestor/BDXDownloader.h>
diff --git a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp
index 0650341..f2442ef 100644
--- a/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/pump-controller-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -28,7 +28,6 @@
#include <examples/platform/cc13x2_26x2/CC13X2_26X2DeviceAttestationCreds.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
#include <app/clusters/ota-requestor/BDXDownloader.h>
diff --git a/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp
index 2a499a9..6c84954 100644
--- a/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp
+++ b/examples/pump-controller-app/cc13x4_26x4/main/AppTask.cpp
@@ -28,7 +28,6 @@
#include <examples/platform/cc13x4_26x4/CC13X4_26X4DeviceAttestationCreds.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
#include <app/clusters/ota-requestor/BDXDownloader.h>
diff --git a/examples/refrigerator-app/asr/src/AppTask.cpp b/examples/refrigerator-app/asr/src/AppTask.cpp
index 7e2481e..5ac229c 100644
--- a/examples/refrigerator-app/asr/src/AppTask.cpp
+++ b/examples/refrigerator-app/asr/src/AppTask.cpp
@@ -23,6 +23,7 @@
#include "qrcodegen.h"
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
diff --git a/examples/refrigerator-app/asr/src/DeviceCallbacks.cpp b/examples/refrigerator-app/asr/src/DeviceCallbacks.cpp
index 23e6de9..9f9e7fd 100644
--- a/examples/refrigerator-app/asr/src/DeviceCallbacks.cpp
+++ b/examples/refrigerator-app/asr/src/DeviceCallbacks.cpp
@@ -31,7 +31,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <lib/dnssd/Advertiser.h>
diff --git a/examples/refrigerator-app/refrigerator-common/include/static-supported-temperature-levels.h b/examples/refrigerator-app/refrigerator-common/include/static-supported-temperature-levels.h
index 3fdce87..9698df8 100644
--- a/examples/refrigerator-app/refrigerator-common/include/static-supported-temperature-levels.h
+++ b/examples/refrigerator-app/refrigerator-common/include/static-supported-temperature-levels.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/temperature-control-server/supported-temperature-levels-manager.h>
-#include <app/util/af.h>
#include <app/util/config.h>
namespace chip {
diff --git a/examples/rvc-app/linux/RvcAppCommandDelegate.cpp b/examples/rvc-app/linux/RvcAppCommandDelegate.cpp
index 87eb1ee..58610e1 100644
--- a/examples/rvc-app/linux/RvcAppCommandDelegate.cpp
+++ b/examples/rvc-app/linux/RvcAppCommandDelegate.cpp
@@ -20,6 +20,7 @@
#include <platform/PlatformManager.h>
#include "rvc-device.h"
+#include <string>
#include <utility>
using namespace chip;
diff --git a/examples/rvc-app/linux/RvcAppCommandDelegate.h b/examples/rvc-app/linux/RvcAppCommandDelegate.h
index ad7c283..366772b 100644
--- a/examples/rvc-app/linux/RvcAppCommandDelegate.h
+++ b/examples/rvc-app/linux/RvcAppCommandDelegate.h
@@ -23,6 +23,8 @@
#include <json/json.h>
#include <platform/DiagnosticDataProvider.h>
+#include <string>
+
class RvcAppCommandHandler
{
public:
diff --git a/examples/rvc-app/linux/main.cpp b/examples/rvc-app/linux/main.cpp
index 4a33212..7c5c555 100644
--- a/examples/rvc-app/linux/main.cpp
+++ b/examples/rvc-app/linux/main.cpp
@@ -19,6 +19,8 @@
#include "rvc-device.h"
#include <AppMain.h>
+#include <string>
+
#define RVC_ENDPOINT 1
using namespace chip;
diff --git a/examples/rvc-app/rvc-common/include/rvc-device.h b/examples/rvc-app/rvc-common/include/rvc-device.h
index f2db0a7..f6a33a6 100644
--- a/examples/rvc-app/rvc-common/include/rvc-device.h
+++ b/examples/rvc-app/rvc-common/include/rvc-device.h
@@ -5,6 +5,8 @@
#include <app/clusters/mode-base-server/mode-base-server.h>
#include <app/clusters/operational-state-server/operational-state-server.h>
+#include <string>
+
namespace chip {
namespace app {
namespace Clusters {
diff --git a/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h b/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h
index af5e2c4..d926693 100644
--- a/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h
+++ b/examples/rvc-app/rvc-common/include/rvc-mode-delegates.h
@@ -19,7 +19,6 @@
#pragma once
#include <app/clusters/mode-base-server/mode-base-server.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>
diff --git a/examples/rvc-app/rvc-common/src/rvc-device.cpp b/examples/rvc-app/rvc-common/src/rvc-device.cpp
index b4e79d6..63da53c 100644
--- a/examples/rvc-app/rvc-common/src/rvc-device.cpp
+++ b/examples/rvc-app/rvc-common/src/rvc-device.cpp
@@ -1,5 +1,7 @@
#include "rvc-device.h"
+#include <string>
+
using namespace chip::app::Clusters;
void RvcDevice::Init()
diff --git a/examples/shell/shell_common/cmd_server.cpp b/examples/shell/shell_common/cmd_server.cpp
index cb6b5e5..6c79aae 100644
--- a/examples/shell/shell_common/cmd_server.cpp
+++ b/examples/shell/shell_common/cmd_server.cpp
@@ -25,8 +25,8 @@
#include <lib/support/CodeUtils.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <credentials/examples/DeviceAttestationCredsExample.h>
#include <transport/Session.h>
diff --git a/examples/temperature-measurement-app/asr/src/AppTask.cpp b/examples/temperature-measurement-app/asr/src/AppTask.cpp
index 4d0fd57..e55657e 100755
--- a/examples/temperature-measurement-app/asr/src/AppTask.cpp
+++ b/examples/temperature-measurement-app/asr/src/AppTask.cpp
@@ -24,6 +24,7 @@
#include "qrcodegen.h"
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <platform/CHIPDeviceLayer.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
diff --git a/examples/thermostat/asr/src/AppTask.cpp b/examples/thermostat/asr/src/AppTask.cpp
index dbdf8a8..6117fbf 100755
--- a/examples/thermostat/asr/src/AppTask.cpp
+++ b/examples/thermostat/asr/src/AppTask.cpp
@@ -27,6 +27,7 @@
#include <app/clusters/network-commissioning/network-commissioning.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <assert.h>
#include <platform/ASR/NetworkCommissioningDriver.h>
#include <platform/CHIPDeviceLayer.h>
diff --git a/examples/thermostat/linux/main.cpp b/examples/thermostat/linux/main.cpp
index 77de930..b9f8269 100644
--- a/examples/thermostat/linux/main.cpp
+++ b/examples/thermostat/linux/main.cpp
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/clusters/identify-server/identify-server.h>
-#include <app/util/af.h>
using namespace chip;
using namespace chip::app;
diff --git a/examples/thermostat/nxp/common/main/ZclCallbacks.cpp b/examples/thermostat/nxp/common/main/ZclCallbacks.cpp
index 86ea10f..d4be6f1 100644
--- a/examples/thermostat/nxp/common/main/ZclCallbacks.cpp
+++ b/examples/thermostat/nxp/common/main/ZclCallbacks.cpp
@@ -25,7 +25,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
using namespace ::chip;
diff --git a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp
index b3160b2..12e6ba4 100644
--- a/examples/tv-app/android/include/account-login/AccountLoginManager.cpp
+++ b/examples/tv-app/android/include/account-login/AccountLoginManager.cpp
@@ -19,7 +19,7 @@
#include "AccountLoginManager.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/CommandHandler.h>
-#include <app/util/af.h>
+#include <app/util/config.h>
#include <json/json.h>
#include <lib/core/DataModelTypes.h>
diff --git a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp
index 86eabb8..671daab 100644
--- a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp
+++ b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.cpp
@@ -21,6 +21,9 @@
#include <app/util/config.h>
#include <json/json.h>
+#include <list>
+#include <string>
+
using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters;
diff --git a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h
index f9e05a1..47e6c9f 100644
--- a/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h
+++ b/examples/tv-app/android/include/content-launcher/AppContentLauncherManager.h
@@ -22,6 +22,9 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/clusters/content-launch-server/content-launch-server.h>
+#include <list>
+#include <string>
+
using chip::CharSpan;
using chip::EndpointId;
using chip::app::AttributeValueEncoder;
diff --git a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp
index 087f174..9f5c2e5 100644
--- a/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp
+++ b/examples/tv-app/android/include/media-playback/AppMediaPlaybackManager.cpp
@@ -26,6 +26,8 @@
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>
+#include <string>
+
using namespace std;
using namespace chip;
using namespace chip::app;
diff --git a/examples/tv-app/android/include/messages/MessagesManager.h b/examples/tv-app/android/include/messages/MessagesManager.h
index d675906..fbc48bf 100644
--- a/examples/tv-app/android/include/messages/MessagesManager.h
+++ b/examples/tv-app/android/include/messages/MessagesManager.h
@@ -18,7 +18,9 @@
#pragma once
#include <app/clusters/messages-server/messages-server.h>
+
#include <list>
+#include <string>
class MessagesManager : public chip::app::Clusters::Messages::Delegate
{
diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp
index 23cf805..fe78842 100644
--- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp
+++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.cpp
@@ -17,8 +17,12 @@
#include "TargetNavigatorManager.h"
#include <app-common/zap-generated/attributes/Accessors.h>
+#include <app/util/config.h>
#include <json/json.h>
+#include <list>
+#include <string>
+
using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::TargetNavigator;
diff --git a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h
index 10db972..370f843 100644
--- a/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h
+++ b/examples/tv-app/android/include/target-navigator/TargetNavigatorManager.h
@@ -20,6 +20,9 @@
#include "../../java/ContentAppAttributeDelegate.h"
#include <app/clusters/target-navigator-server/target-navigator-server.h>
+#include <list>
+#include <string>
+
using chip::CharSpan;
using chip::EndpointId;
using chip::app::AttributeValueEncoder;
diff --git a/examples/tv-app/android/java/AppImpl.cpp b/examples/tv-app/android/java/AppImpl.cpp
index 1dfae0f..f5dabe6 100644
--- a/examples/tv-app/android/java/AppImpl.cpp
+++ b/examples/tv-app/android/java/AppImpl.cpp
@@ -30,7 +30,7 @@
#include <app/reporting/reporting.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#include <cstdio>
#include <inttypes.h>
#include <jni.h>
@@ -45,6 +45,8 @@
#include <platform/CHIPDeviceLayer.h>
#include <platform/DeviceInstanceInfoProvider.h>
+#include <string>
+
using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::AppPlatform;
diff --git a/examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp b/examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp
index 2b85aa1..f15ef7b 100644
--- a/examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp
+++ b/examples/tv-app/android/java/AppPlatformShellCommands-JNI.cpp
@@ -25,6 +25,8 @@
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>
+#include <string>
+
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
#include <app/app-platform/ContentAppPlatform.h>
#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
diff --git a/examples/tv-app/android/java/ChannelManager.cpp b/examples/tv-app/android/java/ChannelManager.cpp
index c706713..aa31043 100644
--- a/examples/tv-app/android/java/ChannelManager.cpp
+++ b/examples/tv-app/android/java/ChannelManager.cpp
@@ -27,6 +27,8 @@
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>
+#include <string>
+
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters::Channel;
diff --git a/examples/tv-app/android/java/ContentAppAttributeDelegate.cpp b/examples/tv-app/android/java/ContentAppAttributeDelegate.cpp
index 00b4ca7..651ce45 100644
--- a/examples/tv-app/android/java/ContentAppAttributeDelegate.cpp
+++ b/examples/tv-app/android/java/ContentAppAttributeDelegate.cpp
@@ -31,6 +31,8 @@
#include <platform/PlatformManager.h>
#include <zap-generated/endpoint_config.h>
+#include <string>
+
namespace chip {
namespace AppPlatform {
diff --git a/examples/tv-app/android/java/ContentAppAttributeDelegate.h b/examples/tv-app/android/java/ContentAppAttributeDelegate.h
index 25d6367..8a39b00 100644
--- a/examples/tv-app/android/java/ContentAppAttributeDelegate.h
+++ b/examples/tv-app/android/java/ContentAppAttributeDelegate.h
@@ -28,6 +28,8 @@
#include <lib/core/DataModelTypes.h>
#include <lib/support/JniReferences.h>
+#include <string>
+
namespace chip {
namespace AppPlatform {
diff --git a/examples/tv-app/android/java/ContentAppCommandDelegate.cpp b/examples/tv-app/android/java/ContentAppCommandDelegate.cpp
index 2e5dcbe..a4a8d09 100644
--- a/examples/tv-app/android/java/ContentAppCommandDelegate.cpp
+++ b/examples/tv-app/android/java/ContentAppCommandDelegate.cpp
@@ -34,6 +34,8 @@
#include <platform/PlatformManager.h>
#include <zap-generated/endpoint_config.h>
+#include <string>
+
namespace chip {
namespace AppPlatform {
diff --git a/examples/tv-app/android/java/ContentAppCommandDelegate.h b/examples/tv-app/android/java/ContentAppCommandDelegate.h
index 750aff6..f033b1a 100644
--- a/examples/tv-app/android/java/ContentAppCommandDelegate.h
+++ b/examples/tv-app/android/java/ContentAppCommandDelegate.h
@@ -30,6 +30,8 @@
#include <lib/core/DataModelTypes.h>
#include <lib/support/JniReferences.h>
+#include <string>
+
namespace chip {
namespace AppPlatform {
diff --git a/examples/tv-app/android/java/ContentLauncherManager.cpp b/examples/tv-app/android/java/ContentLauncherManager.cpp
index f68e113..449f6d1 100644
--- a/examples/tv-app/android/java/ContentLauncherManager.cpp
+++ b/examples/tv-app/android/java/ContentLauncherManager.cpp
@@ -20,12 +20,15 @@
#include "TvApp-JNI.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.h>
+#include <app/util/config.h>
#include <jni.h>
#include <lib/core/CHIPSafeCasts.h>
#include <lib/support/CHIPJNIError.h>
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>
+#include <string>
+
using namespace std;
using namespace chip;
using namespace chip::app::DataModel;
diff --git a/examples/tv-app/android/java/DeviceCallbacks.cpp b/examples/tv-app/android/java/DeviceCallbacks.cpp
index a85402a..51f57a5 100644
--- a/examples/tv-app/android/java/DeviceCallbacks.cpp
+++ b/examples/tv-app/android/java/DeviceCallbacks.cpp
@@ -26,7 +26,6 @@
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <app/util/basic-types.h>
#include <app/util/util.h>
#include <jni.h>
diff --git a/examples/tv-app/android/java/LevelManager.cpp b/examples/tv-app/android/java/LevelManager.cpp
index f9be757..4fc392d 100644
--- a/examples/tv-app/android/java/LevelManager.cpp
+++ b/examples/tv-app/android/java/LevelManager.cpp
@@ -18,7 +18,7 @@
#include "TvApp-JNI.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <jni.h>
#include <lib/support/CHIPJNIError.h>
diff --git a/examples/tv-app/android/java/MediaInputManager.cpp b/examples/tv-app/android/java/MediaInputManager.cpp
index 0f1c922..0c5565c 100644
--- a/examples/tv-app/android/java/MediaInputManager.cpp
+++ b/examples/tv-app/android/java/MediaInputManager.cpp
@@ -23,6 +23,8 @@
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>
+#include <string>
+
using namespace chip;
using namespace chip::app::Clusters::MediaInput;
diff --git a/examples/tv-app/android/java/MediaPlaybackManager.cpp b/examples/tv-app/android/java/MediaPlaybackManager.cpp
index 99afaaa..90d2c76 100644
--- a/examples/tv-app/android/java/MediaPlaybackManager.cpp
+++ b/examples/tv-app/android/java/MediaPlaybackManager.cpp
@@ -28,6 +28,8 @@
#include "MediaPlaybackManager.h"
+#include <string>
+
using namespace chip;
using namespace chip::app;
using namespace chip::app::DataModel;
diff --git a/examples/tv-app/android/java/MessagesManager.cpp b/examples/tv-app/android/java/MessagesManager.cpp
index ad214e1..0be93b8 100644
--- a/examples/tv-app/android/java/MessagesManager.cpp
+++ b/examples/tv-app/android/java/MessagesManager.cpp
@@ -27,6 +27,8 @@
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>
+#include <string>
+
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters::Messages;
diff --git a/examples/tv-app/android/java/OnOffManager.cpp b/examples/tv-app/android/java/OnOffManager.cpp
index db69474..203d08d 100644
--- a/examples/tv-app/android/java/OnOffManager.cpp
+++ b/examples/tv-app/android/java/OnOffManager.cpp
@@ -18,7 +18,7 @@
#include "TvApp-JNI.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <jni.h>
#include <lib/support/CHIPJNIError.h>
diff --git a/examples/tv-app/linux/main.cpp b/examples/tv-app/linux/main.cpp
index 859b3f4..29fdd69 100644
--- a/examples/tv-app/linux/main.cpp
+++ b/examples/tv-app/linux/main.cpp
@@ -24,7 +24,7 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/app-platform/ContentAppPlatform.h>
-#include <app/util/af.h>
+#include <app/util/endpoint-config-api.h>
#if defined(ENABLE_CHIP_SHELL)
#include "AppTvShellCommands.h"
diff --git a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp
index 0f3e5b5..9264553 100644
--- a/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp
+++ b/examples/tv-app/tv-common/clusters/account-login/AccountLoginManager.cpp
@@ -19,7 +19,7 @@
#include "AccountLoginManager.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/CommandHandler.h>
-#include <app/util/af.h>
+#include <app/util/config.h>
using namespace std;
using namespace chip::app::Clusters::AccountLogin;
diff --git a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp
index 75bb07b..23624f3 100644
--- a/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp
+++ b/examples/tv-app/tv-common/clusters/channel/ChannelManager.cpp
@@ -19,6 +19,7 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>
+#include <string>
#include <vector>
using namespace chip;
diff --git a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp
index b062c64..f051961 100644
--- a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp
+++ b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.cpp
@@ -20,6 +20,9 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>
+#include <list>
+#include <string>
+
using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters;
diff --git a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h
index 2bc9e70..eb47006 100644
--- a/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h
+++ b/examples/tv-app/tv-common/clusters/content-launcher/ContentLauncherManager.h
@@ -19,6 +19,7 @@
#pragma once
#include <app/clusters/content-launch-server/content-launch-server.h>
+#include <string>
#include <vector>
using chip::CharSpan;
diff --git a/examples/tv-app/tv-common/clusters/media-input/MediaInputManager.cpp b/examples/tv-app/tv-common/clusters/media-input/MediaInputManager.cpp
index 26ec52d..bd5582e 100644
--- a/examples/tv-app/tv-common/clusters/media-input/MediaInputManager.cpp
+++ b/examples/tv-app/tv-common/clusters/media-input/MediaInputManager.cpp
@@ -17,6 +17,8 @@
#include "MediaInputManager.h"
+#include <string>
+
using namespace std;
using namespace chip;
using namespace chip::app::Clusters::MediaInput;
diff --git a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp
index 456aba8..0e79c6b 100644
--- a/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp
+++ b/examples/tv-app/tv-common/clusters/media-playback/MediaPlaybackManager.cpp
@@ -19,6 +19,8 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>
+#include <string>
+
using namespace std;
using namespace chip::app::DataModel;
using namespace chip::app::Clusters::MediaPlayback;
diff --git a/examples/tv-app/tv-common/clusters/messages/MessagesManager.cpp b/examples/tv-app/tv-common/clusters/messages/MessagesManager.cpp
index 461e355..681cd56 100644
--- a/examples/tv-app/tv-common/clusters/messages/MessagesManager.cpp
+++ b/examples/tv-app/tv-common/clusters/messages/MessagesManager.cpp
@@ -18,6 +18,7 @@
#include "MessagesManager.h"
#include <app-common/zap-generated/attributes/Accessors.h>
+#include <string>
#include <vector>
using namespace std;
diff --git a/examples/tv-app/tv-common/clusters/messages/MessagesManager.h b/examples/tv-app/tv-common/clusters/messages/MessagesManager.h
index 777f202..1662731 100644
--- a/examples/tv-app/tv-common/clusters/messages/MessagesManager.h
+++ b/examples/tv-app/tv-common/clusters/messages/MessagesManager.h
@@ -21,6 +21,7 @@
#include <iostream>
#include <list>
+#include <string>
#include <vector>
struct CachedMessageOption
diff --git a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp
index 9b90733..dced037 100644
--- a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp
+++ b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.cpp
@@ -17,6 +17,9 @@
#include "TargetNavigatorManager.h"
#include <app-common/zap-generated/attributes/Accessors.h>
+#include <app/util/config.h>
+
+#include <string>
using namespace std;
using namespace chip::app;
diff --git a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.h b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.h
index d600f04..5194302 100644
--- a/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.h
+++ b/examples/tv-app/tv-common/clusters/target-navigator/TargetNavigatorManager.h
@@ -19,6 +19,9 @@
#include <app/clusters/target-navigator-server/target-navigator-server.h>
+#include <list>
+#include <string>
+
using chip::CharSpan;
using chip::app::AttributeValueEncoder;
using chip::app::CommandResponseHelper;
diff --git a/examples/tv-app/tv-common/shell/AppTvShellCommands.cpp b/examples/tv-app/tv-common/shell/AppTvShellCommands.cpp
index 6b94676..ee85cf0 100644
--- a/examples/tv-app/tv-common/shell/AppTvShellCommands.cpp
+++ b/examples/tv-app/tv-common/shell/AppTvShellCommands.cpp
@@ -33,6 +33,8 @@
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>
+#include <string>
+
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
#include <app/app-platform/ContentAppPlatform.h>
using namespace chip::AppPlatform;
diff --git a/examples/tv-app/tv-common/src/AppTv.cpp b/examples/tv-app/tv-common/src/AppTv.cpp
index ef2d521..2bed28e 100644
--- a/examples/tv-app/tv-common/src/AppTv.cpp
+++ b/examples/tv-app/tv-common/src/AppTv.cpp
@@ -30,7 +30,6 @@
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <controller/CHIPCluster.h>
#include <lib/core/CHIPCore.h>
#include <lib/core/DataModelTypes.h>
@@ -41,6 +40,8 @@
#include <platform/CHIPDeviceLayer.h>
#include <platform/DeviceInstanceInfoProvider.h>
+#include <string>
+
#if CHIP_DEVICE_CONFIG_ENABLE_BOTH_COMMISSIONER_AND_COMMISSIONEE
#include <controller/CHIPDeviceController.h>
#include <controller/CommissionerDiscoveryController.h>
diff --git a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp
index f39dc4b..ca62ba5 100644
--- a/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp
+++ b/examples/tv-casting-app/android/App/app/src/main/jni/cpp/MatterCallbackHandler-JNI.cpp
@@ -18,6 +18,8 @@
#include "MatterCallbackHandler-JNI.h"
+#include <string>
+
using namespace chip;
CHIP_ERROR CallbackBaseJNI::SetUp(JNIEnv * env, jobject inHandler)
diff --git a/examples/tv-casting-app/tv-casting-common/commands/common/CHIPCommand.cpp b/examples/tv-casting-app/tv-casting-common/commands/common/CHIPCommand.cpp
index e86942e..878ed25 100644
--- a/examples/tv-casting-app/tv-casting-common/commands/common/CHIPCommand.cpp
+++ b/examples/tv-casting-app/tv-casting-common/commands/common/CHIPCommand.cpp
@@ -24,6 +24,8 @@
#include <lib/support/ScopedBuffer.h>
#include <lib/support/TestGroupData.h>
+#include <string>
+
#if CHIP_CONFIG_TRANSPORT_TRACE_ENABLED
#include "TraceHandlers.h"
#endif // CHIP_CONFIG_TRANSPORT_TRACE_ENABLED
diff --git a/examples/virtual-device-app/android/java/ColorControlManager.cpp b/examples/virtual-device-app/android/java/ColorControlManager.cpp
index 1a4dfbe..ed9ba07 100644
--- a/examples/virtual-device-app/android/java/ColorControlManager.cpp
+++ b/examples/virtual-device-app/android/java/ColorControlManager.cpp
@@ -18,7 +18,8 @@
#include "DeviceApp-JNI.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
+#include <app/util/config.h>
#include <jni.h>
#include <lib/support/CHIPJNIError.h>
#include <lib/support/JniReferences.h>
diff --git a/examples/virtual-device-app/android/java/DoorLockManager.cpp b/examples/virtual-device-app/android/java/DoorLockManager.cpp
index b3e245e..712156c 100644
--- a/examples/virtual-device-app/android/java/DoorLockManager.cpp
+++ b/examples/virtual-device-app/android/java/DoorLockManager.cpp
@@ -21,7 +21,7 @@
#include <app/ConcreteAttributePath.h>
#include <app/clusters/door-lock-server/door-lock-server.h>
#include <app/reporting/reporting.h>
-#include <app/util/af.h>
+#include <app/util/config.h>
#include <jni.h>
#include <lib/support/CHIPJNIError.h>
#include <lib/support/JniReferences.h>
diff --git a/examples/virtual-device-app/android/java/OnOffManager.cpp b/examples/virtual-device-app/android/java/OnOffManager.cpp
index c058e99..65b3d6f 100644
--- a/examples/virtual-device-app/android/java/OnOffManager.cpp
+++ b/examples/virtual-device-app/android/java/OnOffManager.cpp
@@ -18,7 +18,7 @@
#include "DeviceApp-JNI.h"
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <jni.h>
#include <lib/support/CHIPJNIError.h>
diff --git a/examples/virtual-device-app/android/java/PowerSourceManager.cpp b/examples/virtual-device-app/android/java/PowerSourceManager.cpp
index e71a5bb..3a8d78e 100644
--- a/examples/virtual-device-app/android/java/PowerSourceManager.cpp
+++ b/examples/virtual-device-app/android/java/PowerSourceManager.cpp
@@ -22,7 +22,7 @@
#include <app/ConcreteAttributePath.h>
#include <app/clusters/door-lock-server/door-lock-server.h>
#include <app/reporting/reporting.h>
-#include <app/util/af.h>
+#include <app/util/config.h>
#include <jni.h>
#include <lib/support/CHIPJNIError.h>
#include <lib/support/JniReferences.h>
diff --git a/examples/window-app/common/src/WindowApp.cpp b/examples/window-app/common/src/WindowApp.cpp
index aa0e265..fffa684 100644
--- a/examples/window-app/common/src/WindowApp.cpp
+++ b/examples/window-app/common/src/WindowApp.cpp
@@ -20,7 +20,6 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>
diff --git a/examples/window-app/common/src/ZclCallbacks.cpp b/examples/window-app/common/src/ZclCallbacks.cpp
index ae24165..e028691 100644
--- a/examples/window-app/common/src/ZclCallbacks.cpp
+++ b/examples/window-app/common/src/ZclCallbacks.cpp
@@ -32,7 +32,6 @@
#include <app/ConcreteAttributePath.h>
#include <app/ConcreteCommandPath.h>
#include <app/clusters/window-covering-server/window-covering-server.h>
-#include <app/util/af.h>
using namespace ::chip;
using namespace ::chip::app::Clusters::WindowCovering;
diff --git a/examples/window-app/nrfconnect/main/WindowCovering.cpp b/examples/window-app/nrfconnect/main/WindowCovering.cpp
index 4d200ff..f0cf55b 100644
--- a/examples/window-app/nrfconnect/main/WindowCovering.cpp
+++ b/examples/window-app/nrfconnect/main/WindowCovering.cpp
@@ -22,7 +22,6 @@
#include <dk_buttons_and_leds.h>
#include <app-common/zap-generated/attributes/Accessors.h>
-#include <app/util/af.h>
#include <platform/CHIPDeviceLayer.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
diff --git a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp
index 12e95a7..9262518 100644
--- a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp
+++ b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp
@@ -31,7 +31,6 @@
#include <app/ConcreteAttributePath.h>
#include <app/ConcreteCommandPath.h>
#include <app/clusters/window-covering-server/window-covering-server.h>
-#include <app/util/af.h>
using namespace ::chip;
using namespace ::chip::app::Clusters::WindowCovering;
diff --git a/examples/window-app/silabs/src/WindowManager.cpp b/examples/window-app/silabs/src/WindowManager.cpp
index 197836f..af607fd 100644
--- a/examples/window-app/silabs/src/WindowManager.cpp
+++ b/examples/window-app/silabs/src/WindowManager.cpp
@@ -20,7 +20,6 @@
#include <AppConfig.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>
diff --git a/examples/window-app/silabs/src/ZclCallbacks.cpp b/examples/window-app/silabs/src/ZclCallbacks.cpp
index 4e2a688..f658a45 100644
--- a/examples/window-app/silabs/src/ZclCallbacks.cpp
+++ b/examples/window-app/silabs/src/ZclCallbacks.cpp
@@ -32,7 +32,6 @@
#include <app/ConcreteAttributePath.h>
#include <app/ConcreteCommandPath.h>
#include <app/clusters/window-covering-server/window-covering-server.h>
-#include <app/util/af.h>
using namespace ::chip;
using namespace ::chip::app::Clusters::WindowCovering;
diff --git a/examples/window-app/telink/src/WindowCovering.cpp b/examples/window-app/telink/src/WindowCovering.cpp
index 5c1b8d1..1ed5bdb 100644
--- a/examples/window-app/telink/src/WindowCovering.cpp
+++ b/examples/window-app/telink/src/WindowCovering.cpp
@@ -20,7 +20,6 @@
#include "PWMDevice.h"
#include <app-common/zap-generated/attributes/Accessors.h>
-#include <app/util/af.h>
#include <platform/CHIPDeviceLayer.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
diff --git a/scripts/tools/check_includes_config.py b/scripts/tools/check_includes_config.py
index 0d9a7df..227d65a 100644
--- a/scripts/tools/check_includes_config.py
+++ b/scripts/tools/check_includes_config.py
@@ -121,8 +121,10 @@
'src/platform/mbed/MbedEventTimeout.h': {'chrono'},
'src/app/app-platform/ContentApp.h': {'list', 'string'},
- 'src/app/clusters/application-basic-server/application-basic-delegate.h': {'list'},
- 'src/app/clusters/application-basic-server/application-basic-server.cpp': {'list'},
+ 'src/app/app-platform/ContentAppPlatform.cpp': {'string'},
+ 'src/app/clusters/application-basic-server/application-basic-delegate.h': {'list', 'string'},
+ 'src/app/clusters/application-basic-server/application-basic-server.cpp': {'list', 'string'},
+ 'src/app/clusters/application-launcher-server/application-launcher-server.cpp': {'string'},
'src/app/clusters/application-launcher-server/application-launcher-delegate.h': {'list'},
'src/app/clusters/audio-output-server/audio-output-delegate.h': {'list'},
'src/app/clusters/channel-server/channel-delegate.h': {'list'},
@@ -136,13 +138,15 @@
'src/credentials/attestation_verifier/FileAttestationTrustStore.cpp': {'string'},
'src/setup_payload/AdditionalDataPayload.h': {'string'},
- 'src/setup_payload/AdditionalDataPayloadParser.cpp': {'vector'},
+ 'src/setup_payload/AdditionalDataPayloadParser.cpp': {'vector', 'string'},
'src/setup_payload/Base38Decode.h': {'string', 'vector'},
'src/setup_payload/ManualSetupPayloadGenerator.h': {'string'},
'src/setup_payload/ManualSetupPayloadParser.cpp': {'string', 'vector'},
'src/setup_payload/ManualSetupPayloadParser.h': {'string'},
'src/setup_payload/QRCodeSetupPayloadParser.cpp': {'vector'},
'src/setup_payload/QRCodeSetupPayloadParser.h': {'string'},
+ 'src/setup_payload/QRCodeSetupPayloadGenerator.cpp': {'string'},
+ 'src/setup_payload/QRCodeSetupPayloadGenerator.h': {'string'},
'src/setup_payload/SetupPayloadHelper.cpp': {'fstream'},
'src/setup_payload/SetupPayloadHelper.h': {'string'},
'src/setup_payload/SetupPayload.h': {'map', 'string', 'vector'},
@@ -154,11 +158,11 @@
# of a list of discovered things.
'src/controller/SetUpCodePairer.h': {'deque'},
- 'src/controller/ExamplePersistentStorage.cpp': {'fstream'},
+ 'src/controller/ExamplePersistentStorage.cpp': {'fstream', 'string', 'map'},
# Library meant for non-embedded
'src/tracing/json/json_tracing.cpp': {'string', 'sstream'},
- 'src/tracing/json/json_tracing.h': {'fstream', 'unordered_map'},
+ 'src/tracing/json/json_tracing.h': {'fstream', 'unordered_map', 'string'},
# esp32 tracing
'src/tracing/esp32_trace/esp32_tracing.h': {'unordered_map'},
@@ -175,5 +179,7 @@
'src/lib/support/jsontlv/TextFormat.h': {'string'},
'src/app/icd/client/DefaultICDClientStorage.cpp': {'vector'},
'src/app/icd/client/DefaultICDClientStorage.h': {'vector'},
- 'src/app/icd/client/DefaultICDStorageKey.h': {'vector'}
+ 'src/app/icd/client/DefaultICDStorageKey.h': {'vector'},
+ 'src/controller/CHIPDeviceController.cpp': {'string'},
+ 'src/qrcodetool/setup_payload_commands.cpp': {'string'},
}
diff --git a/src/app/AttributePathExpandIterator.cpp b/src/app/AttributePathExpandIterator.cpp
index 00a6955..9be7ab4 100644
--- a/src/app/AttributePathExpandIterator.cpp
+++ b/src/app/AttributePathExpandIterator.cpp
@@ -23,6 +23,7 @@
#include <app/EventManagement.h>
#include <app/GlobalAttributes.h>
#include <app/util/att-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <lib/core/CHIPCore.h>
#include <lib/core/TLVDebug.h>
#include <lib/support/CodeUtils.h>
diff --git a/src/app/BUILD.gn b/src/app/BUILD.gn
index 8750838..0f982e2 100644
--- a/src/app/BUILD.gn
+++ b/src/app/BUILD.gn
@@ -250,6 +250,7 @@
public_deps += [
":global-attributes",
"${chip_root}/src/access",
+ "${chip_root}/src/app/dynamic_server:mock-codegen-includes",
]
public_configs += [ ":config-controller-dynamic-server" ]
diff --git a/src/app/CommandResponseHelper.h b/src/app/CommandResponseHelper.h
index 48d36d1..a0209ac 100644
--- a/src/app/CommandResponseHelper.h
+++ b/src/app/CommandResponseHelper.h
@@ -20,7 +20,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
-#include <app/util/af.h>
#include <protocols/interaction_model/Constants.h>
namespace chip {
diff --git a/src/app/app-platform/ContentApp.h b/src/app/app-platform/ContentApp.h
index 34b1dd5..4260263 100644
--- a/src/app/app-platform/ContentApp.h
+++ b/src/app/app-platform/ContentApp.h
@@ -36,6 +36,8 @@
#include <controller/CHIPDeviceController.h>
#include <protocols/interaction_model/StatusCode.h>
+#include <string>
+
namespace chip {
namespace AppPlatform {
diff --git a/src/app/app-platform/ContentAppPlatform.cpp b/src/app/app-platform/ContentAppPlatform.cpp
index 3d17a52..5365cf1 100644
--- a/src/app/app-platform/ContentAppPlatform.cpp
+++ b/src/app/app-platform/ContentAppPlatform.cpp
@@ -23,7 +23,9 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/app-platform/ContentAppPlatform.h>
#include <app/server/Server.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
+#include <app/util/endpoint-config-api.h>
#include <controller/CHIPCluster.h>
#include <lib/core/CHIPCore.h>
#include <lib/core/DataModelTypes.h>
@@ -34,6 +36,8 @@
#include <platform/CHIPDeviceLayer.h>
#include <protocols/interaction_model/StatusCode.h>
+#include <string>
+
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
using namespace chip;
diff --git a/src/app/clusters/access-control-server/access-control-server.cpp b/src/app/clusters/access-control-server/access-control-server.cpp
index a5f49cb..20fb879 100644
--- a/src/app/clusters/access-control-server/access-control-server.cpp
+++ b/src/app/clusters/access-control-server/access-control-server.cpp
@@ -26,7 +26,6 @@
#include <app/data-model/Encode.h>
#include <app/server/AclStorage.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
using namespace chip;
diff --git a/src/app/clusters/account-login-server/account-login-delegate.h b/src/app/clusters/account-login-server/account-login-delegate.h
index 8b8a1c4..36458db 100644
--- a/src/app/clusters/account-login-server/account-login-delegate.h
+++ b/src/app/clusters/account-login-server/account-login-delegate.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/src/app/clusters/account-login-server/account-login-server.cpp b/src/app/clusters/account-login-server/account-login-server.cpp
index 684558e..a41f889 100644
--- a/src/app/clusters/account-login-server/account-login-server.cpp
+++ b/src/app/clusters/account-login-server/account-login-server.cpp
@@ -30,7 +30,6 @@
#include <app/ConcreteCommandPath.h>
#include <app/EventLogging.h>
#include <app/data-model/Encode.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
diff --git a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp
index 739b9ae..1bfa13b 100644
--- a/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp
+++ b/src/app/clusters/administrator-commissioning-server/administrator-commissioning-server.cpp
@@ -26,7 +26,6 @@
#include <app/ConcreteCommandPath.h>
#include <app/server/CommissioningWindowManager.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>
diff --git a/src/app/clusters/application-basic-server/application-basic-delegate.h b/src/app/clusters/application-basic-server/application-basic-delegate.h
index 82696b5..e128963 100644
--- a/src/app/clusters/application-basic-server/application-basic-delegate.h
+++ b/src/app/clusters/application-basic-server/application-basic-delegate.h
@@ -21,8 +21,10 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
-#include <app/util/af.h>
+#include <lib/support/CHIPMemString.h>
+
#include <list>
+#include <string>
namespace chip {
namespace app {
diff --git a/src/app/clusters/application-basic-server/application-basic-server.cpp b/src/app/clusters/application-basic-server/application-basic-server.cpp
index d0c63b3..20daa3a 100644
--- a/src/app/clusters/application-basic-server/application-basic-server.cpp
+++ b/src/app/clusters/application-basic-server/application-basic-server.cpp
@@ -36,6 +36,7 @@
#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
#include <list>
+#include <string>
using namespace chip;
using namespace chip::app::Clusters;
diff --git a/src/app/clusters/application-launcher-server/application-launcher-delegate.h b/src/app/clusters/application-launcher-server/application-launcher-delegate.h
index 1a945e8..0d4276d 100644
--- a/src/app/clusters/application-launcher-server/application-launcher-delegate.h
+++ b/src/app/clusters/application-launcher-server/application-launcher-delegate.h
@@ -22,7 +22,6 @@
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
#include <list>
namespace chip {
diff --git a/src/app/clusters/application-launcher-server/application-launcher-server.cpp b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
index 18a30bb..2cc461a 100644
--- a/src/app/clusters/application-launcher-server/application-launcher-server.cpp
+++ b/src/app/clusters/application-launcher-server/application-launcher-server.cpp
@@ -36,6 +36,8 @@
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
+#include <string>
+
#if CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
#include <app/app-platform/ContentAppPlatform.h>
#endif // CHIP_DEVICE_CONFIG_APP_PLATFORM_ENABLED
diff --git a/src/app/clusters/audio-output-server/audio-output-delegate.h b/src/app/clusters/audio-output-server/audio-output-delegate.h
index 9d4f5fa..1477121 100644
--- a/src/app/clusters/audio-output-server/audio-output-delegate.h
+++ b/src/app/clusters/audio-output-server/audio-output-delegate.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
-#include <app/util/af.h>
#include <list>
namespace chip {
diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp
index 99bd062..da7d23e 100644
--- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp
+++ b/src/app/clusters/barrier-control-server/barrier-control-server.cpp
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <lib/support/TypeTraits.h>
diff --git a/src/app/clusters/bindings/bindings.cpp b/src/app/clusters/bindings/bindings.cpp
index 7e0f3ce..f11ce51 100644
--- a/src/app/clusters/bindings/bindings.cpp
+++ b/src/app/clusters/bindings/bindings.cpp
@@ -26,7 +26,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteAttributePath.h>
#include <app/clusters/bindings/bindings.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <lib/support/logging/CHIPLogging.h>
diff --git a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp
index b302f46..bd9a255 100644
--- a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp
+++ b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp
@@ -29,6 +29,7 @@
#include <app/SafeAttributePersistenceProvider.h>
#include <app/data-model/Encode.h>
#include <app/util/attribute-storage.h>
+#include <app/util/config.h>
#include <lib/core/CHIPError.h>
#include <lib/support/logging/CHIPLogging.h>
#include <platform/CHIPDeviceConfig.h>
diff --git a/src/app/clusters/channel-server/channel-delegate.h b/src/app/clusters/channel-server/channel-delegate.h
index c92ada4..24c42eb 100644
--- a/src/app/clusters/channel-server/channel-delegate.h
+++ b/src/app/clusters/channel-server/channel-delegate.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
#include <list>
namespace chip {
diff --git a/src/app/clusters/color-control-server/color-control-server.cpp b/src/app/clusters/color-control-server/color-control-server.cpp
index 3e883cf..508f4b6 100644
--- a/src/app/clusters/color-control-server/color-control-server.cpp
+++ b/src/app/clusters/color-control-server/color-control-server.cpp
@@ -19,7 +19,6 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceLayer.h>
diff --git a/src/app/clusters/color-control-server/color-control-server.h b/src/app/clusters/color-control-server/color-control-server.h
index 5c13c56..72dabb5 100644
--- a/src/app/clusters/color-control-server/color-control-server.h
+++ b/src/app/clusters/color-control-server/color-control-server.h
@@ -22,7 +22,7 @@
#include <app/ConcreteCommandPath.h>
#include <app/clusters/scenes-server/SceneTable.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/basic-types.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
diff --git a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h
index c2799fd..984eefe 100644
--- a/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h
+++ b/src/app/clusters/concentration-measurement-server/concentration-measurement-server.h
@@ -22,7 +22,6 @@
#include <app/AttributeAccessInterface.h>
#include <app/data-model/Nullable.h>
#include <app/reporting/reporting.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <lib/support/IntrusiveList.h>
#include <type_traits>
diff --git a/src/app/clusters/content-app-observer/content-app-observer-delegate.h b/src/app/clusters/content-app-observer/content-app-observer-delegate.h
index d206f19..13b6dd5 100644
--- a/src/app/clusters/content-app-observer/content-app-observer-delegate.h
+++ b/src/app/clusters/content-app-observer/content-app-observer-delegate.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/src/app/clusters/content-app-observer/content-app-observer.cpp b/src/app/clusters/content-app-observer/content-app-observer.cpp
index 08ed95c..d595b05 100644
--- a/src/app/clusters/content-app-observer/content-app-observer.cpp
+++ b/src/app/clusters/content-app-observer/content-app-observer.cpp
@@ -28,7 +28,7 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/EventLogging.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
diff --git a/src/app/clusters/content-control-server/content-control-delegate.h b/src/app/clusters/content-control-server/content-control-delegate.h
index b587c3a..e03f39f 100644
--- a/src/app/clusters/content-control-server/content-control-delegate.h
+++ b/src/app/clusters/content-control-server/content-control-delegate.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/src/app/clusters/content-control-server/content-control-server.cpp b/src/app/clusters/content-control-server/content-control-server.cpp
index 60c30f4..8c9d076 100644
--- a/src/app/clusters/content-control-server/content-control-server.cpp
+++ b/src/app/clusters/content-control-server/content-control-server.cpp
@@ -28,7 +28,7 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/EventLogging.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
diff --git a/src/app/clusters/content-launch-server/content-launch-delegate.h b/src/app/clusters/content-launch-server/content-launch-delegate.h
index 8fcf705..e2a66dd 100644
--- a/src/app/clusters/content-launch-server/content-launch-delegate.h
+++ b/src/app/clusters/content-launch-server/content-launch-delegate.h
@@ -22,7 +22,6 @@
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
#include <list>
namespace chip {
diff --git a/src/app/clusters/content-launch-server/content-launch-server.cpp b/src/app/clusters/content-launch-server/content-launch-server.cpp
index 3b0a5d7..ed2f5fa 100644
--- a/src/app/clusters/content-launch-server/content-launch-server.cpp
+++ b/src/app/clusters/content-launch-server/content-launch-server.cpp
@@ -23,7 +23,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/data-model/Encode.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
diff --git a/src/app/clusters/descriptor/descriptor.cpp b/src/app/clusters/descriptor/descriptor.cpp
index 2336d7c..d3badfb 100644
--- a/src/app/clusters/descriptor/descriptor.cpp
+++ b/src/app/clusters/descriptor/descriptor.cpp
@@ -25,6 +25,7 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/AttributeAccessInterface.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>
diff --git a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp
index 83beb46..8744582 100644
--- a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp
+++ b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp
@@ -17,7 +17,7 @@
#include <app/clusters/diagnostic-logs-server/diagnostic-logs-server.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <lib/support/ScopedBuffer.h>
#include <protocols/bdx/DiagnosticLogs.h>
diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-delegate.h b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-delegate.h
index 5f4e772..0de17f6 100644
--- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-delegate.h
+++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-delegate.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
index 40321f8..ca0fc23 100644
--- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
+++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
@@ -23,6 +23,7 @@
#include <app/EventLogging.h>
#include <app/InteractionModelEngine.h>
#include <app/util/attribute-storage.h>
+#include <app/util/config.h>
#include <lib/support/BitFlags.h>
using namespace chip;
diff --git a/src/app/clusters/door-lock-server/door-lock-server-callback.cpp b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp
index 64ab482..cedaf4f 100644
--- a/src/app/clusters/door-lock-server/door-lock-server-callback.cpp
+++ b/src/app/clusters/door-lock-server/door-lock-server-callback.cpp
@@ -26,7 +26,6 @@
#include <app-common/zap-generated/callback.h>
#include <app/EventLogging.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <cinttypes>
#include <app/CommandHandler.h>
diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp
index 0e65644..66676a2 100644
--- a/src/app/clusters/door-lock-server/door-lock-server.cpp
+++ b/src/app/clusters/door-lock-server/door-lock-server.cpp
@@ -27,8 +27,8 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/EventLogging.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
+#include <app/util/config.h>
#include <cinttypes>
#include <app/CommandHandler.h>
diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h
index f50a666..fa7f418 100644
--- a/src/app/clusters/door-lock-server/door-lock-server.h
+++ b/src/app/clusters/door-lock-server/door-lock-server.h
@@ -29,7 +29,7 @@
#include <app/AttributeAccessInterface.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
#include <protocols/interaction_model/StatusCode.h>
diff --git a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp
index 7e9bc3d..e8ee238 100644
--- a/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp
+++ b/src/app/clusters/electrical-energy-measurement-server/electrical-energy-measurement-server.cpp
@@ -23,6 +23,7 @@
#include <app/EventLogging.h>
#include <app/reporting/reporting.h>
#include <app/util/attribute-storage.h>
+#include <app/util/config.h>
using chip::Protocols::InteractionModel::Status;
diff --git a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
index 5d73f36..8db3317 100644
--- a/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
+++ b/src/app/clusters/ethernet-network-diagnostics-server/ethernet-network-diagnostics-server.cpp
@@ -22,7 +22,6 @@
#include <app/AttributeAccessInterface.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <lib/core/Optional.h>
#include <platform/DiagnosticDataProvider.h>
diff --git a/src/app/clusters/fan-control-server/fan-control-delegate.h b/src/app/clusters/fan-control-server/fan-control-delegate.h
index 8b70a04..4879a98 100644
--- a/src/app/clusters/fan-control-server/fan-control-delegate.h
+++ b/src/app/clusters/fan-control-server/fan-control-delegate.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
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 b297acd..d8e80b8 100644
--- a/src/app/clusters/fan-control-server/fan-control-server.cpp
+++ b/src/app/clusters/fan-control-server/fan-control-server.cpp
@@ -32,6 +32,7 @@
#include <app/ConcreteCommandPath.h>
#include <app/clusters/fan-control-server/fan-control-server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/config.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>
#include <protocols/interaction_model/StatusCode.h>
diff --git a/src/app/clusters/fault-injection-server/fault-injection-server.cpp b/src/app/clusters/fault-injection-server/fault-injection-server.cpp
index 0b7385e..ed4382b 100644
--- a/src/app/clusters/fault-injection-server/fault-injection-server.cpp
+++ b/src/app/clusters/fault-injection-server/fault-injection-server.cpp
@@ -20,7 +20,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>
diff --git a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp
index 536ac20..d32ddc0 100644
--- a/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp
+++ b/src/app/clusters/general-commissioning-server/general-commissioning-server.cpp
@@ -27,7 +27,6 @@
#include <app/ConcreteCommandPath.h>
#include <app/server/CommissioningWindowManager.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <lib/support/Span.h>
#include <lib/support/logging/CHIPLogging.h>
diff --git a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.h b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.h
index 144bae3..dfb5993 100644
--- a/src/app/clusters/general-diagnostics-server/general-diagnostics-server.h
+++ b/src/app/clusters/general-diagnostics-server/general-diagnostics-server.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
#include <platform/GeneralFaults.h>
namespace chip {
diff --git a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp
index cba03ef..5efc037 100644
--- a/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp
+++ b/src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp
@@ -21,7 +21,6 @@
#include <app/CommandHandler.h>
#include <app/MessageDef/StatusIB.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
#include <app/util/attribute-storage.h>
#include <credentials/GroupDataProvider.h>
diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp
index 6434edf..add0261 100644
--- a/src/app/clusters/groups-server/groups-server.cpp
+++ b/src/app/clusters/groups-server/groups-server.cpp
@@ -22,7 +22,6 @@
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/reporting/reporting.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
#include <app/util/config.h>
#include <credentials/GroupDataProvider.h>
diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp
index 0f71345..51ec9b9 100644
--- a/src/app/clusters/icd-management-server/icd-management-server.cpp
+++ b/src/app/clusters/icd-management-server/icd-management-server.cpp
@@ -25,7 +25,6 @@
#include <app/AttributeAccessInterface.h>
#include <app/icd/server/ICDNotifier.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
using namespace chip;
diff --git a/src/app/clusters/identify-server/identify-server.cpp b/src/app/clusters/identify-server/identify-server.cpp
index 6ea8a34..4be1133 100644
--- a/src/app/clusters/identify-server/identify-server.cpp
+++ b/src/app/clusters/identify-server/identify-server.cpp
@@ -24,7 +24,6 @@
#include <app-common/zap-generated/ids/Commands.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
-#include <app/util/af.h>
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>
#include <tracing/macros.h>
diff --git a/src/app/clusters/keypad-input-server/keypad-input-delegate.h b/src/app/clusters/keypad-input-server/keypad-input-delegate.h
index 24c0a3f..bc94ad9 100644
--- a/src/app/clusters/keypad-input-server/keypad-input-delegate.h
+++ b/src/app/clusters/keypad-input-server/keypad-input-delegate.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/src/app/clusters/keypad-input-server/keypad-input-server.cpp b/src/app/clusters/keypad-input-server/keypad-input-server.cpp
index e298a2c..b07c1fa 100644
--- a/src/app/clusters/keypad-input-server/keypad-input-server.cpp
+++ b/src/app/clusters/keypad-input-server/keypad-input-server.cpp
@@ -29,7 +29,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/data-model/Encode.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
index 7a3d47f..c29f61b 100644
--- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
+++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
diff --git a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
index 5a7123c..933e3cd 100644
--- a/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
+++ b/src/app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h
@@ -20,7 +20,6 @@
#include "laundry-dryer-controls-delegate.h"
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
-#include <app/util/af.h>
#include <protocols/interaction_model/StatusCode.h>
namespace chip {
diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp
index 4e58236..d648216 100644
--- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp
+++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
diff --git a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h
index c19b6f8..cbf5f14 100644
--- a/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h
+++ b/src/app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h
@@ -20,7 +20,6 @@
#include "laundry-washer-controls-delegate.h"
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
-#include <app/util/af.h>
#include <protocols/interaction_model/StatusCode.h>
diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp
index 0077c59..b93bf50 100644
--- a/src/app/clusters/level-control/level-control.cpp
+++ b/src/app/clusters/level-control/level-control.cpp
@@ -25,7 +25,7 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <app/util/util.h>
diff --git a/src/app/clusters/low-power-server/low-power-server.cpp b/src/app/clusters/low-power-server/low-power-server.cpp
index fab5217..76f7e6d 100644
--- a/src/app/clusters/low-power-server/low-power-server.cpp
+++ b/src/app/clusters/low-power-server/low-power-server.cpp
@@ -27,7 +27,7 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
#include <protocols/interaction_model/StatusCode.h>
diff --git a/src/app/clusters/media-input-server/media-input-delegate.h b/src/app/clusters/media-input-server/media-input-delegate.h
index 609c66b..f010b5a 100644
--- a/src/app/clusters/media-input-server/media-input-delegate.h
+++ b/src/app/clusters/media-input-server/media-input-delegate.h
@@ -20,7 +20,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
-#include <app/util/af.h>
#include <list>
namespace chip {
diff --git a/src/app/clusters/media-playback-server/media-playback-delegate.h b/src/app/clusters/media-playback-server/media-playback-delegate.h
index 12e89b2..b549489 100644
--- a/src/app/clusters/media-playback-server/media-playback-delegate.h
+++ b/src/app/clusters/media-playback-server/media-playback-delegate.h
@@ -22,7 +22,6 @@
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
#include <list>
namespace chip {
diff --git a/src/app/clusters/messages-server/messages-delegate.h b/src/app/clusters/messages-server/messages-delegate.h
index 6be09de..7d33627 100644
--- a/src/app/clusters/messages-server/messages-delegate.h
+++ b/src/app/clusters/messages-server/messages-delegate.h
@@ -22,7 +22,6 @@
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/src/app/clusters/mode-base-server/mode-base-server.h b/src/app/clusters/mode-base-server/mode-base-server.h
index bf7b82a..f787e9f 100644
--- a/src/app/clusters/mode-base-server/mode-base-server.h
+++ b/src/app/clusters/mode-base-server/mode-base-server.h
@@ -22,7 +22,6 @@
#include <app/AttributeAccessInterface.h>
#include <app/AttributePersistenceProvider.h>
#include <app/CommandHandlerInterface.h>
-#include <app/util/af.h>
#include <lib/support/IntrusiveList.h>
namespace chip {
diff --git a/src/app/clusters/mode-select-server/mode-select-server.cpp b/src/app/clusters/mode-select-server/mode-select-server.cpp
index 105d198..f162a26 100644
--- a/src/app/clusters/mode-select-server/mode-select-server.cpp
+++ b/src/app/clusters/mode-select-server/mode-select-server.cpp
@@ -23,7 +23,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/clusters/mode-select-server/supported-modes-manager.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
diff --git a/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp b/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp
index 51cc04b..5005638 100644
--- a/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp
+++ b/src/app/clusters/occupancy-sensor-server/occupancy-sensor-server.cpp
@@ -17,8 +17,6 @@
#include "occupancy-sensor-server.h"
-#include <app/util/af.h>
-
#include <app-common/zap-generated/attributes/Accessors.h>
#include "occupancy-hal.h"
diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp
index e4ba82b..bc71044 100644
--- a/src/app/clusters/on-off-server/on-off-server.cpp
+++ b/src/app/clusters/on-off-server/on-off-server.cpp
@@ -20,7 +20,7 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/data-model/Nullable.h>
#include <app/reporting/reporting.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <app/util/util.h>
#include <protocols/interaction_model/StatusCode.h>
diff --git a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
index 452e6d4..d05f099 100644
--- a/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
+++ b/src/app/clusters/operational-credentials-server/operational-credentials-server.cpp
@@ -32,7 +32,6 @@
#include <app/reporting/reporting.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <credentials/CHIPCert.h>
#include <credentials/CertificationDeclaration.h>
diff --git a/src/app/clusters/operational-state-server/operational-state-server.h b/src/app/clusters/operational-state-server/operational-state-server.h
index 5a461c2..c1640cb 100644
--- a/src/app/clusters/operational-state-server/operational-state-server.h
+++ b/src/app/clusters/operational-state-server/operational-state-server.h
@@ -22,7 +22,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandHandlerInterface.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/src/app/clusters/ota-provider/ota-provider-delegate.h b/src/app/clusters/ota-provider/ota-provider-delegate.h
index 3da8668..2990977 100644
--- a/src/app/clusters/ota-provider/ota-provider-delegate.h
+++ b/src/app/clusters/ota-provider/ota-provider-delegate.h
@@ -22,7 +22,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/data-model/DecodableList.h>
-#include <app/util/af.h>
#include <lib/core/Optional.h>
namespace chip {
diff --git a/src/app/clusters/ota-provider/ota-provider.cpp b/src/app/clusters/ota-provider/ota-provider.cpp
index 3da02b6..80144b6 100644
--- a/src/app/clusters/ota-provider/ota-provider.cpp
+++ b/src/app/clusters/ota-provider/ota-provider.cpp
@@ -20,7 +20,7 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <platform/CHIPDeviceConfig.h>
#include <protocols/interaction_model/Constants.h>
diff --git a/src/app/clusters/power-source-server/power-source-server.cpp b/src/app/clusters/power-source-server/power-source-server.cpp
index 717c610..a545ea9 100644
--- a/src/app/clusters/power-source-server/power-source-server.cpp
+++ b/src/app/clusters/power-source-server/power-source-server.cpp
@@ -23,7 +23,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app-common/zap-generated/ids/Attributes.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <lib/support/CodeUtils.h>
diff --git a/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp b/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp
index f1adbc7..041ecc0 100644
--- a/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp
+++ b/src/app/clusters/pump-configuration-and-control-client/pump-configuration-and-control-client.cpp
@@ -15,8 +15,6 @@
* limitations under the License.
*/
-#include <app/util/af.h>
-
#include <app/CommandHandler.h>
#include <app/util/attribute-storage.h>
diff --git a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp
index eea313c..5996cfe 100644
--- a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp
+++ b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-#include <app/util/af.h>
#include <app/util/util.h>
#include <app-common/zap-generated/attributes/Accessors.h>
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 8f79f39..95480dd 100644
--- a/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp
+++ b/src/app/clusters/resource-monitoring-server/resource-monitoring-server.cpp
@@ -26,7 +26,6 @@
#include <app/clusters/resource-monitoring-server/resource-monitoring-server.h>
#include <app/data-model/Nullable.h>
#include <app/reporting/reporting.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <lib/core/CHIPError.h>
#include <lib/support/CodeUtils.h>
diff --git a/src/app/clusters/sample-mei-server/sample-mei-server.cpp b/src/app/clusters/sample-mei-server/sample-mei-server.cpp
index 25bcb2a..56d026e 100644
--- a/src/app/clusters/sample-mei-server/sample-mei-server.cpp
+++ b/src/app/clusters/sample-mei-server/sample-mei-server.cpp
@@ -9,8 +9,8 @@
#include <app/EventLogging.h>
#include <app/InteractionModelEngine.h>
#include <app/reporting/reporting.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
+#include <app/util/config.h>
#include <app/util/util.h>
#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>
diff --git a/src/app/clusters/scenes-server/SceneHandlerImpl.h b/src/app/clusters/scenes-server/SceneHandlerImpl.h
index 91935d2..554ba2d 100644
--- a/src/app/clusters/scenes-server/SceneHandlerImpl.h
+++ b/src/app/clusters/scenes-server/SceneHandlerImpl.h
@@ -17,6 +17,7 @@
#include <app/clusters/scenes-server/SceneTable.h>
#include <app/util/attribute-storage.h>
+#include <app/util/types_stub.h>
#include <lib/core/DataModelTypes.h>
namespace chip {
diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp
index d05d7da..a57f003 100644
--- a/src/app/clusters/scenes-server/scenes-server.cpp
+++ b/src/app/clusters/scenes-server/scenes-server.cpp
@@ -25,6 +25,7 @@
#include <app/reporting/reporting.h>
#include <app/server/Server.h>
#include <app/util/attribute-storage.h>
+#include <app/util/config.h>
#include <credentials/GroupDataProvider.h>
#include <lib/support/CommonIterator.h>
#include <lib/support/Span.h>
diff --git a/src/app/clusters/scenes-server/scenes-server.h b/src/app/clusters/scenes-server/scenes-server.h
index 86459fb..81c7d41 100644
--- a/src/app/clusters/scenes-server/scenes-server.h
+++ b/src/app/clusters/scenes-server/scenes-server.h
@@ -24,6 +24,8 @@
#include <app/clusters/scenes-server/SceneTableImpl.h>
#include <app/data-model/DecodableList.h>
#include <app/data-model/Nullable.h>
+#include <app/util/attribute-storage.h>
+#include <app/util/config.h>
#include <credentials/GroupDataProvider.h>
namespace chip {
diff --git a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h
index 42efc49..68b048e 100644
--- a/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h
+++ b/src/app/clusters/smoke-co-alarm-server/smoke-co-alarm-server.h
@@ -25,7 +25,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/CommandHandler.h>
-#include <app/util/af.h>
#include <protocols/interaction_model/StatusCode.h>
/**
diff --git a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
index e024d74..b607158 100644
--- a/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
+++ b/src/app/clusters/software-diagnostics-server/software-diagnostics-server.cpp
@@ -26,7 +26,6 @@
#include <app/ConcreteCommandPath.h>
#include <app/EventLogging.h>
#include <app/InteractionModelEngine.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <lib/core/Optional.h>
#include <platform/DiagnosticDataProvider.h>
diff --git a/src/app/clusters/switch-server/switch-server.cpp b/src/app/clusters/switch-server/switch-server.cpp
index 64cce04..7a9dd1c 100644
--- a/src/app/clusters/switch-server/switch-server.cpp
+++ b/src/app/clusters/switch-server/switch-server.cpp
@@ -24,7 +24,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/EventLogging.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <lib/core/Optional.h>
#include <platform/DeviceControlServer.h>
diff --git a/src/app/clusters/switch-server/switch-server.h b/src/app/clusters/switch-server/switch-server.h
index c887016..5eb1205 100644
--- a/src/app/clusters/switch-server/switch-server.h
+++ b/src/app/clusters/switch-server/switch-server.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/src/app/clusters/target-navigator-server/target-navigator-delegate.h b/src/app/clusters/target-navigator-server/target-navigator-delegate.h
index f3be65c..dd0d80c 100644
--- a/src/app/clusters/target-navigator-server/target-navigator-delegate.h
+++ b/src/app/clusters/target-navigator-server/target-navigator-delegate.h
@@ -22,7 +22,6 @@
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
#include <list>
namespace chip {
diff --git a/src/app/clusters/thermostat-client/thermostat-client.cpp b/src/app/clusters/thermostat-client/thermostat-client.cpp
index bdd4b1a..9b66eaf 100644
--- a/src/app/clusters/thermostat-client/thermostat-client.cpp
+++ b/src/app/clusters/thermostat-client/thermostat-client.cpp
@@ -15,8 +15,6 @@
* limitations under the License.
*/
-#include <app/util/af.h>
-
#include <app/CommandHandler.h>
#include <app/util/attribute-storage.h>
diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp
index c0e4359..91d9b33 100644
--- a/src/app/clusters/thermostat-server/thermostat-server.cpp
+++ b/src/app/clusters/thermostat-server/thermostat-server.cpp
@@ -15,8 +15,6 @@
* limitations under the License.
*/
-#include <app/util/af.h>
-
#include <app/util/attribute-storage.h>
#include <app-common/zap-generated/attributes/Accessors.h>
diff --git a/src/app/clusters/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp b/src/app/clusters/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp
index 25e0edc..1325d50 100644
--- a/src/app/clusters/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp
+++ b/src/app/clusters/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp
@@ -15,10 +15,9 @@
* limitations under the License.
*/
-#include <app/util/af.h>
-
#include <app-common/zap-generated/cluster-objects.h>
#include <app/ConcreteAttributePath.h>
+#include <app/util/attribute-metadata.h>
#include <lib/core/CHIPEncoding.h>
using namespace chip::app;
diff --git a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp
index cae2948..b21f901 100644
--- a/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp
+++ b/src/app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-server.cpp
@@ -23,7 +23,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/clusters/thread-network-diagnostics-server/thread-network-diagnostics-provider.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <lib/core/CHIPEncoding.h>
#include <lib/core/Optional.h>
diff --git a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
index 3cf9239..0657e37 100644
--- a/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
+++ b/src/app/clusters/wifi-network-diagnostics-server/wifi-network-diagnostics-server.cpp
@@ -23,7 +23,6 @@
#include <app/CommandHandler.h>
#include <app/ConcreteCommandPath.h>
#include <app/EventLogging.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <lib/core/Optional.h>
#include <platform/DiagnosticDataProvider.h>
diff --git a/src/app/clusters/window-covering-server/window-covering-delegate.h b/src/app/clusters/window-covering-server/window-covering-delegate.h
index dac189e..4b8b4e8 100644
--- a/src/app/clusters/window-covering-server/window-covering-delegate.h
+++ b/src/app/clusters/window-covering-server/window-covering-delegate.h
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/cluster-objects.h>
#include <app/AttributeAccessInterface.h>
#include <app/CommandResponseHelper.h>
-#include <app/util/af.h>
namespace chip {
namespace app {
diff --git a/src/app/clusters/window-covering-server/window-covering-server.cpp b/src/app/clusters/window-covering-server/window-covering-server.cpp
index ba7d74c..bfa5e1e 100644
--- a/src/app/clusters/window-covering-server/window-covering-server.cpp
+++ b/src/app/clusters/window-covering-server/window-covering-server.cpp
@@ -23,7 +23,6 @@
#include <app/ConcreteCommandPath.h>
#include <app/reporting/reporting.h>
#include <app/util/af-types.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <lib/support/TypeTraits.h>
diff --git a/src/app/dynamic_server/BUILD.gn b/src/app/dynamic_server/BUILD.gn
new file mode 100644
index 0000000..5955512
--- /dev/null
+++ b/src/app/dynamic_server/BUILD.gn
@@ -0,0 +1,32 @@
+# Copyright (c) 2020 Project CHIP Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("//build_overrides/chip.gni")
+
+# This config is to allow ota-provider or similar to include
+# `_attribute-storage.h` (underscore to make linter not recognize this as a
+# reference) for overriden function access that are overriden by
+# DynamicDispatcher
+#
+# This feels awkward and should be cleaned up once we manage to isolate
+# generated code more.
+config("mock-codegen-config") {
+ include_dirs = [ "mock_includes" ]
+}
+
+source_set("mock-codegen-includes") {
+ sources = [ "mock_includes/zap-generated/endpoint_config.h" ]
+
+ public_configs = [ ":mock-codegen-config" ]
+}
diff --git a/src/app/dynamic_server/mock_includes/zap-generated/endpoint_config.h b/src/app/dynamic_server/mock_includes/zap-generated/endpoint_config.h
new file mode 100644
index 0000000..80fa880
--- /dev/null
+++ b/src/app/dynamic_server/mock_includes/zap-generated/endpoint_config.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2024 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <app/util/endpoint-config-defines.h>
+#include <lib/core/CHIPConfig.h>
+
+// Some overrides to see that this is not used as a real "endpoint_config" that contains data
+#define GENERATED_DEFAULTS #error "Not a real codegen. This is a temporary include for dynamic-overrides only"
+#define GENERATED_CLUSTERS #error "Not a real codegen. This is a temporary include for dynamic-overrides only"
diff --git a/src/app/reporting/reporting.cpp b/src/app/reporting/reporting.cpp
index 8ed06a8..0ee0ca9 100644
--- a/src/app/reporting/reporting.cpp
+++ b/src/app/reporting/reporting.cpp
@@ -18,7 +18,7 @@
#include <app/AttributePathParams.h>
#include <app/InteractionModelEngine.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <platform/LockTracker.h>
using namespace chip;
diff --git a/src/app/tests/TestPowerSourceCluster.cpp b/src/app/tests/TestPowerSourceCluster.cpp
index e998336..46371b3 100644
--- a/src/app/tests/TestPowerSourceCluster.cpp
+++ b/src/app/tests/TestPowerSourceCluster.cpp
@@ -19,7 +19,7 @@
#include "lib/support/CHIPMem.h"
#include <app-common/zap-generated/cluster-objects.h>
#include <app/clusters/power-source-server/power-source-server.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage.h>
#include <lib/core/ErrorStr.h>
#include <lib/core/TLV.h>
#include <lib/core/TLVDebug.h>
@@ -31,7 +31,6 @@
#include <messaging/Flags.h>
#include <nlunit-test.h>
#include <protocols/interaction_model/Constants.h>
-#include <type_traits>
#include <vector>
diff --git a/src/app/tests/suites/credentials/TestHarnessDACProvider.cpp b/src/app/tests/suites/credentials/TestHarnessDACProvider.cpp
index 5d9a986..366dd57 100644
--- a/src/app/tests/suites/credentials/TestHarnessDACProvider.cpp
+++ b/src/app/tests/suites/credentials/TestHarnessDACProvider.cpp
@@ -29,6 +29,7 @@
#include <platform/CHIPDeviceConfig.h>
#include <fstream>
+#include <string>
//-> format_version = 1
//-> vendor_id = 0xFFF1/0xFFF2/0xFFF3
diff --git a/src/app/util/af.h b/src/app/util/af.h
deleted file mode 100644
index f747d50..0000000
--- a/src/app/util/af.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/**
- *
- * Copyright (c) 2020-2021 Project CHIP Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#pragma once
-
-#ifndef CONFIGURATION_HEADER
-#define CONFIGURATION_HEADER <app/util/config.h>
-#endif
-#include CONFIGURATION_HEADER
-
-#include <app/util/af-types.h>
-
-#include <app/util/endpoint-config-api.h>
-
-#include <lib/core/DataModelTypes.h>
-#include <lib/support/Iterators.h>
-#include <lib/support/SafeInt.h>
-#include <protocols/interaction_model/StatusCode.h>
-
-/** @name Attribute Storage */
-// @{
-
-static constexpr uint16_t kEmberInvalidEndpointIndex = 0xFFFF;
-
-/**
- * @brief locate attribute metadata
- *
- * Function returns pointer to the attribute metadata structure,
- * or NULL if attribute was not found.
- *
- * @param endpoint Zigbee endpoint number.
- * @param clusterId Cluster ID of the sought cluster.
- * @param attributeId Attribute ID of the sought attribute.
- *
- * @return Returns pointer to the attribute metadata location.
- */
-const EmberAfAttributeMetadata * emberAfLocateAttributeMetadata(chip::EndpointId endpoint, chip::ClusterId clusterId,
- chip::AttributeId attributeId);
-/**
- * @brief Returns true if endpoint contains the ZCL server with specified id.
- *
- * This function returns true if
- * the endpoint contains server of a given cluster.
- */
-bool emberAfContainsServer(chip::EndpointId endpoint, chip::ClusterId clusterId);
-
-/**
- * @brief Returns true if endpoint of given index contains the ZCL server with specified id.
- *
- * This function returns true if
- * the endpoint of given index contains server of a given cluster.
- * If this function is used with a manufacturer specific clusterId
- * then this will return the first cluster that it finds in the Cluster table.
- * and will not return any other clusters that share that id.
- */
-bool emberAfContainsServerFromIndex(uint16_t index, chip::ClusterId clusterId);
-
-/**
- * @brief Returns true if endpoint contains the ZCL client with specified id.
- *
- * This function returns true if
- * the endpoint contains client of a given cluster.
- */
-bool emberAfContainsClient(chip::EndpointId endpoint, chip::ClusterId clusterId);
-
-/**
- * @brief write an attribute, performing all the checks.
- *
- * This function will attempt to write the attribute value from
- * the provided pointer. This function will only check that the
- * attribute exists. If it does it will write the value into
- * the attribute table for the given attribute.
- *
- * This function will not check to see if the attribute is
- * writable since the read only / writable characteristic
- * of an attribute only pertains to external devices writing
- * over the air. Because this function is being called locally
- * it assumes that the device knows what it is doing and has permission
- * to perform the given operation.
- *
- * This function also does NOT check that the input dataType matches the expected
- * data type (as Accessors.h/cpp have this correct by default).
- * TODO: this not checking seems off - what if this is run without Accessors.h ?
- */
-chip::Protocols::InteractionModel::Status emberAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
- chip::AttributeId attributeID, uint8_t * dataPtr,
- EmberAfAttributeType dataType);
-
-/**
- * @brief Read the attribute value, performing all the checks.
- *
- * This function will attempt to read the attribute and store it into the
- * pointer.
- *
- * dataPtr may be NULL, signifying that we don't need the value, just the status
- * (i.e. whether the attribute can be read).
- */
-chip::Protocols::InteractionModel::Status emberAfReadAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
- chip::AttributeId attributeID, uint8_t * dataPtr,
- uint16_t readLength);
-
-/**
- * @brief macro that returns size of attribute in bytes.
- *
- * @param metadata EmberAfAttributeMetadata* to consider.
- */
-#define emberAfAttributeSize(metadata) ((metadata)->size)
-
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
-// master array of all defined endpoints
-extern EmberAfDefinedEndpoint emAfEndpoints[];
-#endif
-
-/**
- * @brief Returns parent endpoint for a given endpoint index
- */
-chip::EndpointId emberAfParentEndpointFromIndex(uint16_t index);
-
-/**
- * Returns the index of a given endpoint. Will return 0xFFFF if this is not a
- * valid endpoint id or if the endpoint is disabled.
- */
-uint16_t emberAfIndexFromEndpoint(chip::EndpointId endpoint);
-
-/**
- * @brief Returns the index of the given endpoint in the list of all endpoints that might support the given cluster server.
- *
- * Returns kEmberInvalidEndpointIndex if the given endpoint does not support the
- * given cluster or if the given endpoint is disabled.
- *
- * This function always returns the same index for a given endpointId instance, fixed or dynamic.
- *
- * The return index for fixed endpoints will range from 0 to (fixedClusterServerEndpointCount - 1),
- * For dynamic endpoints the indexing assumes that any dynamic endpoint could start supporting
- * the given server cluster and their index will range from fixedClusterServerEndpointCount to
- * (fixedClusterServerEndpointCount + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT - 1).
- *
- * For example, if a device has 4 fixed endpoints (ids 0-3) and 2 dynamic
- * endpoints, and cluster X is supported on endpoints 1 and 3, then
- * fixedClusterServerEndpointCount should be 2 and
- *
- * 1) emberAfGetClusterServerEndpointIndex(0, X) returns kEmberInvalidEndpointIndex
- * 2) emberAfGetClusterServerEndpointIndex(1, X) returns 0
- * 3) emberAfGetClusterServerEndpointIndex(2, X) returns kEmberInvalidEndpointIndex
- * 4) emberAfGetClusterServerEndpointIndex(3, X) returns 1
-
- * The Dynamic endpoints are placed after the fixed ones;
- * therefore their return index will always be >= to fixedClusterServerEndpointCount
- *
- * If a dynamic endpoint, supporting cluster X, is defined to dynamic index 1 with endpoint id 7,
- * (via emberAfSetDynamicEndpoint(1, 7, ...))
- * then emberAfGetClusterServerEndpointIndex(7, X) returns 3 (fixedClusterServerEndpointCount{2} + DynamicEndpointIndex {1}).
- *
- * If now a second dynamic endpoint, also supporting cluster X, is defined to dynamic index 0
- * with endpoint id 9 (via emberAfSetDynamicEndpoint(0, 9, ...)),
- * emberAfGetClusterServerEndpointIndex(9, X) returns 2. (fixedClusterServerEndpointCount{2} + DynamicEndpointIndex {0}).
- * and emberAfGetClusterServerEndpointIndex(7, X) still returns 3
- *
- * @param endpoint Endpoint number
- * @param cluster Id the of the Cluster server you are interrested on
- * @param fixedClusterServerEndpointCount The number of fixed endpoints containing this cluster server. Typically one of the
- MATTER_DM_*_CLUSTER_SERVER_ENDPOINT_COUNT constants.
- */
-uint16_t emberAfGetClusterServerEndpointIndex(chip::EndpointId endpoint, chip::ClusterId cluster,
- uint16_t fixedClusterServerEndpointCount);
-
-/**
- * @brief Returns the number of pre-compiled endpoints.
- */
-uint16_t emberAfFixedEndpointCount(void);
-
-/** @} END Attribute Storage */
-
-/** @} END addtogroup */
-
-/**
- * Returns the pointer to the data version storage for the given endpoint and
- * cluster. Can return null in the following cases:
- *
- * 1) There is no such endpoint.
- * 2) There is no such server cluster on the given endpoint.
- * 3) No storage for a data version was provided for the endpoint.
- */
-chip::DataVersion * emberAfDataVersionStorage(const chip::app::ConcreteClusterPath & aConcreteClusterPath);
-
-namespace chip {
-namespace app {
-
-class EnabledEndpointsWithServerCluster
-{
-public:
- EnabledEndpointsWithServerCluster(ClusterId clusterId);
-
- // Instead of having a separate Iterator class, optimize for codesize by
- // just reusing ourselves as our own iterator. We could do a bit better
- // here with C++17 and using a different type for the end iterator, but this
- // is the best I've found with C++14 so far.
- //
- // This does mean that you can only iterate a given
- // EnabledEndpointsWithServerCluster once, but that's OK given how we use it
- // in practice.
- EnabledEndpointsWithServerCluster & begin() { return *this; }
- const EnabledEndpointsWithServerCluster & end() const { return *this; }
-
- bool operator!=(const EnabledEndpointsWithServerCluster & other) const { return mEndpointIndex != mEndpointCount; }
-
- EnabledEndpointsWithServerCluster & operator++();
-
- EndpointId operator*() const { return emberAfEndpointFromIndex(mEndpointIndex); }
-
-private:
- void EnsureMatchingEndpoint();
-
- uint16_t mEndpointIndex = 0;
- uint16_t mEndpointCount = emberAfEndpointCount();
- ClusterId mClusterId;
-};
-
-/**
- * @brief Sets the parent endpoint for a given endpoint
- */
-CHIP_ERROR SetParentEndpointForEndpoint(EndpointId childEndpoint, EndpointId parentEndpoint);
-
-/**
- * @brief Sets an Endpoint to use Flat Composition
- */
-CHIP_ERROR SetFlatCompositionForEndpoint(EndpointId endpoint);
-
-/**
- * @brief Sets an Endpoint to use Tree Composition
- */
-CHIP_ERROR SetTreeCompositionForEndpoint(EndpointId endpoint);
-
-/**
- * @brief Returns true is an Endpoint has flat composition
- */
-bool IsFlatCompositionForEndpoint(EndpointId endpoint);
-
-/**
- * @brief Returns true is an Endpoint has tree composition
- */
-bool IsTreeCompositionForEndpoint(EndpointId endpoint);
-
-} // namespace app
-} // namespace chip
diff --git a/src/app/util/attribute-storage-detail.h b/src/app/util/attribute-storage-detail.h
new file mode 100644
index 0000000..922605f
--- /dev/null
+++ b/src/app/util/attribute-storage-detail.h
@@ -0,0 +1,88 @@
+/**
+ *
+ * Copyright (c) 2024 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <app/AttributeAccessInterface.h>
+#include <app/ConcreteAttributePath.h>
+#include <app/util/config.h>
+#include <app/util/endpoint-config-api.h>
+#include <lib/support/CodeUtils.h>
+
+#include <app/util/att-storage.h>
+#include <app/util/attribute-metadata.h>
+#include <zap-generated/endpoint_config.h>
+
+#include <protocols/interaction_model/StatusCode.h>
+
+extern uint8_t attributeData[]; // main storage bucket for all attributes
+
+void emAfCallInits();
+
+chip::Protocols::InteractionModel::Status emAfReadOrWriteAttribute(const EmberAfAttributeSearchRecord * attRecord,
+ const EmberAfAttributeMetadata ** metadata, uint8_t * buffer,
+ uint16_t readLength, bool write);
+
+//
+// Given a cluster ID, endpoint ID and a cluster mask, finds a matching cluster within that endpoint
+// with a matching mask. If one is found, the relative index of that cluster within the list of clusters on that
+// endpoint is returned. Otherwise, 0xFF is returned.
+//
+uint8_t emberAfClusterIndex(chip::EndpointId endpoint, chip::ClusterId clusterId, EmberAfClusterMask mask);
+
+// Returns the clusterId of Nth server or client cluster,
+// depending on server toggle.
+// Returns Optional<ClusterId>::Missing if cluster does not exist.
+chip::Optional<chip::ClusterId> emberAfGetNthClusterId(chip::EndpointId endpoint, uint8_t n, bool server);
+
+// Returns cluster within the endpoint; Does not ignore disabled endpoints
+const EmberAfCluster * emberAfFindClusterIncludingDisabledEndpoints(chip::EndpointId endpoint, chip::ClusterId clusterId,
+ EmberAfClusterMask mask);
+
+// Function mask must contain one of the CLUSTER_MASK function macros,
+// then this method either returns the function pointer or null if
+// function doesn't exist. Before you call the function, you must
+// cast it.
+EmberAfGenericClusterFunction emberAfFindClusterFunction(const EmberAfCluster * cluster, EmberAfClusterMask functionMask);
+
+// After the RAM value has changed, code should call this function. If this
+// attribute has been tagged as non-volatile, its value will be stored.
+void emAfSaveAttributeToStorageIfNeeded(uint8_t * data, chip::EndpointId endpoint, chip::ClusterId clusterId,
+ const EmberAfAttributeMetadata * metadata);
+
+// Calls the attribute changed callback
+void emAfClusterAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath);
+
+// Calls the attribute changed callback for a specific cluster.
+chip::Protocols::InteractionModel::Status
+emAfClusterPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType,
+ uint16_t size, uint8_t * value);
+
+// Get the number of attributes of the specific cluster under the endpoint.
+// Returns 0 if the cluster does not exist.
+uint16_t emberAfGetServerAttributeCount(chip::EndpointId endpoint, chip::ClusterId cluster);
+
+// Get the index of the given attribute of the specific cluster under the endpoint.
+// Returns UINT16_MAX if the attribute does not exist.
+uint16_t emberAfGetServerAttributeIndexByAttributeId(chip::EndpointId endpoint, chip::ClusterId cluster,
+ chip::AttributeId attributeId);
+
+// Get the attribute id at the attributeIndex of the cluster under the endpoint. This function is useful for iterating over the
+// attributes.
+// Returns Optional<chip::AttributeId>::Missing() if the attribute does not exist.
+chip::Optional<chip::AttributeId> emberAfGetServerAttributeIdByIndex(chip::EndpointId endpoint, chip::ClusterId cluster,
+ uint16_t attributeIndex);
diff --git a/src/app/util/attribute-storage.cpp b/src/app/util/attribute-storage.cpp
index 6aa8e33..8848c63 100644
--- a/src/app/util/attribute-storage.cpp
+++ b/src/app/util/attribute-storage.cpp
@@ -17,13 +17,15 @@
#include <app/util/attribute-storage.h>
+#include <app/util/attribute-storage-detail.h>
+
#include <app/AttributeAccessInterfaceCache.h>
#include <app/AttributePersistenceProvider.h>
#include <app/InteractionModelEngine.h>
#include <app/reporting/reporting.h>
-#include <app/util/af.h>
#include <app/util/config.h>
#include <app/util/ember-strings.h>
+#include <app/util/endpoint-config-api.h>
#include <app/util/generic-callbacks.h>
#include <lib/core/CHIPConfig.h>
#include <lib/support/CodeUtils.h>
@@ -816,10 +818,17 @@
namespace chip {
namespace app {
-EnabledEndpointsWithServerCluster::EnabledEndpointsWithServerCluster(ClusterId clusterId) : mClusterId(clusterId)
+EnabledEndpointsWithServerCluster::EnabledEndpointsWithServerCluster(ClusterId clusterId) :
+ mEndpointCount(emberAfEndpointCount()), mClusterId(clusterId)
{
EnsureMatchingEndpoint();
}
+
+EndpointId EnabledEndpointsWithServerCluster::operator*() const
+{
+ return emberAfEndpointFromIndex(mEndpointIndex);
+}
+
EnabledEndpointsWithServerCluster & EnabledEndpointsWithServerCluster::operator++()
{
++mEndpointIndex;
diff --git a/src/app/util/attribute-storage.h b/src/app/util/attribute-storage.h
index 4365366..013be43 100644
--- a/src/app/util/attribute-storage.h
+++ b/src/app/util/attribute-storage.h
@@ -1,6 +1,6 @@
/**
*
- * Copyright (c) 2020 Project CHIP Authors
+ * Copyright (c) 2024 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,26 +17,28 @@
#pragma once
-// #include PLATFORM_HEADER
#include <app/AttributeAccessInterface.h>
-#include <app/ConcreteAttributePath.h>
-#include <app/util/af.h>
+#include <app/util/af-types.h>
+#include <app/util/att-storage.h>
+#include <app/util/attribute-metadata.h>
#include <app/util/config.h>
-#include <app/util/endpoint-config-api.h>
+#include <app/util/endpoint-config-defines.h>
#include <lib/support/CodeUtils.h>
-#include <app/util/att-storage.h>
+#include <app-common/zap-generated/attribute-type.h>
+#include <app-common/zap-generated/cluster-objects.h>
+
+// NOTE: direct include here even though app/util/config.h is the public header,
+// because MAX_ENDPOINT_COUNT needs FIXED_ENDPOINT_COUNT definitions.
#include <zap-generated/endpoint_config.h>
-#include <protocols/interaction_model/StatusCode.h>
+static constexpr uint16_t kEmberInvalidEndpointIndex = 0xFFFF;
// If we have fixed number of endpoints, then max is the same.
#ifdef FIXED_ENDPOINT_COUNT
#define MAX_ENDPOINT_COUNT (FIXED_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT)
#endif
-#include <app-common/zap-generated/attribute-type.h>
-
#define DECLARE_DYNAMIC_ENDPOINT(endpointName, clusterList) \
EmberAfEndpointType endpointName = { clusterList, ArraySize(clusterList), 0 }
@@ -64,94 +66,141 @@
ZAP_EMPTY_DEFAULT(), attId, attSizeBytes, ZAP_TYPE(attType), attrMask | ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) \
}
-extern uint8_t attributeData[]; // main storage bucket for all attributes
-
-void emAfCallInits(void);
-
-// Initial configuration
-void emberAfEndpointConfigure(void);
-
-chip::Protocols::InteractionModel::Status emAfReadOrWriteAttribute(const EmberAfAttributeSearchRecord * attRecord,
- const EmberAfAttributeMetadata ** metadata, uint8_t * buffer,
- uint16_t readLength, bool write);
-
-// Check if a cluster is implemented or not. If yes, the cluster is returned.
-//
-// mask = 0 -> find either client or server
-// mask = CLUSTER_MASK_CLIENT -> find client
-// mask = CLUSTER_MASK_SERVER -> find server
-//
-// If a pointer to an index is provided, it will be updated to point to the relative index of the cluster
-// within the set of clusters that match the mask criteria.
-//
-const EmberAfCluster * emberAfFindClusterInType(const EmberAfEndpointType * endpointType, chip::ClusterId clusterId,
- EmberAfClusterMask mask, uint8_t * index = nullptr);
-
-//
-// Given a cluster ID, endpoint ID and a cluster mask, finds a matching cluster within that endpoint
-// with a matching mask. If one is found, the relative index of that cluster within the list of clusters on that
-// endpoint is returned. Otherwise, 0xFF is returned.
-//
-uint8_t emberAfClusterIndex(chip::EndpointId endpoint, chip::ClusterId clusterId, EmberAfClusterMask mask);
-
-// If server == true, returns the number of server clusters,
-// otherwise number of client clusters on this endpoint
-uint8_t emberAfClusterCount(chip::EndpointId endpoint, bool server);
-
-// Returns the cluster of Nth server or client cluster,
-// depending on server toggle.
-const EmberAfCluster * emberAfGetNthCluster(chip::EndpointId endpoint, uint8_t n, bool server);
-
-// Returns the clusterId of Nth server or client cluster,
-// depending on server toggle.
-// Returns Optional<ClusterId>::Missing if cluster does not exist.
-chip::Optional<chip::ClusterId> emberAfGetNthClusterId(chip::EndpointId endpoint, uint8_t n, bool server);
-
-// Returns number of clusters put into the passed cluster list
-// for the given endpoint and client/server polarity
-uint8_t emberAfGetClustersFromEndpoint(chip::EndpointId endpoint, chip::ClusterId * clusterList, uint8_t listLen, bool server);
-
-// Returns cluster within the endpoint; Does not ignore disabled endpoints
-const EmberAfCluster * emberAfFindClusterIncludingDisabledEndpoints(chip::EndpointId endpoint, chip::ClusterId clusterId,
- EmberAfClusterMask mask);
-
-// Function mask must contain one of the CLUSTER_MASK function macros,
-// then this method either returns the function pointer or null if
-// function doesn't exist. Before you call the function, you must
-// cast it.
-EmberAfGenericClusterFunction emberAfFindClusterFunction(const EmberAfCluster * cluster, EmberAfClusterMask functionMask);
+/**
+ * @brief locate attribute metadata
+ *
+ * Function returns pointer to the attribute metadata structure,
+ * or NULL if attribute was not found.
+ *
+ * @param endpoint Zigbee endpoint number.
+ * @param clusterId Cluster ID of the sought cluster.
+ * @param attributeId Attribute ID of the sought attribute.
+ *
+ * @return Returns pointer to the attribute metadata location.
+ */
+const EmberAfAttributeMetadata * emberAfLocateAttributeMetadata(chip::EndpointId endpoint, chip::ClusterId clusterId,
+ chip::AttributeId attributeId);
/**
- * @brief Loads attribute defaults and any non-volatile attributes stored
+ * @brief Returns true if endpoint contains the ZCL server with specified id.
*
- * @param endpoint EnpointId. Use chip::kInvalidEndpointId to initialize all endpoints
+ * This function returns true if
+ * the endpoint contains server of a given cluster.
*/
-void emberAfInitializeAttributes(chip::EndpointId endpoint);
+bool emberAfContainsServer(chip::EndpointId endpoint, chip::ClusterId clusterId);
-// After the RAM value has changed, code should call this function. If this
-// attribute has been tagged as non-volatile, its value will be stored.
-void emAfSaveAttributeToStorageIfNeeded(uint8_t * data, chip::EndpointId endpoint, chip::ClusterId clusterId,
- const EmberAfAttributeMetadata * metadata);
+/**
+ * @brief Returns true if endpoint of given index contains the ZCL server with specified id.
+ *
+ * This function returns true if
+ * the endpoint of given index contains server of a given cluster.
+ * If this function is used with a manufacturer specific clusterId
+ * then this will return the first cluster that it finds in the Cluster table.
+ * and will not return any other clusters that share that id.
+ */
+bool emberAfContainsServerFromIndex(uint16_t index, chip::ClusterId clusterId);
-// Calls the attribute changed callback
-void emAfClusterAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath);
+/**
+ * @brief Returns true if endpoint contains the ZCL client with specified id.
+ *
+ * This function returns true if
+ * the endpoint contains client of a given cluster.
+ */
+bool emberAfContainsClient(chip::EndpointId endpoint, chip::ClusterId clusterId);
-// Calls the attribute changed callback for a specific cluster.
-chip::Protocols::InteractionModel::Status
-emAfClusterPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType,
- uint16_t size, uint8_t * value);
+/**
+ * @brief macro that returns size of attribute in bytes.
+ *
+ * @param metadata EmberAfAttributeMetadata* to consider.
+ */
+#define emberAfAttributeSize(metadata) ((metadata)->size)
-// Note the difference in for server filtering.
-// This method will return the cluster count for BOTH client and server
-// and those do NOT work with NthCluster/NthClusterId
-// - Use emberAfGetClustersFromEndpoint() with emberAfGetNthCluster() emberAfGetNthClusterId()
-//
-uint8_t emberAfGetClusterCountForEndpoint(chip::EndpointId endpoint);
+/**
+ * Returns the index of a given endpoint. Will return 0xFFFF if this is not a
+ * valid endpoint id or if the endpoint is disabled.
+ */
+uint16_t emberAfIndexFromEndpoint(chip::EndpointId endpoint);
-//
-// Retrieve the device type list associated with a specific endpoint.
-//
-chip::Span<const EmberAfDeviceType> emberAfDeviceTypeListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err);
+/**
+ * @brief Returns parent endpoint for a given endpoint index
+ */
+chip::EndpointId emberAfParentEndpointFromIndex(uint16_t index);
+
+/**
+ * @brief Returns the index of the given endpoint in the list of all endpoints that might support the given cluster server.
+ *
+ * Returns kEmberInvalidEndpointIndex if the given endpoint does not support the
+ * given cluster or if the given endpoint is disabled.
+ *
+ * This function always returns the same index for a given endpointId instance, fixed or dynamic.
+ *
+ * The return index for fixed endpoints will range from 0 to (fixedClusterServerEndpointCount - 1),
+ * For dynamic endpoints the indexing assumes that any dynamic endpoint could start supporting
+ * the given server cluster and their index will range from fixedClusterServerEndpointCount to
+ * (fixedClusterServerEndpointCount + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT - 1).
+ *
+ * For example, if a device has 4 fixed endpoints (ids 0-3) and 2 dynamic
+ * endpoints, and cluster X is supported on endpoints 1 and 3, then
+ * fixedClusterServerEndpointCount should be 2 and
+ *
+ * 1) emberAfGetClusterServerEndpointIndex(0, X) returns kEmberInvalidEndpointIndex
+ * 2) emberAfGetClusterServerEndpointIndex(1, X) returns 0
+ * 3) emberAfGetClusterServerEndpointIndex(2, X) returns kEmberInvalidEndpointIndex
+ * 4) emberAfGetClusterServerEndpointIndex(3, X) returns 1
+
+ * The Dynamic endpoints are placed after the fixed ones;
+ * therefore their return index will always be >= to fixedClusterServerEndpointCount
+ *
+ * If a dynamic endpoint, supporting cluster X, is defined to dynamic index 1 with endpoint id 7,
+ * (via emberAfSetDynamicEndpoint(1, 7, ...))
+ * then emberAfGetClusterServerEndpointIndex(7, X) returns 3 (fixedClusterServerEndpointCount{2} + DynamicEndpointIndex {1}).
+ *
+ * If now a second dynamic endpoint, also supporting cluster X, is defined to dynamic index 0
+ * with endpoint id 9 (via emberAfSetDynamicEndpoint(0, 9, ...)),
+ * emberAfGetClusterServerEndpointIndex(9, X) returns 2. (fixedClusterServerEndpointCount{2} + DynamicEndpointIndex {0}).
+ * and emberAfGetClusterServerEndpointIndex(7, X) still returns 3
+ *
+ * @param endpoint Endpoint number
+ * @param cluster Id the of the Cluster server you are interrested on
+ * @param fixedClusterServerEndpointCount The number of fixed endpoints containing this cluster server. Typically one of the
+ MATTER_DM_*_CLUSTER_SERVER_ENDPOINT_COUNT constants.
+ */
+uint16_t emberAfGetClusterServerEndpointIndex(chip::EndpointId endpoint, chip::ClusterId cluster,
+ uint16_t fixedClusterServerEndpointCount);
+
+/**
+ * Returns the pointer to the data version storage for the given endpoint and
+ * cluster. Can return null in the following cases:
+ *
+ * 1) There is no such endpoint.
+ * 2) There is no such server cluster on the given endpoint.
+ * 3) No storage for a data version was provided for the endpoint.
+ */
+chip::DataVersion * emberAfDataVersionStorage(const chip::app::ConcreteClusterPath & aConcreteClusterPath);
+
+/**
+ * @brief Returns the number of pre-compiled endpoints.
+ */
+uint16_t emberAfFixedEndpointCount();
+
+/**
+ * Register an attribute access override. It will remain registered until the
+ * endpoint it's registered for is disabled (or until shutdown if it's
+ * registered for all endpoints) or until it is explicitly unregistered.
+ * Registration will fail if there is an already-registered override for the
+ * same set of attributes.
+ *
+ * @return false if there is an existing override that the new one would
+ * conflict with. In this case the override is not registered.
+ * @return true if registration was successful.
+ */
+bool registerAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride);
+
+/**
+ * Unregister an attribute access override (for example if the object
+ * implementing AttributeAccessInterface is being destroyed).
+ */
+void unregisterAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride);
/**
* Get the semantic tags of the endpoint.
@@ -166,14 +215,6 @@
chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type & tag);
//
-// Override the device type list current associated with an endpoint with a user-provided list. The buffers backing
-// that list have to live as long as the endpoint is enabled.
-//
-// NOTE: It is the application's responsibility to free the existing list that is being replaced if needed.
-//
-CHIP_ERROR emberAfSetDeviceTypeList(chip::EndpointId endpoint, chip::Span<const EmberAfDeviceType> deviceTypeList);
-
-//
// Override the tag list current associated with an endpoint with a user-provided list. The buffers backing
// that list have to live as long as the endpoint is enabled.
//
@@ -182,6 +223,32 @@
CHIP_ERROR SetTagList(chip::EndpointId endpoint,
chip::Span<const chip::app::Clusters::Descriptor::Structs::SemanticTagStruct::Type> tagList);
+// Returns number of clusters put into the passed cluster list
+// for the given endpoint and client/server polarity
+uint8_t emberAfGetClustersFromEndpoint(chip::EndpointId endpoint, chip::ClusterId * clusterList, uint8_t listLen, bool server);
+
+// Note the difference in for server filtering.
+// This method will return the cluster count for BOTH client and server
+// and those do NOT work with NthCluster/NthClusterId
+// - Use emberAfGetClustersFromEndpoint() with emberAfGetNthCluster() emberAfGetNthClusterId()
+//
+uint8_t emberAfGetClusterCountForEndpoint(chip::EndpointId endpoint);
+
+// Check if a cluster is implemented or not. If yes, the cluster is returned.
+//
+// mask = 0 -> find either client or server
+// mask = CLUSTER_MASK_CLIENT -> find client
+// mask = CLUSTER_MASK_SERVER -> find server
+//
+// If a pointer to an index is provided, it will be updated to point to the relative index of the cluster
+// within the set of clusters that match the mask criteria.
+//
+const EmberAfCluster * emberAfFindClusterInType(const EmberAfEndpointType * endpointType, chip::ClusterId clusterId,
+ EmberAfClusterMask mask, uint8_t * index = nullptr);
+
+// Initial configuration
+void emberAfEndpointConfigure();
+
// Register a dynamic endpoint. This involves registering descriptors that describe
// the composition of the endpoint (encapsulated in the 'ep' argument) as well as providing
// storage for data versions.
@@ -209,37 +276,91 @@
chip::EndpointId parentEndpointId = chip::kInvalidEndpointId);
chip::EndpointId emberAfClearDynamicEndpoint(uint16_t index);
uint16_t emberAfGetDynamicIndexFromEndpoint(chip::EndpointId id);
-
-// Get the number of attributes of the specific cluster under the endpoint.
-// Returns 0 if the cluster does not exist.
-uint16_t emberAfGetServerAttributeCount(chip::EndpointId endpoint, chip::ClusterId cluster);
-
-// Get the index of the given attribute of the specific cluster under the endpoint.
-// Returns UINT16_MAX if the attribute does not exist.
-uint16_t emberAfGetServerAttributeIndexByAttributeId(chip::EndpointId endpoint, chip::ClusterId cluster,
- chip::AttributeId attributeId);
-
-// Get the attribute id at the attributeIndex of the cluster under the endpoint. This function is useful for iterating over the
-// attributes.
-// Returns Optional<chip::AttributeId>::Missing() if the attribute does not exist.
-chip::Optional<chip::AttributeId> emberAfGetServerAttributeIdByIndex(chip::EndpointId endpoint, chip::ClusterId cluster,
- uint16_t attributeIndex);
-
/**
- * Register an attribute access override. It will remain registered until the
- * endpoint it's registered for is disabled (or until shutdown if it's
- * registered for all endpoints) or until it is explicitly unregistered.
- * Registration will fail if there is an already-registered override for the
- * same set of attributes.
+ * @brief Loads attribute defaults and any non-volatile attributes stored
*
- * @return false if there is an existing override that the new one would
- * conflict with. In this case the override is not registered.
- * @return true if registration was successful.
+ * @param endpoint EnpointId. Use chip::kInvalidEndpointId to initialize all endpoints
*/
-bool registerAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride);
+void emberAfInitializeAttributes(chip::EndpointId endpoint);
+
+// If server == true, returns the number of server clusters,
+// otherwise number of client clusters on this endpoint
+uint8_t emberAfClusterCount(chip::EndpointId endpoint, bool server);
+
+// Returns the cluster of Nth server or client cluster,
+// depending on server toggle.
+const EmberAfCluster * emberAfGetNthCluster(chip::EndpointId endpoint, uint8_t n, bool server);
+
+//
+// Retrieve the device type list associated with a specific endpoint.
+//
+chip::Span<const EmberAfDeviceType> emberAfDeviceTypeListFromEndpoint(chip::EndpointId endpoint, CHIP_ERROR & err);
+
+//
+// Override the device type list current associated with an endpoint with a user-provided list. The buffers backing
+// that list have to live as long as the endpoint is enabled.
+//
+// NOTE: It is the application's responsibility to free the existing list that is being replaced if needed.
+//
+CHIP_ERROR emberAfSetDeviceTypeList(chip::EndpointId endpoint, chip::Span<const EmberAfDeviceType> deviceTypeList);
+
+namespace chip {
+namespace app {
+
+class EnabledEndpointsWithServerCluster
+{
+public:
+ EnabledEndpointsWithServerCluster(ClusterId clusterId);
+
+ // Instead of having a separate Iterator class, optimize for codesize by
+ // just reusing ourselves as our own iterator. We could do a bit better
+ // here with C++17 and using a different type for the end iterator, but this
+ // is the best I've found with C++14 so far.
+ //
+ // This does mean that you can only iterate a given
+ // EnabledEndpointsWithServerCluster once, but that's OK given how we use it
+ // in practice.
+ EnabledEndpointsWithServerCluster & begin() { return *this; }
+ const EnabledEndpointsWithServerCluster & end() const { return *this; }
+
+ bool operator!=(const EnabledEndpointsWithServerCluster & other) const { return mEndpointIndex != mEndpointCount; }
+
+ EnabledEndpointsWithServerCluster & operator++();
+
+ EndpointId operator*() const;
+
+private:
+ void EnsureMatchingEndpoint();
+
+ uint16_t mEndpointIndex = 0;
+ uint16_t mEndpointCount = 0;
+ ClusterId mClusterId;
+};
/**
- * Unregister an attribute access override (for example if the object
- * implementing AttributeAccessInterface is being destroyed).
+ * @brief Sets the parent endpoint for a given endpoint
*/
-void unregisterAttributeAccessOverride(chip::app::AttributeAccessInterface * attrOverride);
+CHIP_ERROR SetParentEndpointForEndpoint(EndpointId childEndpoint, EndpointId parentEndpoint);
+
+/**
+ * @brief Sets an Endpoint to use Flat Composition
+ */
+CHIP_ERROR SetFlatCompositionForEndpoint(EndpointId endpoint);
+
+/**
+ * @brief Sets an Endpoint to use Tree Composition
+ */
+CHIP_ERROR SetTreeCompositionForEndpoint(EndpointId endpoint);
+
+/**
+ * @brief Returns true is an Endpoint has flat composition
+ */
+bool IsFlatCompositionForEndpoint(EndpointId endpoint);
+
+/**
+ * @brief Returns true is an Endpoint has tree composition
+ */
+bool IsTreeCompositionForEndpoint(EndpointId endpoint);
+
+} // namespace app
+} // namespace chip
diff --git a/src/app/util/attribute-table-detail.h b/src/app/util/attribute-table-detail.h
new file mode 100644
index 0000000..d60c282
--- /dev/null
+++ b/src/app/util/attribute-table-detail.h
@@ -0,0 +1,66 @@
+/**
+ *
+ * Copyright (c) 2024 Project CHIP Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <app/util/attribute-metadata.h>
+#include <lib/core/DataModelTypes.h>
+#include <protocols/interaction_model/StatusCode.h>
+
+/**
+ * Write an attribute for a request arriving from external sources.
+ *
+ * This will check attribute writeability and that
+ * the provided data type matches the expected data type.
+ */
+chip::Protocols::InteractionModel::Status emAfWriteAttributeExternal(chip::EndpointId endpoint, chip::ClusterId cluster,
+ chip::AttributeId attributeID, uint8_t * dataPtr,
+ EmberAfAttributeType dataType);
+
+/**
+ * @brief write an attribute, performing all the checks.
+ *
+ * This function will attempt to write the attribute value from
+ * the provided pointer. This function will only check that the
+ * attribute exists. If it does it will write the value into
+ * the attribute table for the given attribute.
+ *
+ * This function will not check to see if the attribute is
+ * writable since the read only / writable characteristic
+ * of an attribute only pertains to external devices writing
+ * over the air. Because this function is being called locally
+ * it assumes that the device knows what it is doing and has permission
+ * to perform the given operation.
+ *
+ * if true is passed in for overrideReadOnlyAndDataType then the data type is
+ * not checked and the read-only flag is ignored. This mode is meant for
+ * testing or setting the initial value of the attribute on the device.
+ *
+ * this returns:
+ * - Status::UnsupportedEndpoint: if endpoint isn't supported by the device.
+ * - Status::UnsupportedCluster: if cluster isn't supported on the endpoint.
+ * - Status::UnsupportedAttribute: if attribute isn't supported in the cluster.
+ * - Status::InvalidDataType: if the data type passed in doesnt match the type
+ * stored in the attribute table
+ * - Status::UnsupportedWrite: if the attribute isnt writable
+ * - Status::ConstraintError: if the value is set out of the allowable range for
+ * the attribute
+ * - Status::Success: if the attribute was found and successfully written
+ */
+chip::Protocols::InteractionModel::Status emAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
+ chip::AttributeId attributeID, uint8_t * data,
+ EmberAfAttributeType dataType, bool overrideReadOnlyAndDataType);
diff --git a/src/app/util/attribute-table.cpp b/src/app/util/attribute-table.cpp
index 0b0f214..0f5b33c 100644
--- a/src/app/util/attribute-table.cpp
+++ b/src/app/util/attribute-table.cpp
@@ -16,6 +16,9 @@
*/
#include <app/util/attribute-table.h>
+#include <app/util/attribute-table-detail.h>
+
+#include <app/util/attribute-storage-detail.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <app/util/generic-callbacks.h>
diff --git a/src/app/util/attribute-table.h b/src/app/util/attribute-table.h
index 7b86298..16825dd 100644
--- a/src/app/util/attribute-table.h
+++ b/src/app/util/attribute-table.h
@@ -1,6 +1,6 @@
/**
*
- * Copyright (c) 2020 Project CHIP Authors
+ * Copyright (c) 2024 Project CHIP Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,21 +17,11 @@
#pragma once
-#include <app/util/af.h>
-
+#include <app/util/attribute-metadata.h>
+#include <lib/core/DataModelTypes.h>
#include <protocols/interaction_model/StatusCode.h>
/**
- * Write an attribute for a request arriving from external sources.
- *
- * This will check attribute writeability and that
- * the provided data type matches the expected data type.
- */
-chip::Protocols::InteractionModel::Status emAfWriteAttributeExternal(chip::EndpointId endpoint, chip::ClusterId cluster,
- chip::AttributeId attributeID, uint8_t * dataPtr,
- EmberAfAttributeType dataType);
-
-/**
* @brief write an attribute, performing all the checks.
*
* This function will attempt to write the attribute value from
@@ -46,21 +36,23 @@
* it assumes that the device knows what it is doing and has permission
* to perform the given operation.
*
- * if true is passed in for overrideReadOnlyAndDataType then the data type is
- * not checked and the read-only flag is ignored. This mode is meant for
- * testing or setting the initial value of the attribute on the device.
- *
- * this returns:
- * - Status::UnsupportedEndpoint: if endpoint isn't supported by the device.
- * - Status::UnsupportedCluster: if cluster isn't supported on the endpoint.
- * - Status::UnsupportedAttribute: if attribute isn't supported in the cluster.
- * - Status::InvalidDataType: if the data type passed in doesnt match the type
- * stored in the attribute table
- * - Status::UnsupportedWrite: if the attribute isnt writable
- * - Status::ConstraintError: if the value is set out of the allowable range for
- * the attribute
- * - Status::Success: if the attribute was found and successfully written
+ * This function also does NOT check that the input dataType matches the expected
+ * data type (as Accessors.h/cpp have this correct by default).
+ * TODO: this not checking seems off - what if this is run without Accessors.h ?
*/
-chip::Protocols::InteractionModel::Status emAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
- chip::AttributeId attributeID, uint8_t * data,
- EmberAfAttributeType dataType, bool overrideReadOnlyAndDataType);
+chip::Protocols::InteractionModel::Status emberAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
+ chip::AttributeId attributeID, uint8_t * dataPtr,
+ EmberAfAttributeType dataType);
+
+/**
+ * @brief Read the attribute value, performing all the checks.
+ *
+ * This function will attempt to read the attribute and store it into the
+ * pointer.
+ *
+ * dataPtr may be NULL, signifying that we don't need the value, just the status
+ * (i.e. whether the attribute can be read).
+ */
+chip::Protocols::InteractionModel::Status emberAfReadAttribute(chip::EndpointId endpoint, chip::ClusterId cluster,
+ chip::AttributeId attributeID, uint8_t * dataPtr,
+ uint16_t readLength);
diff --git a/src/app/util/ember-compatibility-functions.cpp b/src/app/util/ember-compatibility-functions.cpp
index 81bf518..16db0ba 100644
--- a/src/app/util/ember-compatibility-functions.cpp
+++ b/src/app/util/ember-compatibility-functions.cpp
@@ -25,10 +25,11 @@
#include <app/RequiredPrivilege.h>
#include <app/reporting/Engine.h>
#include <app/reporting/reporting.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
+#include <app/util/attribute-storage-detail.h>
#include <app/util/attribute-storage-null-handling.h>
#include <app/util/attribute-storage.h>
+#include <app/util/attribute-table-detail.h>
#include <app/util/attribute-table.h>
#include <app/util/config.h>
#include <app/util/odd-sized-integers.h>
diff --git a/src/app/util/endpoint-config-api.h b/src/app/util/endpoint-config-api.h
index 2028c9f..182e4a6 100644
--- a/src/app/util/endpoint-config-api.h
+++ b/src/app/util/endpoint-config-api.h
@@ -30,7 +30,7 @@
*
* Typically only used for endpoint index iteration.
*/
-uint16_t emberAfEndpointCount(void);
+uint16_t emberAfEndpointCount();
/**
* @brief Enable/disable endpoints
diff --git a/src/app/util/mock/MockNodeConfig.cpp b/src/app/util/mock/MockNodeConfig.cpp
index 3b9fa24..b4f6b1d 100644
--- a/src/app/util/mock/MockNodeConfig.cpp
+++ b/src/app/util/mock/MockNodeConfig.cpp
@@ -18,8 +18,8 @@
#include <app/util/mock/MockNodeConfig.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
+#include <app/util/attribute-storage.h>
#include <lib/support/CodeUtils.h>
#include <utility>
diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp
index cf36ddc..d308316 100644
--- a/src/app/util/mock/attribute-storage.cpp
+++ b/src/app/util/mock/attribute-storage.cpp
@@ -33,8 +33,9 @@
#include <app/MessageDef/AttributeDataIB.h>
#include <app/MessageDef/AttributeReportIB.h>
#include <app/MessageDef/AttributeStatusIB.h>
-#include <app/util/af.h>
#include <app/util/att-storage.h>
+#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <app/util/mock/Constants.h>
#include <app/util/mock/MockNodeConfig.h>
@@ -265,10 +266,17 @@
return nullptr;
}
-EnabledEndpointsWithServerCluster::EnabledEndpointsWithServerCluster(ClusterId clusterId) : mClusterId(clusterId)
+EndpointId EnabledEndpointsWithServerCluster::operator*() const
+{
+ return emberAfEndpointFromIndex(mEndpointIndex);
+}
+
+EnabledEndpointsWithServerCluster::EnabledEndpointsWithServerCluster(ClusterId clusterId) :
+ mEndpointCount(emberAfEndpointCount()), mClusterId(clusterId)
{
EnsureMatchingEndpoint();
}
+
EnabledEndpointsWithServerCluster & EnabledEndpointsWithServerCluster::operator++()
{
++mEndpointIndex;
diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp
index c1b55ab..b485e7c 100644
--- a/src/app/util/util.cpp
+++ b/src/app/util/util.cpp
@@ -20,7 +20,7 @@
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/ids/Clusters.h>
-#include <app/util/af.h>
+#include <app/util/attribute-storage-detail.h>
#include <app/util/attribute-storage.h>
#include <app/util/config.h>
#include <app/util/ember-strings.h>
diff --git a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt
index 2dd92f0..c2dfed7 100644
--- a/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt
+++ b/src/app/zap-templates/templates/app/attributes/Accessors-src.zapt
@@ -10,8 +10,8 @@
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage-null-handling.h>
+#include <app/util/attribute-table.h>
#include <app/util/odd-sized-integers.h>
#include <lib/core/CHIPEncoding.h>
diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp
index fa65b96..baf3cae 100644
--- a/src/controller/CHIPDeviceController.cpp
+++ b/src/controller/CHIPDeviceController.cpp
@@ -70,6 +70,7 @@
#include <memory>
#include <stdint.h>
#include <stdlib.h>
+#include <string>
#include <time.h>
using namespace chip::Inet;
diff --git a/src/controller/ExamplePersistentStorage.cpp b/src/controller/ExamplePersistentStorage.cpp
index 90c8442..0544699 100644
--- a/src/controller/ExamplePersistentStorage.cpp
+++ b/src/controller/ExamplePersistentStorage.cpp
@@ -21,7 +21,9 @@
#include <lib/support/IniEscaping.h>
#include <fstream>
+#include <map>
#include <memory>
+#include <string>
using String = std::basic_string<char>;
using Section = std::map<String, String>;
diff --git a/src/controller/java/AndroidCallbacks.cpp b/src/controller/java/AndroidCallbacks.cpp
index fc9fbe0..8e0f5e9 100644
--- a/src/controller/java/AndroidCallbacks.cpp
+++ b/src/controller/java/AndroidCallbacks.cpp
@@ -31,6 +31,7 @@
#include <lib/support/jsontlv/TlvToJson.h>
#include <lib/support/logging/CHIPLogging.h>
#include <platform/PlatformManager.h>
+#include <string>
#include <type_traits>
namespace chip {
diff --git a/src/controller/java/AndroidCommissioningWindowOpener.cpp b/src/controller/java/AndroidCommissioningWindowOpener.cpp
index 581b810..ff0d731 100644
--- a/src/controller/java/AndroidCommissioningWindowOpener.cpp
+++ b/src/controller/java/AndroidCommissioningWindowOpener.cpp
@@ -26,6 +26,8 @@
#include <setup_payload/ManualSetupPayloadGenerator.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
+#include <string>
+
using namespace chip::app::Clusters;
using namespace chip::System::Clock;
diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp
index e0e709e..c5b3863 100644
--- a/src/controller/java/AndroidDeviceControllerWrapper.cpp
+++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp
@@ -20,6 +20,7 @@
#include <algorithm>
#include <memory>
+#include <string>
#include <vector>
#include <string.h>
diff --git a/src/controller/java/AndroidInteractionClient.cpp b/src/controller/java/AndroidInteractionClient.cpp
index ec80957..a62e0c8 100644
--- a/src/controller/java/AndroidInteractionClient.cpp
+++ b/src/controller/java/AndroidInteractionClient.cpp
@@ -28,6 +28,8 @@
#include <lib/support/jsontlv/JsonToTlv.h>
+#include <string>
+
using namespace chip;
using namespace chip::Controller;
diff --git a/src/controller/java/OTAProviderDelegateBridge.cpp b/src/controller/java/OTAProviderDelegateBridge.cpp
index 10f9ae1..4565d42 100644
--- a/src/controller/java/OTAProviderDelegateBridge.cpp
+++ b/src/controller/java/OTAProviderDelegateBridge.cpp
@@ -23,6 +23,8 @@
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>
+#include <string>
+
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;
diff --git a/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp b/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp
index 9908c53..c1df812 100644
--- a/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp
+++ b/src/controller/python/ChipDeviceController-ScriptDevicePairingDelegate.cpp
@@ -23,6 +23,8 @@
#include <setup_payload/ManualSetupPayloadGenerator.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
+#include <string>
+
namespace chip {
namespace Controller {
diff --git a/src/controller/tests/TestReadChunking.cpp b/src/controller/tests/TestReadChunking.cpp
index ecc53c9..1a1f9c7 100644
--- a/src/controller/tests/TestReadChunking.cpp
+++ b/src/controller/tests/TestReadChunking.cpp
@@ -31,6 +31,7 @@
#include <app/tests/AppTestContext.h>
#include <app/util/DataModelHandler.h>
#include <app/util/attribute-storage.h>
+#include <app/util/endpoint-config-api.h>
#include <controller/InvokeInteraction.h>
#include <functional>
#include <lib/core/ErrorStr.h>
diff --git a/src/crypto/tests/TestPersistentStorageOpKeyStore.cpp b/src/crypto/tests/TestPersistentStorageOpKeyStore.cpp
index 1efbfbd..c3dd0fc 100644
--- a/src/crypto/tests/TestPersistentStorageOpKeyStore.cpp
+++ b/src/crypto/tests/TestPersistentStorageOpKeyStore.cpp
@@ -28,6 +28,8 @@
#include <lib/support/UnitTestRegistration.h>
#include <nlunit-test.h>
+#include <string>
+
using namespace chip;
using namespace chip::Crypto;
diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm
index 789449c..b47fb4b 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceController.mm
+++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm
@@ -78,6 +78,7 @@
#include <atomic>
#include <dns_sd.h>
+#include <string>
#import <os/lock.h>
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
index 53500ca..ccdb1ca 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
@@ -54,7 +54,6 @@
#import <os/lock.h>
#include <app/server/Dnssd.h>
-#include <app/util/af.h>
#include <controller/CHIPDeviceControllerFactory.h>
#include <credentials/CHIPCert.h>
#include <credentials/FabricTable.h>
diff --git a/src/darwin/Framework/CHIP/MTRManualSetupPayloadParser.mm b/src/darwin/Framework/CHIP/MTRManualSetupPayloadParser.mm
index 3a0435d..2f909fd 100644
--- a/src/darwin/Framework/CHIP/MTRManualSetupPayloadParser.mm
+++ b/src/darwin/Framework/CHIP/MTRManualSetupPayloadParser.mm
@@ -24,6 +24,8 @@
#import <setup_payload/ManualSetupPayloadParser.h>
#import <setup_payload/SetupPayload.h>
+#include <string>
+
@implementation MTRManualSetupPayloadParser {
NSString * _decimalStringRepresentation;
chip::ManualSetupPayloadParser * _chipManualSetupPayloadParser;
diff --git a/src/darwin/Framework/CHIP/MTRQRCodeSetupPayloadParser.mm b/src/darwin/Framework/CHIP/MTRQRCodeSetupPayloadParser.mm
index bbb8042..53b8e73 100644
--- a/src/darwin/Framework/CHIP/MTRQRCodeSetupPayloadParser.mm
+++ b/src/darwin/Framework/CHIP/MTRQRCodeSetupPayloadParser.mm
@@ -24,6 +24,8 @@
#import <setup_payload/QRCodeSetupPayloadParser.h>
#import <setup_payload/SetupPayload.h>
+#include <string>
+
@implementation MTRQRCodeSetupPayloadParser {
NSString * _base38Representation;
chip::QRCodeSetupPayloadParser * _chipQRCodeSetupPayloadParser;
diff --git a/src/darwin/Framework/CHIP/MTRSetupPayload.mm b/src/darwin/Framework/CHIP/MTRSetupPayload.mm
index 42bd7ba..309494e 100644
--- a/src/darwin/Framework/CHIP/MTRSetupPayload.mm
+++ b/src/darwin/Framework/CHIP/MTRSetupPayload.mm
@@ -24,6 +24,8 @@
#import "setup_payload/QRCodeSetupPayloadGenerator.h"
#import <setup_payload/SetupPayload.h>
+#include <string>
+
@implementation MTROptionalQRCodeInfo
@end
diff --git a/src/lib/support/jsontlv/TextFormat.cpp b/src/lib/support/jsontlv/TextFormat.cpp
index c607df7..0485563 100644
--- a/src/lib/support/jsontlv/TextFormat.cpp
+++ b/src/lib/support/jsontlv/TextFormat.cpp
@@ -16,6 +16,8 @@
* limitations under the License.
*/
+#include "TextFormat.h"
+
#include <algorithm>
#include <json/json.h>
diff --git a/src/lib/support/tests/TestIniEscaping.cpp b/src/lib/support/tests/TestIniEscaping.cpp
index 784a8ff..734ddf8 100644
--- a/src/lib/support/tests/TestIniEscaping.cpp
+++ b/src/lib/support/tests/TestIniEscaping.cpp
@@ -20,6 +20,8 @@
#include <lib/support/UnitTestRegistration.h>
#include <nlunit-test.h>
+#include <string>
+
using namespace chip;
using namespace chip::IniEscaping;
diff --git a/src/lib/support/tests/TestJsonToTlv.cpp b/src/lib/support/tests/TestJsonToTlv.cpp
index 3649764..a531447 100644
--- a/src/lib/support/tests/TestJsonToTlv.cpp
+++ b/src/lib/support/tests/TestJsonToTlv.cpp
@@ -26,6 +26,8 @@
#include <lib/support/jsontlv/TlvToJson.h>
#include <nlunit-test.h>
+#include <string>
+
namespace {
using namespace chip::Encoding;
diff --git a/src/lib/support/tests/TestJsonToTlvToJson.cpp b/src/lib/support/tests/TestJsonToTlvToJson.cpp
index b4f0a13..2ac6467 100644
--- a/src/lib/support/tests/TestJsonToTlvToJson.cpp
+++ b/src/lib/support/tests/TestJsonToTlvToJson.cpp
@@ -26,6 +26,8 @@
#include <lib/support/jsontlv/TlvToJson.h>
#include <nlunit-test.h>
+#include <string>
+
namespace {
using namespace chip::Encoding;
diff --git a/src/lib/support/tests/TestTlvToJson.cpp b/src/lib/support/tests/TestTlvToJson.cpp
index be25ef1..1467744 100644
--- a/src/lib/support/tests/TestTlvToJson.cpp
+++ b/src/lib/support/tests/TestTlvToJson.cpp
@@ -25,6 +25,8 @@
#include <system/SystemPacketBuffer.h>
#include <system/TLVPacketBufferBackingStore.h>
+#include <string>
+
namespace {
using namespace chip::Encoding;
diff --git a/src/platform/Darwin/DnssdContexts.cpp b/src/platform/Darwin/DnssdContexts.cpp
index 66dc4c1..dfdcaa5 100644
--- a/src/platform/Darwin/DnssdContexts.cpp
+++ b/src/platform/Darwin/DnssdContexts.cpp
@@ -23,6 +23,8 @@
#include <net/if.h>
+#include <string>
+
using namespace chip::Dnssd;
using namespace chip::Dnssd::Internal;
diff --git a/src/platform/Darwin/DnssdImpl.cpp b/src/platform/Darwin/DnssdImpl.cpp
index a6b1fd9..13f369b 100644
--- a/src/platform/Darwin/DnssdImpl.cpp
+++ b/src/platform/Darwin/DnssdImpl.cpp
@@ -25,6 +25,8 @@
#include <lib/support/SafeInt.h>
#include <lib/support/logging/CHIPLogging.h>
+#include <string>
+
using namespace chip::Dnssd;
using namespace chip::Dnssd::Internal;
diff --git a/src/platform/Darwin/DnssdType.cpp b/src/platform/Darwin/DnssdType.cpp
index 4b810a6..919a9b3 100644
--- a/src/platform/Darwin/DnssdType.cpp
+++ b/src/platform/Darwin/DnssdType.cpp
@@ -18,6 +18,7 @@
#include "DnssdType.h"
#include <sstream>
+#include <string>
constexpr char kProtocolTcp[] = "._tcp";
constexpr char kProtocolUdp[] = "._udp";
diff --git a/src/platform/Darwin/DnssdType.h b/src/platform/Darwin/DnssdType.h
index c5904be..50154cb 100644
--- a/src/platform/Darwin/DnssdType.h
+++ b/src/platform/Darwin/DnssdType.h
@@ -19,6 +19,7 @@
#include <lib/dnssd/platform/Dnssd.h>
#include <string.h>
+#include <string>
namespace chip {
namespace Dnssd {
diff --git a/src/platform/Linux/CHIPLinuxStorage.h b/src/platform/Linux/CHIPLinuxStorage.h
index e83a417..448459d 100644
--- a/src/platform/Linux/CHIPLinuxStorage.h
+++ b/src/platform/Linux/CHIPLinuxStorage.h
@@ -35,6 +35,7 @@
#include <mutex>
#include <platform/Linux/CHIPLinuxStorageIni.h>
+#include <string>
#ifndef FATCONFDIR
#define FATCONFDIR "/tmp"
diff --git a/src/platform/Linux/CHIPLinuxStorageIni.h b/src/platform/Linux/CHIPLinuxStorageIni.h
index 1c6e564..8c308f1 100644
--- a/src/platform/Linux/CHIPLinuxStorageIni.h
+++ b/src/platform/Linux/CHIPLinuxStorageIni.h
@@ -29,6 +29,9 @@
#include <lib/support/ScopedBuffer.h>
#include <platform/PersistedStorage.h>
+#include <map>
+#include <string>
+
namespace chip {
namespace DeviceLayer {
namespace Internal {
diff --git a/src/platform/Linux/DnssdImpl.cpp b/src/platform/Linux/DnssdImpl.cpp
index 2a18730..800064f 100644
--- a/src/platform/Linux/DnssdImpl.cpp
+++ b/src/platform/Linux/DnssdImpl.cpp
@@ -20,6 +20,7 @@
#include <algorithm>
#include <sstream>
#include <string.h>
+#include <string>
#include <time.h>
#include <vector>
diff --git a/src/platform/Linux/bluez/BluezObjectManager.cpp b/src/platform/Linux/bluez/BluezObjectManager.cpp
index 1025dda..91a2ffb 100644
--- a/src/platform/Linux/bluez/BluezObjectManager.cpp
+++ b/src/platform/Linux/bluez/BluezObjectManager.cpp
@@ -19,6 +19,7 @@
#include <algorithm>
#include <memory>
+#include <string>
#include <string_view>
#include <gio/gio.h>
diff --git a/src/platform/mt793x/DnssdContexts.cpp b/src/platform/mt793x/DnssdContexts.cpp
index f8af3b4..c554c01 100644
--- a/src/platform/mt793x/DnssdContexts.cpp
+++ b/src/platform/mt793x/DnssdContexts.cpp
@@ -26,6 +26,8 @@
#include <lwip/ip6_addr.h>
#include <platform/CHIPDeviceLayer.h>
+#include <string>
+
using namespace chip::Dnssd;
namespace {
diff --git a/src/platform/mt793x/DnssdImpl.cpp b/src/platform/mt793x/DnssdImpl.cpp
index f850076..1baf026 100644
--- a/src/platform/mt793x/DnssdImpl.cpp
+++ b/src/platform/mt793x/DnssdImpl.cpp
@@ -33,6 +33,7 @@
#include <cstdio>
#include <sstream>
#include <string.h>
+#include <string>
#include "mDNSDebug.h"
#include "task.h"
diff --git a/src/platform/nxp/mw320/ConnectivityManagerImpl.cpp b/src/platform/nxp/mw320/ConnectivityManagerImpl.cpp
index 802fe27..93f1b18 100644
--- a/src/platform/nxp/mw320/ConnectivityManagerImpl.cpp
+++ b/src/platform/nxp/mw320/ConnectivityManagerImpl.cpp
@@ -20,6 +20,7 @@
#include <iomanip>
#include <platform/internal/CHIPDeviceLayerInternal.h>
#include <sstream>
+#include <string>
#include <lib/support/CodeUtils.h>
#include <lib/support/logging/CHIPLogging.h>
diff --git a/src/platform/nxp/mw320/ConnectivityManagerImpl.h b/src/platform/nxp/mw320/ConnectivityManagerImpl.h
index 364590f..e5e9ef2 100644
--- a/src/platform/nxp/mw320/ConnectivityManagerImpl.h
+++ b/src/platform/nxp/mw320/ConnectivityManagerImpl.h
@@ -42,6 +42,8 @@
#include <platform/NetworkCommissioning.h>
#include <platform/nxp/mw320/NetworkCommissioningDriver.h>
+#include <string>
+
namespace chip {
namespace DeviceLayer {
diff --git a/src/platform/webos/BLEManagerImpl.cpp b/src/platform/webos/BLEManagerImpl.cpp
index 0e81ff3..670c86e 100644
--- a/src/platform/webos/BLEManagerImpl.cpp
+++ b/src/platform/webos/BLEManagerImpl.cpp
@@ -32,6 +32,7 @@
#include <cassert>
#include <iomanip>
+#include <string>
#include <type_traits>
#include <utility>
diff --git a/src/platform/webos/BLEManagerImpl.h b/src/platform/webos/BLEManagerImpl.h
index 4780bbe..cc3f7c3 100644
--- a/src/platform/webos/BLEManagerImpl.h
+++ b/src/platform/webos/BLEManagerImpl.h
@@ -31,6 +31,8 @@
#include "ChipDeviceScanner.h"
#include <luna-service2/lunaservice.h>
+#include <string>
+
namespace chip {
namespace DeviceLayer {
namespace Internal {
diff --git a/src/platform/webos/CHIPWebOSStorage.h b/src/platform/webos/CHIPWebOSStorage.h
index 5afd70d..6b89673 100644
--- a/src/platform/webos/CHIPWebOSStorage.h
+++ b/src/platform/webos/CHIPWebOSStorage.h
@@ -35,6 +35,7 @@
#include <mutex>
#include <platform/webos/CHIPWebOSStorageIni.h>
+#include <string>
#ifndef FATCONFDIR
#define FATCONFDIR "/tmp"
diff --git a/src/platform/webos/CHIPWebOSStorageIni.h b/src/platform/webos/CHIPWebOSStorageIni.h
index a0ef584..eeb7ada 100644
--- a/src/platform/webos/CHIPWebOSStorageIni.h
+++ b/src/platform/webos/CHIPWebOSStorageIni.h
@@ -29,6 +29,8 @@
#include <lib/support/ScopedBuffer.h>
#include <platform/PersistedStorage.h>
+#include <string>
+
namespace chip {
namespace DeviceLayer {
namespace Internal {
diff --git a/src/platform/webos/ChipDeviceScanner.cpp b/src/platform/webos/ChipDeviceScanner.cpp
index c79112b..5a31228 100644
--- a/src/platform/webos/ChipDeviceScanner.cpp
+++ b/src/platform/webos/ChipDeviceScanner.cpp
@@ -27,6 +27,8 @@
#include <pbnjson.h>
+#include <string>
+
namespace chip {
namespace DeviceLayer {
namespace Internal {
diff --git a/src/platform/webos/ChipDeviceScanner.h b/src/platform/webos/ChipDeviceScanner.h
index aab6e5d..ac23c7b 100644
--- a/src/platform/webos/ChipDeviceScanner.h
+++ b/src/platform/webos/ChipDeviceScanner.h
@@ -23,6 +23,7 @@
#include <glib.h>
#include <memory>
+#include <string>
#include <ble/CHIPBleServiceData.h>
#include <lib/core/CHIPError.h>
diff --git a/src/platform/webos/DnssdImpl.cpp b/src/platform/webos/DnssdImpl.cpp
index bf1af98..618e522 100644
--- a/src/platform/webos/DnssdImpl.cpp
+++ b/src/platform/webos/DnssdImpl.cpp
@@ -20,6 +20,7 @@
#include <algorithm>
#include <sstream>
#include <string.h>
+#include <string>
#include <time.h>
#include <vector>
diff --git a/src/qrcodetool/setup_payload_commands.cpp b/src/qrcodetool/setup_payload_commands.cpp
index a401058..f2c96eb 100644
--- a/src/qrcodetool/setup_payload_commands.cpp
+++ b/src/qrcodetool/setup_payload_commands.cpp
@@ -22,6 +22,8 @@
#include <stdio.h>
#include <unistd.h>
+#include <string>
+
using namespace chip;
enum class SetupPayloadCodeType
diff --git a/src/setup_payload/AdditionalDataPayloadParser.cpp b/src/setup_payload/AdditionalDataPayloadParser.cpp
index eb6b48f..3fa307d 100644
--- a/src/setup_payload/AdditionalDataPayloadParser.cpp
+++ b/src/setup_payload/AdditionalDataPayloadParser.cpp
@@ -25,6 +25,7 @@
#include <cstdlib>
#include <string.h>
+#include <string>
#include <vector>
#include <lib/core/CHIPError.h>
diff --git a/src/setup_payload/ManualSetupPayloadGenerator.cpp b/src/setup_payload/ManualSetupPayloadGenerator.cpp
index b565907..72063c5 100644
--- a/src/setup_payload/ManualSetupPayloadGenerator.cpp
+++ b/src/setup_payload/ManualSetupPayloadGenerator.cpp
@@ -24,7 +24,6 @@
#include "ManualSetupPayloadGenerator.h"
#include <inttypes.h>
-#include <limits>
#include <lib/support/logging/CHIPLogging.h>
#include <lib/support/verhoeff/Verhoeff.h>
diff --git a/src/setup_payload/ManualSetupPayloadParser.cpp b/src/setup_payload/ManualSetupPayloadParser.cpp
index 3b20e24..2673e42 100644
--- a/src/setup_payload/ManualSetupPayloadParser.cpp
+++ b/src/setup_payload/ManualSetupPayloadParser.cpp
@@ -27,9 +27,6 @@
#include <lib/support/logging/CHIPLogging.h>
#include <lib/support/verhoeff/Verhoeff.h>
-#include <string>
-#include <vector>
-
namespace chip {
CHIP_ERROR ManualSetupPayloadParser::CheckDecimalStringValidity(std::string decimalString,
diff --git a/src/setup_payload/QRCodeSetupPayloadGenerator.cpp b/src/setup_payload/QRCodeSetupPayloadGenerator.cpp
index 42a5374..6ffa231 100644
--- a/src/setup_payload/QRCodeSetupPayloadGenerator.cpp
+++ b/src/setup_payload/QRCodeSetupPayloadGenerator.cpp
@@ -37,6 +37,7 @@
#include <stdlib.h>
#include <string.h>
+#include <string>
namespace chip {
diff --git a/src/setup_payload/QRCodeSetupPayloadGenerator.h b/src/setup_payload/QRCodeSetupPayloadGenerator.h
index d4a151a..aefa1ee 100644
--- a/src/setup_payload/QRCodeSetupPayloadGenerator.h
+++ b/src/setup_payload/QRCodeSetupPayloadGenerator.h
@@ -31,6 +31,8 @@
#include <lib/support/Span.h>
+#include <string>
+
#pragma once
namespace chip {
diff --git a/src/setup_payload/QRCodeSetupPayloadParser.cpp b/src/setup_payload/QRCodeSetupPayloadParser.cpp
index 93e560a..99bf0e4 100644
--- a/src/setup_payload/QRCodeSetupPayloadParser.cpp
+++ b/src/setup_payload/QRCodeSetupPayloadParser.cpp
@@ -24,7 +24,6 @@
#include "QRCodeSetupPayloadParser.h"
#include "Base38Decode.h"
-#include <memory>
#include <string.h>
#include <vector>
diff --git a/src/setup_payload/tests/TestHelpers.h b/src/setup_payload/tests/TestHelpers.h
index 1701738..99b66de 100644
--- a/src/setup_payload/tests/TestHelpers.h
+++ b/src/setup_payload/tests/TestHelpers.h
@@ -25,6 +25,8 @@
#include <setup_payload/QRCodeSetupPayloadParser.h>
#include <setup_payload/SetupPayload.h>
+#include <string>
+
namespace chip {
const uint16_t kSmallBufferSizeInBytes = 1;
diff --git a/src/tracing/json/json_tracing.h b/src/tracing/json/json_tracing.h
index 14f3d16..ddbb46a 100644
--- a/src/tracing/json/json_tracing.h
+++ b/src/tracing/json/json_tracing.h
@@ -18,6 +18,7 @@
#pragma once
#include <fstream>
+#include <string>
#include <tracing/backend.h>
#include <unordered_map>
diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
index a3e74424..539b26e 100644
--- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
+++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp
@@ -27,8 +27,8 @@
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
-#include <app/util/af.h>
#include <app/util/attribute-storage-null-handling.h>
+#include <app/util/attribute-table.h>
#include <app/util/odd-sized-integers.h>
#include <lib/core/CHIPEncoding.h>