Skip to content

Commit dd9bb34

Browse files
Rename CLUSTER_MASK_ and ATTIBUTE_MASK defines to differentiate with … (#37618)
* Rename CLUSTER_MASK_ and ATTIBUTE_MASK defines to differentiate with the zigbee ones. Cleanup some scene defines and delete the now empty head att-storage.h * Address comment, replace _BITMAP_ by _FLAG_
1 parent 7c1d6f7 commit dd9bb34

Some content is hidden

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

41 files changed

+131
-194
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
2424
#include <app/clusters/switch-server/switch-server.h>
2525
#include <app/server/Server.h>
26-
#include <app/util/att-storage.h>
2726
#include <platform/PlatformManager.h>
2827

2928
#include <air-quality-sensor-manager.h>

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

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
2727
#include <app/clusters/switch-server/switch-server.h>
2828
#include <app/server/Server.h>
29-
#include <app/util/att-storage.h>
3029
#include <app/util/attribute-storage.h>
3130
#include <platform/PlatformManager.h>
3231

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

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
#include <app/clusters/time-synchronization-server/time-synchronization-server.h>
5454
#include <app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h>
5555
#include <app/server/Server.h>
56-
#include <app/util/att-storage.h>
5756
#include <app/util/attribute-storage.h>
5857
#include <lib/support/CHIPMem.h>
5958
#include <platform/DeviceInstanceInfoProvider.h>

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

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <app/CommandHandler.h>
2222
#include <app/clusters/identify-server/identify-server.h>
2323
#include <app/server/Server.h>
24-
#include <app/util/att-storage.h>
2524
#include <lib/support/CHIPMem.h>
2625
#include <new>
2726
#include <platform/PlatformManager.h>

examples/bridge-app/esp32/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ defined:
5454
definition.
5555

5656
- All attributes defined with these macros will be configured as
57-
`ATTRIBUTE_MASK_EXTERNAL_STORAGE` in the ZCL database and therefore will
58-
rely on the application to maintain storage for the attribute. Consequently,
59-
reads or writes to these attributes must be handled within the application
60-
by the `emberAfExternalAttributeWriteCallback` and
57+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
58+
will rely on the application to maintain storage for the attribute.
59+
Consequently, reads or writes to these attributes must be handled within the
60+
application by the `emberAfExternalAttributeWriteCallback` and
6161
`emberAfExternalAttributeReadCallback` functions. See the bridge
6262
application's `main.cpp` for an example of this implementation.
6363

examples/bridge-app/linux/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ defined:
4545
definition.
4646

4747
- All attributes defined with these macros will be configured as
48-
`ATTRIBUTE_MASK_EXTERNAL_STORAGE` in the ZCL database and therefore will
49-
rely on the application to maintain storage for the attribute. Consequently,
50-
reads or writes to these attributes must be handled within the application
51-
by the `emberAfExternalAttributeWriteCallback` and
48+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
49+
will rely on the application to maintain storage for the attribute.
50+
Consequently, reads or writes to these attributes must be handled within the
51+
application by the `emberAfExternalAttributeWriteCallback` and
5252
`emberAfExternalAttributeReadCallback` functions. See the bridge
5353
application's `main.cpp` for an example of this implementation.
5454

examples/bridge-app/telink/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ defined:
5656
definition.
5757

5858
- All attributes defined with these macros will be configured as
59-
`ATTRIBUTE_MASK_EXTERNAL_STORAGE` in the ZCL database and therefore will
60-
rely on the application to maintain storage for the attribute. Consequently,
61-
reads or writes to these attributes must be handled within the application
62-
by the `emberAfExternalAttributeWriteCallback` and
59+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
60+
will rely on the application to maintain storage for the attribute.
61+
Consequently, reads or writes to these attributes must be handled within the
62+
application by the `emberAfExternalAttributeWriteCallback` and
6363
`emberAfExternalAttributeReadCallback` functions. See the bridge
6464
application's `main.cpp` for an example of this implementation.
6565

examples/chef/common/clusters/switch/SwitchEventHandler.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#ifdef MATTER_DM_PLUGIN_SWITCH_SERVER
2121
#include <app/clusters/switch-server/switch-server.h>
2222
#include <app/server/Server.h>
23-
#include <app/util/att-storage.h>
2423
#include <platform/PlatformManager.h>
2524

2625
#include "SwitchEventHandler.h"

examples/chef/common/clusters/switch/SwitchManager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <app-common/zap-generated/attributes/Accessors.h>
2222
#include <app/clusters/switch-server/switch-server.h>
2323
#include <app/server/Server.h>
24-
#include <app/util/att-storage.h>
2524
#include <app/util/attribute-storage.h>
2625
#include <platform/PlatformManager.h>
2726

examples/chef/esp32/main/main.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include <app-common/zap-generated/callback.h>
4343
#include <app-common/zap-generated/cluster-objects.h>
4444
#include <app/server/Dnssd.h>
45-
#include <app/util/att-storage.h>
4645
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
4746

4847
#include "Display.h"

examples/fabric-bridge-app/linux/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ defined:
5151
definition.
5252

5353
- All attributes defined with these macros will be configured as
54-
`ATTRIBUTE_MASK_EXTERNAL_STORAGE` in the ZCL database and therefore will
55-
rely on the application to maintain storage for the attribute. Consequently,
56-
reads or writes to these attributes must be handled within the application
57-
by the `emberAfExternalAttributeWriteCallback` and
54+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
55+
will rely on the application to maintain storage for the attribute.
56+
Consequently, reads or writes to these attributes must be handled within the
57+
application by the `emberAfExternalAttributeWriteCallback` and
5858
`emberAfExternalAttributeReadCallback` functions. See the bridge
5959
application's `main.cpp` for an example of this implementation.
6060

examples/fabric-sync/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ defined:
5151
definition.
5252

5353
- All attributes defined with these macros will be configured as
54-
`ATTRIBUTE_MASK_EXTERNAL_STORAGE` in the ZCL database and therefore will
55-
rely on the application to maintain storage for the attribute. Consequently,
56-
reads or writes to these attributes must be handled within the application
57-
by the `emberAfExternalAttributeWriteCallback` and
54+
`MATTER_ATTRIBUTE_FLAG_EXTERNAL_STORAGE` in the ZCL database and therefore
55+
will rely on the application to maintain storage for the attribute.
56+
Consequently, reads or writes to these attributes must be handled within the
57+
application by the `emberAfExternalAttributeWriteCallback` and
5858
`emberAfExternalAttributeReadCallback` functions. See the bridge
5959
application's `main.cpp` for an example of this implementation.
6060

examples/lighting-app-data-mode-no-unique-id/linux/LightingAppCommandDelegate.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
2424
#include <app/clusters/switch-server/switch-server.h>
2525
#include <app/server/Server.h>
26-
#include <app/util/att-storage.h>
2726
#include <app/util/attribute-storage.h>
2827
#include <platform/PlatformManager.h>
2928

examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "LightingManager.h"
2121
#include <app-common/zap-generated/attributes/Accessors.h>
22-
#include <app/util/att-storage.h>
2322
#include <stdio.h>
2423

2524
using namespace chip;

examples/lighting-app/linux/LightingAppCommandDelegate.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <app/clusters/software-diagnostics-server/software-diagnostics-server.h>
2424
#include <app/clusters/switch-server/switch-server.h>
2525
#include <app/server/Server.h>
26-
#include <app/util/att-storage.h>
2726
#include <app/util/attribute-storage.h>
2827
#include <platform/PlatformManager.h>
2928

src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <app/CommandHandler.h>
2323
#include <app/MessageDef/StatusIB.h>
2424
#include <app/server/Server.h>
25-
#include <app/util/att-storage.h>
2625
#include <app/util/attribute-storage.h>
2726
#include <credentials/GroupDataProvider.h>
2827
#include <lib/support/CodeUtils.h>

src/app/clusters/groups-server/groups-server.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <app-common/zap-generated/ids/Clusters.h>
2323
#include <app/CommandHandler.h>
2424
#include <app/reporting/reporting.h>
25-
#include <app/util/att-storage.h>
2625
#include <app/util/config.h>
2726
#include <credentials/GroupDataProvider.h>
2827
#include <inttypes.h>
@@ -339,7 +338,7 @@ bool emberAfGroupsClusterRemoveAllGroupsCallback(app::CommandHandler * commandOb
339338
}
340339
iter->Release();
341340
ScenesManagement::ScenesServer::Instance().GroupWillBeRemoved(fabricIndex, commandPath.mEndpointId,
342-
ZCL_SCENES_GLOBAL_SCENE_GROUP_ID);
341+
ScenesManagement::ScenesServer::kGlobalSceneGroupId);
343342
}
344343
#endif
345344

