Skip to content

Commit 660c928

Browse files
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>
1 parent 4cfde10 commit 660c928

File tree

382 files changed

+876
-613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

382 files changed

+876
-613
lines changed

.github/workflows/lint.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ jobs:
101101
--known-failure app/reporting/tests/MockReportScheduler.cpp \
102102
--known-failure app/reporting/tests/MockReportScheduler.h \
103103
--known-failure app/TestEventTriggerDelegate.h \
104-
--known-failure app/util/af.h \
105104
--known-failure app/util/attribute-storage.cpp \
106105
--known-failure app/util/attribute-storage.h \
106+
--known-failure app/util/attribute-storage-detail.h \
107107
--known-failure app/util/attribute-table.cpp \
108108
--known-failure app/util/attribute-table.h \
109+
--known-failure app/util/attribute-table-detail.h \
109110
--known-failure app/util/binding-table.cpp \
110111
--known-failure app/util/binding-table.h \
111112
--known-failure app/util/config.h \
@@ -253,7 +254,7 @@ jobs:
253254
- name: Check for use of 'emberAfReadAttribute' instead of the type-safe getters
254255
if: always()
255256
run: |
256-
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
257+
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
257258
258259
# git grep exits with 0 if it finds a match, but we want
259260
# to fail (exit nonzero) on match. And we want to exclude this file,
@@ -263,7 +264,7 @@ jobs:
263264
- name: Check for use of 'emberAfWriteAttribute' instead of the type-safe setters
264265
if: always()
265266
run: |
266-
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
267+
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
267268
268269
# Run ruff python linter
269270
- name: Check for errors using ruff Python linter

examples/air-purifier-app/ameba/main/DeviceCallbacks.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <app-common/zap-generated/ids/Clusters.h>
3030
#include <app/CommandHandler.h>
3131
#include <app/server/Dnssd.h>
32-
#include <app/util/af.h>
3332
#include <app/util/basic-types.h>
3433
#include <app/util/util.h>
3534
#include <lib/dnssd/Advertiser.h>

examples/air-purifier-app/ameba/main/chipinterface.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include <app/clusters/identify-server/identify-server.h>
3131
#include <app/clusters/network-commissioning/network-commissioning.h>
3232
#include <app/server/OnboardingCodesUtil.h>
33-
#include <app/util/af.h>
33+
#include <app/util/endpoint-config-api.h>
3434
#include <lib/core/ErrorStr.h>
3535
#include <platform/Ameba/AmebaConfig.h>
3636
#include <platform/Ameba/NetworkCommissioningDriver.h>

examples/air-purifier-app/linux/main.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <app-common/zap-generated/ids/Attributes.h>
2121
#include <app-common/zap-generated/ids/Clusters.h>
2222
#include <app/ConcreteAttributePath.h>
23-
#include <app/util/af.h>
2423
#include <lib/support/logging/CHIPLogging.h>
2524

2625
#define AIR_PURIFIER_ENDPOINT 1

examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include <limits>
3232
#include <map>
33+
#include <string>
3334

3435
using namespace chip;
3536
using namespace chip::app;

examples/air-quality-sensor-app/linux/AirQualitySensorAppAttrUpdateDelegate.h

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <json/json.h>
2424
#include <platform/DiagnosticDataProvider.h>
2525

26+
#include <string>
27+
2628
class AirQualitySensorAttrUpdateHandler
2729
{
2830
public:

examples/air-quality-sensor-app/linux/main.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
#include <AppMain.h>
2121
#include <air-quality-sensor-manager.h>
2222

23-
#include <app/util/af.h>
2423
#include <platform/CHIPDeviceConfig.h>
2524

25+
#include <string>
26+
2627
#if defined(CHIP_IMGUI_ENABLED) && CHIP_IMGUI_ENABLED
2728
#include <imgui_ui/ui.h>
2829
#include <imgui_ui/windows/qrcode.h>

examples/all-clusters-app/all-clusters-common/include/dishwasher-mode.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <app/clusters/mode-base-server/mode-base-server.h>
22-
#include <app/util/af.h>
2322
#include <app/util/config.h>
2423
#include <cstring>
2524
#include <utility>

examples/all-clusters-app/all-clusters-common/include/laundry-dryer-controls-delegate-impl.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include <app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-delegate.h>
2222
#include <app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h>
23-
#include <app/util/af.h>
2423
#include <app/util/config.h>
2524
#include <cstring>
2625

examples/all-clusters-app/all-clusters-common/include/laundry-washer-controls-delegate-impl.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include <app/clusters/laundry-washer-controls-server/laundry-washer-controls-delegate.h>
2222
#include <app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h>
23-
#include <app/util/af.h>
2423
#include <app/util/config.h>
2524
#include <cstring>
2625

examples/all-clusters-app/all-clusters-common/include/laundry-washer-mode.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <app/clusters/mode-base-server/mode-base-server.h>
22-
#include <app/util/af.h>
2322
#include <app/util/config.h>
2423
#include <cstring>
2524
#include <utility>

examples/all-clusters-app/all-clusters-common/include/microwave-oven-mode.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <app/clusters/mode-base-server/mode-base-server.h>
22-
#include <app/util/af.h>
2322
#include <app/util/config.h>
2423
#include <cstring>
2524
#include <utility>

examples/all-clusters-app/all-clusters-common/include/oven-modes.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <app/clusters/mode-base-server/mode-base-server.h>
22-
#include <app/util/af.h>
2322
#include <app/util/config.h>
2423
#include <cstring>
2524
#include <utility>

examples/all-clusters-app/all-clusters-common/include/rvc-modes.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <app/clusters/mode-base-server/mode-base-server.h>
22-
#include <app/util/af.h>
2322
#include <app/util/config.h>
2423
#include <cstring>
2524
#include <utility>

examples/all-clusters-app/all-clusters-common/include/static-supported-modes-manager.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <app/clusters/mode-select-server/supported-modes-manager.h>
22-
#include <app/util/af.h>
2322
#include <app/util/config.h>
2423
#include <cstring>
2524

examples/all-clusters-app/all-clusters-common/include/static-supported-temperature-levels.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <app/clusters/temperature-control-server/supported-temperature-levels-manager.h>
22-
#include <app/util/af.h>
2322
#include <app/util/config.h>
2423

2524
namespace chip {

examples/all-clusters-app/all-clusters-common/include/tcc-mode.h

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <app/clusters/mode-base-server/mode-base-server.h>
22-
#include <app/util/af.h>
2322
#include <app/util/config.h>
2423
#include <cstring>
2524
#include <utility>

examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <app-common/zap-generated/ids/Clusters.h>
3030
#include <app/CommandHandler.h>
3131
#include <app/server/Dnssd.h>
32-
#include <app/util/af.h>
3332
#include <app/util/basic-types.h>
3433
#include <app/util/util.h>
3534
#include <lib/dnssd/Advertiser.h>

examples/all-clusters-app/ameba/main/chipinterface.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include <app/clusters/network-commissioning/network-commissioning.h>
3535
#include <app/server/OnboardingCodesUtil.h>
3636
#include <app/server/Server.h>
37-
#include <app/util/af.h>
37+
#include <app/util/endpoint-config-api.h>
3838
#include <laundry-dryer-controls-delegate-impl.h>
3939
#include <laundry-washer-controls-delegate-impl.h>
4040
#include <lib/core/ErrorStr.h>

examples/all-clusters-app/asr/src/AppTask.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <app/server/OnboardingCodesUtil.h>
3535
#include <app/server/Server.h>
3636
#include <app/util/attribute-storage.h>
37+
#include <app/util/endpoint-config-api.h>
3738
#include <assert.h>
3839
#include <lega_rtos_api.h>
3940
#include <platform/ASR/NetworkCommissioningDriver.h>

examples/all-clusters-app/asr/src/DeviceCallbacks.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <app-common/zap-generated/ids/Clusters.h>
3131
#include <app/CommandHandler.h>
3232
#include <app/server/Dnssd.h>
33-
#include <app/util/af.h>
3433
#include <app/util/basic-types.h>
3534
#include <app/util/util.h>
3635
#include <lib/dnssd/Advertiser.h>

examples/all-clusters-app/cc13x2x7_26x2x7/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
#include "AppConfig.h"
2222
#include "AppEvent.h"
2323
#include <app/server/Server.h>
24-
#include <app/util/af.h>
2524

2625
#include "FreeRTOS.h"
2726
#include "Globals.h"
27+
#include <app/util/endpoint-config-api.h>
2828
#include <credentials/DeviceAttestationCredsProvider.h>
2929
#include <credentials/examples/DeviceAttestationCredsExample.h>
3030

examples/all-clusters-app/cc13x2x7_26x2x7/main/ZclCallbacks.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <app-common/zap-generated/ids/Clusters.h>
3232
#include <app/CommandHandler.h>
3333
#include <app/util/af-types.h>
34-
#include <app/util/af.h>
3534
#include <app/util/basic-types.h>
3635

3736
using namespace ::chip;

examples/all-clusters-app/cc13x4_26x4/main/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
#include "AppConfig.h"
2121
#include "AppEvent.h"
2222
#include <app/server/Server.h>
23-
#include <app/util/af.h>
2423

2524
#include "FreeRTOS.h"
2625
#include "Globals.h"
26+
#include <app/util/endpoint-config-api.h>
2727
#include <credentials/DeviceAttestationCredsProvider.h>
2828
#include <examples/platform/cc13x4_26x4/CC13X4_26X4DeviceAttestationCreds.h>
2929

examples/all-clusters-app/cc13x4_26x4/main/ZclCallbacks.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <app-common/zap-generated/ids/Clusters.h>
3131
#include <app/CommandHandler.h>
3232
#include <app/util/af-types.h>
33-
#include <app/util/af.h>
3433
#include <app/util/basic-types.h>
3534

3635
using namespace ::chip;

examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include <app-common/zap-generated/ids/Clusters.h>
2323
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
2424

25+
#include <string>
26+
#include <tuple>
27+
#include <vector>
28+
2529
#if CONFIG_HAVE_DISPLAY
2630
using namespace ::chip;
2731
using namespace ::chip::Credentials;

examples/all-clusters-app/esp32/main/QRCodeScreen.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
#include <platform/CHIPDeviceLayer.h>
4343
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
4444

45+
#include <string>
46+
4547
// TODO need sensible library tag when put in library
4648
extern const char TAG[];
4749

examples/all-clusters-app/esp32/main/StatusScreen.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#include <app/server/Server.h>
4646
#include <lib/core/DataModelTypes.h>
4747

48+
#include <string>
49+
4850
#define MAX_LENGTH_SMALL_FONT 30
4951

5052
using namespace chip;

examples/all-clusters-app/esp32/main/include/QRCodeScreen.h

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "ScreenManager.h"
3232

3333
#include <cstdint>
34+
#include <string>
3435
#include <vector>
3536

3637
class QRCodeScreen : public Screen

examples/all-clusters-app/esp32/main/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "platform/PlatformManager.h"
3535
#include "shell_extension/launch.h"
3636
#include <app/server/OnboardingCodesUtil.h>
37-
#include <app/util/af.h>
37+
#include <app/util/endpoint-config-api.h>
3838
#include <binding-handler.h>
3939
#include <common/CHIPDeviceManager.h>
4040
#include <common/Esp32AppServer.h>

examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <app/server/OnboardingCodesUtil.h>
3030
#include <app/server/Server.h>
3131
#include <app/util/attribute-storage.h>
32+
#include <app/util/endpoint-config-api.h>
3233
#include <assert.h>
3334
#include <credentials/DeviceAttestationCredsProvider.h>
3435
#include <credentials/examples/DeviceAttestationCredsExample.h>

examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <app/clusters/switch-server/switch-server.h>
2626
#include <app/server/Server.h>
2727
#include <app/util/att-storage.h>
28+
#include <app/util/attribute-storage.h>
2829
#include <platform/PlatformManager.h>
2930

3031
#include <air-quality-instance.h>
@@ -35,6 +36,8 @@
3536
#include <oven-operational-state-delegate.h>
3637
#include <rvc-modes.h>
3738

39+
#include <string>
40+
3841
using namespace chip;
3942
using namespace chip::app;
4043
using namespace chip::app::Clusters;

examples/all-clusters-app/linux/AllClustersCommandDelegate.h

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <json/json.h>
2424
#include <platform/DiagnosticDataProvider.h>
2525

26+
#include <string>
27+
2628
class AllClustersAppCommandHandler
2729
{
2830
public:

examples/all-clusters-app/linux/AppOptions.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <app/server/CommissioningWindowManager.h>
2222
#include <app/server/Server.h>
2323

24+
#include <string>
25+
2426
using namespace chip::ArgParser;
2527

2628
using chip::ArgParser::OptionDef;

examples/all-clusters-app/linux/AppOptions.h

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include <app/tests/suites/credentials/TestHarnessDACProvider.h>
2424

25+
#include <string>
26+
2527
class AppOptions
2628
{
2729
public:

examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include <lib/support/SafeInt.h>
2222

23+
#include <string>
24+
2325
using namespace chip;
2426
using namespace chip::app::Clusters::DiagnosticLogs;
2527

examples/all-clusters-app/linux/include/diagnostic-logs-provider-delegate-impl.h

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include <fstream>
2424
#include <map>
25+
#include <string>
2526

2627
namespace chip {
2728
namespace app {

examples/all-clusters-app/linux/main-common.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include <app/clusters/time-synchronization-server/time-synchronization-server.h>
4949
#include <app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h>
5050
#include <app/server/Server.h>
51-
#include <app/util/af.h>
5251
#include <app/util/att-storage.h>
5352
#include <app/util/attribute-storage.h>
5453
#include <lib/support/CHIPMem.h>
@@ -61,6 +60,8 @@
6160
#include <transport/SessionManager.h>
6261
#include <transport/raw/PeerAddress.h>
6362

63+
#include <string>
64+
6465
using namespace chip;
6566
using namespace chip::app;
6667
using namespace chip::DeviceLayer;

examples/all-clusters-app/nrfconnect/main/AppTask.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <app/clusters/identify-server/identify-server.h>
3232
#include <app/clusters/ota-requestor/OTATestEventTriggerHandler.h>
3333
#include <app/util/attribute-storage.h>
34+
#include <app/util/endpoint-config-api.h>
3435

3536
#include <credentials/DeviceAttestationCredsProvider.h>
3637
#include <credentials/examples/DeviceAttestationCredsExample.h>

examples/all-clusters-app/nxp/common/main/AppTask.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "ICDUtil.h"
2424
#include <app/InteractionModelEngine.h>
2525
#include <app/util/attribute-storage.h>
26+
#include <app/util/endpoint-config-api.h>
2627

2728
using namespace chip;
2829
using namespace chip::app::Clusters;

examples/all-clusters-app/nxp/common/main/ZclCallbacks.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <app-common/zap-generated/ids/Clusters.h>
2626
#include <app/ConcreteAttributePath.h>
2727
#include <app/util/af-types.h>
28-
#include <app/util/af.h>
2928

3029
using namespace ::chip;
3130

0 commit comments

Comments
 (0)