src/app/clusters/mode-select-server/mode-select-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <app/CommandHandler.h>
2525
#include <app/ConcreteCommandPath.h>
2626
#include <app/clusters/mode-select-server/supported-modes-manager.h>
27-
#include <app/util/att-storage.h>
2827
#include <app/util/attribute-storage.h>
2928
#include <app/util/config.h>
3029
#include <app/util/odd-sized-integers.h>

src/app/clusters/on-off-server/on-off-server.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -667,8 +667,9 @@ bool OnOffServer::offWithEffectCommand(app::CommandHandler * commandObj, const a
667667
if (globalSceneControl)
668668
{
669669
#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT
670-
ScenesManagement::ScenesServer::Instance().StoreCurrentScene(fabric, endpoint, ZCL_SCENES_GLOBAL_SCENE_GROUP_ID,
671-
ZCL_SCENES_GLOBAL_SCENE_SCENE_ID);
670+
ScenesManagement::ScenesServer::Instance().StoreCurrentScene(fabric, endpoint,
671+
ScenesManagement::ScenesServer::kGlobalSceneGroupId,
672+
ScenesManagement::ScenesServer::kGlobalSceneId);
672673
#endif // MATTER_DM_PLUGIN_SCENES_MANAGEMENT
673674
OnOff::Attributes::GlobalSceneControl::Set(endpoint, false);
674675
}
@@ -723,8 +724,8 @@ bool OnOffServer::OnWithRecallGlobalSceneCommand(app::CommandHandler * commandOb
723724
}
724725

725726
#ifdef MATTER_DM_PLUGIN_SCENES_MANAGEMENT
726-
ScenesManagement::ScenesServer::Instance().RecallScene(fabric, endpoint, ZCL_SCENES_GLOBAL_SCENE_GROUP_ID,
727-
ZCL_SCENES_GLOBAL_SCENE_SCENE_ID);
727+
ScenesManagement::ScenesServer::Instance().RecallScene(fabric, endpoint, ScenesManagement::ScenesServer::kGlobalSceneGroupId,
728+
ScenesManagement::ScenesServer::kGlobalSceneId);
728729
#endif // MATTER_DM_PLUGIN_SCENES_MANAGEMENT
729730

730731
OnOff::Attributes::GlobalSceneControl::Set(endpoint, true);

src/app/clusters/scenes-server/scenes-server.h

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class ScenesServer : public CommandHandlerInterface, public AttributeAccessInter
4040
MATTER_DM_SCENES_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT;
4141
static_assert(kScenesServerMaxEndpointCount <= kEmberInvalidEndpointIndex, "Scenes endpoint count error");
4242
static constexpr uint8_t kScenesServerMaxFabricCount = CHIP_CONFIG_MAX_FABRICS;
43+
static constexpr SceneId kGlobalSceneId = 0x00;
44+
static constexpr GroupId kGlobalSceneGroupId = 0x0000;
4345

4446
// FabricSceneInfo
4547
class FabricSceneInfo

src/app/dynamic_server/DynamicDispatcher.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <app/MessageDef/StatusIB.h>
3030
#include <app/WriteHandler.h>
3131
#include <app/data-model/Decode.h>
32-
#include <app/util/att-storage.h>
3332
#include <app/util/attribute-storage.h>
3433
#include <app/util/attribute-table.h>
3534
#include <app/util/endpoint-config-api.h>
@@ -197,7 +196,7 @@ uint8_t emberAfClusterCount(EndpointId endpoint, bool server)
197196

198197
uint8_t emberAfClusterCountForEndpointType(const EmberAfEndpointType * type, bool server)
199198
{
200-
const EmberAfClusterMask cluster_mask = server ? CLUSTER_MASK_SERVER : CLUSTER_MASK_CLIENT;
199+
const EmberAfClusterMask cluster_mask = server ? MATTER_CLUSTER_FLAG_SERVER : MATTER_CLUSTER_FLAG_CLIENT;
201200

202201
return static_cast<uint8_t>(std::count_if(type->cluster, type->cluster + type->clusterCount,
203202
[=](const EmberAfCluster & cluster) { return (cluster.mask & cluster_mask) != 0; }));
@@ -210,7 +209,7 @@ Optional<AttributeId> emberAfGetServerAttributeIdByIndex(EndpointId endpoint, Cl
210209

211210
uint8_t emberAfClusterIndex(EndpointId endpoint, ClusterId clusterId, EmberAfClusterMask mask)
212211
{
213-
if (endpoint == kSupportedEndpoint && clusterId == OtaSoftwareUpdateProvider::Id && (mask & CLUSTER_MASK_SERVER))
212+
if (endpoint == kSupportedEndpoint && clusterId == OtaSoftwareUpdateProvider::Id && (mask & MATTER_CLUSTER_FLAG_SERVER))
214213
{
215214
return 0;
216215
}
@@ -234,7 +233,7 @@ const EmberAfCluster otaProviderCluster{
234233
.attributes = nullptr,
235234
.attributeCount = 0,
236235
.clusterSize = 0,
237-
.mask = CLUSTER_MASK_SERVER,
236+
.mask = MATTER_CLUSTER_FLAG_SERVER,
238237
.functions = nullptr,
239238
.acceptedCommandList = acceptedCommands,
240239
.generatedCommandList = generatedCommands,

0 commit comments

Comments
 (0)