Skip to content

Commit 1542394

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Replace legacy cluster id constants with namespaced ones. (#23833)
Large parts of this were generated by running: perl -pi -e 'BEGIN { sub recombine { my ($str) = @_; my @split = split /_/,$str; return join("", map { ucfirst lc $_ } @split); } } s/ZCL_([A-Z_]*)_CLUSTER_ID/"app::Clusters::".recombine($1)."::Id"/e' on various files.
1 parent 11e4e91 commit 1542394

File tree

116 files changed

+459
-777
lines changed

Some content is hidden

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

116 files changed

+459
-777
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "DeviceCallbacks.h"
2727
#include "CHIPDeviceManager.h"
2828
#include <app-common/zap-generated/attribute-id.h>
29-
#include <app-common/zap-generated/cluster-id.h>
29+
#include <app-common/zap-generated/ids/Clusters.h>
3030
#include <app/CommandHandler.h>
3131
#include <app/server/Dnssd.h>
3232
#include <app/util/af.h>
@@ -91,11 +91,11 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster
9191
{
9292
switch (clusterId)
9393
{
94-
case ZCL_ON_OFF_CLUSTER_ID:
94+
case app::Clusters::OnOff::Id:
9595
OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value);
9696
break;
9797

98-
case ZCL_IDENTIFY_CLUSTER_ID:
98+
case app::Clusters::Identify::Id:
9999
OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value);
100100
break;
101101

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

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <app-common/zap-generated/attribute-id.h>
2222
#include <app-common/zap-generated/attribute-type.h>
2323
#include <app-common/zap-generated/attributes/Accessors.h>
24-
#include <app-common/zap-generated/cluster-id.h>
2524
#include <app/CommandHandler.h>
2625
#include <app/clusters/identify-server/identify-server.h>
2726
#include <app/util/basic-types.h>

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

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "ClusterManager.h"
2929

3030
#include <app-common/zap-generated/attribute-id.h>
31-
#include <app-common/zap-generated/cluster-id.h>
3231
#include <app-common/zap-generated/ids/Attributes.h>
3332
#include <app-common/zap-generated/ids/Clusters.h>
3433
#include <app/CommandHandler.h>

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <lib/dnssd/Advertiser.h>
3838

3939
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
40-
#include <app-common/zap-generated/cluster-id.h>
40+
#include <app-common/zap-generated/ids/Clusters.h>
4141
#endif
4242

4343
static const char * TAG = "app-devicecallbacks";
@@ -165,13 +165,13 @@ void AppDeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpoi
165165
if (attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID)
166166
{
167167
hue = *value;
168-
emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID,
168+
emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID,
169169
&saturation, sizeof(uint8_t));
170170
}
171171
else
172172
{
173173
saturation = *value;
174-
emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue,
174+
emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue,
175175
sizeof(uint8_t));
176176
}
177177
statusLED1.SetColor(hue, saturation);

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "DeviceWithDisplay.h"
2020
#include <app-common/zap-generated/cluster-enums.h>
21+
#include <app-common/zap-generated/ids/Clusters.h>
2122
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
2223

2324
#if CONFIG_HAVE_DISPLAY
@@ -322,7 +323,7 @@ class EditAttributeListModel : public TouchesMatterStackModel
322323
{
323324
value = (value == "On") ? "Off" : "On";
324325
uint8_t attributeValue = (value == "On") ? 1 : 0;
325-
emberAfWriteServerAttribute(endpointIndex + 1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID,
326+
emberAfWriteServerAttribute(endpointIndex + 1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID,
326327
(uint8_t *) &attributeValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
327328
}
328329

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

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <app-common/zap-generated/attribute-id.h>
3838
#include <app-common/zap-generated/attribute-type.h>
3939
#include <app-common/zap-generated/attributes/Accessors.h>
40-
#include <app-common/zap-generated/cluster-id.h>
4140
#include <app/clusters/door-lock-server/door-lock-server.h>
4241
#include <app/server/Dnssd.h>
4342
#include <app/server/OnboardingCodesUtil.h>

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <app-common/zap-generated/attribute-id.h>
2727
#include <app-common/zap-generated/attribute-type.h>
2828
#include <app-common/zap-generated/attributes/Accessors.h>
29-
#include <app-common/zap-generated/cluster-id.h>
29+
#include <app-common/zap-generated/ids/Clusters.h>
3030
#include <app/server/Dnssd.h>
3131
#include <app/server/OnboardingCodesUtil.h>
3232
#include <app/server/Server.h>
@@ -409,7 +409,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)
409409

410410
// write the new on/off value
411411
EmberAfStatus status =
412-
emberAfWriteServerAttribute(2, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
412+
emberAfWriteServerAttribute(2, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
413413

414414
if (status != EMBER_ZCL_STATUS_SUCCESS)
415415
{

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

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "LEDWidget.h"
2727
#include <app-common/zap-generated/attribute-id.h>
2828
#include <app-common/zap-generated/attributes/Accessors.h>
29-
#include <app-common/zap-generated/cluster-id.h>
3029
#include <app/CommandHandler.h>
3130
#include <app/server/Dnssd.h>
3231
#include <app/util/basic-types.h>

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

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "ClusterManager.h"
2828

2929
#include <app-common/zap-generated/attribute-id.h>
30-
#include <app-common/zap-generated/cluster-id.h>
3130
#include <app-common/zap-generated/ids/Attributes.h>
3231
#include <app-common/zap-generated/ids/Clusters.h>
3332
#include <app/util/af-types.h>

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

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
#include <app-common/zap-generated/attribute-id.h>
3030
#include <app-common/zap-generated/attribute-type.h>
31-
#include <app-common/zap-generated/cluster-id.h>
3231
#include <app/clusters/identify-server/identify-server.h>
3332
#include <app/clusters/ota-requestor/OTATestEventTriggerDelegate.h>
3433
#include <app/util/attribute-storage.h>

examples/all-clusters-app/nxp/mw320/main.cpp

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

3131
//#include <lib/support/RandUtils.h> //==> rm from TE7.5
3232
#include <app-common/zap-generated/attribute-id.h>
33-
#include <app-common/zap-generated/cluster-id.h>
33+
#include <app-common/zap-generated/ids/Clusters.h>
3434
#include <app/server/Dnssd.h>
3535
#include <app/server/Server.h>
3636
#include <app/util/af-types.h>
@@ -288,7 +288,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI
288288
{
289289
PRINTF("====> emberAfExternalAttributeReadCallback\r\n");
290290
291-
if(clusterId == ZCL_SWITCH_CLUSTER_ID) {
291+
if(clusterId == Clusters::Switch::Id) {
292292
*buffer = g_ButtonPress;
293293
}
294294
return EMBER_ZCL_STATUS_SUCCESS;
@@ -1144,12 +1144,12 @@ void task_test_main(void * param)
11441144
value = (uint16_t) is_on;
11451145
// sync-up the switch attribute:
11461146
PRINTF("--> update ZCL_CURRENT_POSITION_ATTRIBUTE_ID [%d] \r\n", value);
1147-
emAfWriteAttribute(1, ZCL_SWITCH_CLUSTER_ID, ZCL_CURRENT_POSITION_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true,
1147+
emAfWriteAttribute(1, Clusters::Switch::Id, ZCL_CURRENT_POSITION_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true,
11481148
false);
11491149
#ifdef SUPPORT_MANUAL_CTRL
11501150
// sync-up the Light attribute (for test event, OO.M.ManuallyControlled)
1151-
PRINTF("--> update [ZCL_ON_OFF_CLUSTER_ID]: ZCL_ON_OFF_ATTRIBUTE_ID [%d] \r\n", value);
1152-
emAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true, false);
1151+
PRINTF("--> update [Clusters::Switch::Id]: ZCL_ON_OFF_ATTRIBUTE_ID [%d] \r\n", value);
1152+
emAfWriteAttribute(1, Clusters::Switch::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true, false);
11531153
#endif // SUPPORT_MANUAL_CTRL
11541154

11551155
need2sync_sw_attr = false;
@@ -1529,7 +1529,7 @@ static void OnSwitchAttributeChangeCallback(EndpointId endpointId, AttributeId a
15291529
}
15301530
}
15311531
if (do_sendrpt == true) {
1532-
ConcreteEventPath event_path(endpointId, ZCL_SWITCH_CLUSTER_ID, 0);
1532+
ConcreteEventPath event_path(endpointId, Clusters::Switch::Id, 0);
15331533
pimEngine->GetReportingEngine().ScheduleEventDelivery(event_path, chip::app::EventOptions::Type::kUrgent,
15341534
sizeof(uint16_t));
15351535
}
@@ -1554,7 +1554,7 @@ void IdentifyTimerHandler(System::Layer * systemLayer, void * appState)
15541554
if (pidt->identifyTimerCount)
15551555
{
15561556
pidt->identifyTimerCount--;
1557-
emAfWriteAttribute(pidt->ep, ZCL_IDENTIFY_CLUSTER_ID, ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, (uint8_t *) &pidt->identifyTimerCount,
1557+
emAfWriteAttribute(pidt->ep, Clusters::Identify::Id, ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, (uint8_t *) &pidt->identifyTimerCount,
15581558
sizeof(identifyTimerCount), true, false);
15591559
DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), IdentifyTimerHandler, pidt);
15601560
}
@@ -1587,16 +1587,16 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
15871587
// path.mEndpointId, path.mClusterId, path.mAttributeId, mask, type, size, value
15881588
switch (path.mClusterId)
15891589
{
1590-
case ZCL_ON_OFF_CLUSTER_ID:
1590+
case Clusters::OnOff::Id:
15911591
OnOnOffPostAttributeChangeCallback(path.mEndpointId, path.mAttributeId, value);
15921592
break;
1593-
case ZCL_SWITCH_CLUSTER_ID:
1593+
case Clusters::Switch::Id:
15941594
OnSwitchAttributeChangeCallback(path.mEndpointId, path.mAttributeId, value);
15951595
// SwitchToggleOnOff();
15961596
// Trigger to send on/off/toggle command to the bound devices
15971597
chip::BindingManager::GetInstance().NotifyBoundClusterChanged(1, chip::app::Clusters::OnOff::Id, nullptr);
15981598
break;
1599-
case ZCL_IDENTIFY_CLUSTER_ID:
1599+
case Clusters::Identify::Id:
16001600
OnIdentifyPostAttributeChangeCallback(path.mEndpointId, path.mAttributeId, value);
16011601
break;
16021602
default:

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

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232

3333
#include <app-common/zap-generated/attribute-id.h>
3434
#include <app-common/zap-generated/attribute-type.h>
35-
#include <app-common/zap-generated/cluster-id.h>
3635
#include <app/clusters/identify-server/identify-server.h>
3736
#include <app/util/attribute-storage.h>
3837

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include "CHIPDeviceManager.h"
2828
#include <app-common/zap-generated/attribute-id.h>
29-
#include <app-common/zap-generated/cluster-id.h>
29+
#include <app-common/zap-generated/ids/Clusters.h>
3030
#include <app/CommandHandler.h>
3131
#include <app/server/Dnssd.h>
3232
#include <app/util/af.h>
@@ -79,11 +79,11 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster
7979
{
8080
switch (clusterId)
8181
{
82-
case ZCL_ON_OFF_CLUSTER_ID:
82+
case app::Clusters::OnOff::Id:
8383
OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value);
8484
break;
8585

86-
case ZCL_IDENTIFY_CLUSTER_ID:
86+
case app::Clusters::Identify::Id:
8787
OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value);
8888
break;
8989

examples/all-clusters-minimal-app/cc13x2x7_26x2x7/main/ClusterManager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <app-common/zap-generated/attribute-id.h>
2222
#include <app-common/zap-generated/attribute-type.h>
2323
#include <app-common/zap-generated/attributes/Accessors.h>
24-
#include <app-common/zap-generated/cluster-id.h>
2524
#include <app/CommandHandler.h>
2625
#include <app/clusters/identify-server/identify-server.h>
2726
#include <app/util/basic-types.h>

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

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include "ClusterManager.h"
2929

3030
#include <app-common/zap-generated/attribute-id.h>
31-
#include <app-common/zap-generated/cluster-id.h>
3231
#include <app-common/zap-generated/ids/Attributes.h>
3332
#include <app-common/zap-generated/ids/Clusters.h>
3433
#include <app/CommandHandler.h>

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include <lib/dnssd/Advertiser.h>
3838

3939
#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
40-
#include <app-common/zap-generated/cluster-id.h>
40+
#include <app-common/zap-generated/ids/Clusters.h>
4141
#endif
4242

4343
static const char * TAG = "app-devicecallbacks";
@@ -165,13 +165,13 @@ void AppDeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpoi
165165
if (attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID)
166166
{
167167
hue = *value;
168-
emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID,
168+
emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID,
169169
&saturation, sizeof(uint8_t));
170170
}
171171
else
172172
{
173173
saturation = *value;
174-
emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue,
174+
emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue,
175175
sizeof(uint8_t));
176176
}
177177
statusLED1.SetColor(hue, saturation);

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include "DeviceWithDisplay.h"
20+
#include <app-common/zap-generated/ids/Clusters.h>
2021
#include <setup_payload/QRCodeSetupPayloadGenerator.h>
2122

2223
#if CONFIG_HAVE_DISPLAY
@@ -232,7 +233,7 @@ class EditAttributeListModel : public TouchesMatterStackModel
232233
{
233234
value = (value == "On") ? "Off" : "On";
234235
uint8_t attributeValue = (value == "On") ? 1 : 0;
235-
emberAfWriteServerAttribute(endpointIndex + 1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID,
236+
emberAfWriteServerAttribute(endpointIndex + 1, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID,
236237
(uint8_t *) &attributeValue, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
237238
}
238239

examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include <app-common/zap-generated/attribute-id.h>
3838
#include <app-common/zap-generated/attribute-type.h>
3939
#include <app-common/zap-generated/attributes/Accessors.h>
40-
#include <app-common/zap-generated/cluster-id.h>
4140
#include <app/clusters/door-lock-server/door-lock-server.h>
4241
#include <app/server/Dnssd.h>
4342
#include <app/server/OnboardingCodesUtil.h>

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include <app-common/zap-generated/attribute-id.h>
2727
#include <app-common/zap-generated/attribute-type.h>
2828
#include <app-common/zap-generated/attributes/Accessors.h>
29-
#include <app-common/zap-generated/cluster-id.h>
29+
#include <app-common/zap-generated/ids/Clusters.h>
3030
#include <app/server/Dnssd.h>
3131
#include <app/server/OnboardingCodesUtil.h>
3232
#include <app/server/Server.h>
@@ -409,7 +409,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)
409409

410410
// write the new on/off value
411411
EmberAfStatus status =
412-
emberAfWriteServerAttribute(2, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
412+
emberAfWriteServerAttribute(2, app::Clusters::OnOff::Id, ZCL_ON_OFF_ATTRIBUTE_ID, &onoff, ZCL_BOOLEAN_ATTRIBUTE_TYPE);
413413

414414
if (status != EMBER_ZCL_STATUS_SUCCESS)
415415
{

examples/all-clusters-minimal-app/infineon/psoc6/src/ClusterManager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include "LEDWidget.h"
2727
#include <app-common/zap-generated/attribute-id.h>
2828
#include <app-common/zap-generated/attributes/Accessors.h>
29-
#include <app-common/zap-generated/cluster-id.h>
3029
#include <app/CommandHandler.h>
3130
#include <app/server/Dnssd.h>
3231
#include <app/util/basic-types.h>

examples/all-clusters-minimal-app/infineon/psoc6/src/ZclCallbacks.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include "ClusterManager.h"
2828

2929
#include <app-common/zap-generated/attribute-id.h>
30-
#include <app-common/zap-generated/cluster-id.h>
3130
#include <app-common/zap-generated/ids/Attributes.h>
3231
#include <app-common/zap-generated/ids/Clusters.h>
3332
#include <app/util/af-types.h>

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

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#include <app-common/zap-generated/attribute-id.h>
2828
#include <app-common/zap-generated/attribute-type.h>
29-
#include <app-common/zap-generated/cluster-id.h>
3029
#include <app/util/attribute-storage.h>
3130

3231
#include <credentials/DeviceAttestationCredsProvider.h>

examples/all-clusters-minimal-app/telink/src/AppTask.cpp

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

3131
#include <app-common/zap-generated/attribute-id.h>
3232
#include <app-common/zap-generated/attribute-type.h>
33-
#include <app-common/zap-generated/cluster-id.h>
3433
#include <app/util/attribute-storage.h>
3534

3635
#include <credentials/DeviceAttestationCredsProvider.h>

examples/bridge-app/esp32/main/main.cpp

+7-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "nvs_flash.h"
2222
#include <app-common/zap-generated/af-structs.h>
2323
#include <app-common/zap-generated/attribute-id.h>
24-
#include <app-common/zap-generated/cluster-id.h>
24+
#include <app-common/zap-generated/ids/Clusters.h>
2525
#include <app/ConcreteAttributePath.h>
2626
#include <app/clusters/identify-server/identify-server.h>
2727
#include <app/reporting/reporting.h>
@@ -136,10 +136,9 @@ constexpr CommandId onOffIncomingCommands[] = {
136136
};
137137

138138
DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(bridgedLightClusters)
139-
DECLARE_DYNAMIC_CLUSTER(ZCL_ON_OFF_CLUSTER_ID, onOffAttrs, onOffIncomingCommands, nullptr),
140-
DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr),
141-
DECLARE_DYNAMIC_CLUSTER(ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID, bridgedDeviceBasicAttrs, nullptr,
142-
nullptr) DECLARE_DYNAMIC_CLUSTER_LIST_END;
139+
DECLARE_DYNAMIC_CLUSTER(OnOff::Id, onOffAttrs, onOffIncomingCommands, nullptr),
140+
DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, nullptr, nullptr),
141+
DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasic::Id, bridgedDeviceBasicAttrs, nullptr, nullptr) DECLARE_DYNAMIC_CLUSTER_LIST_END;
143142

144143
// Declare Bridged Light endpoint
145144
DECLARE_DYNAMIC_ENDPOINT(bridgedLightEndpoint, bridgedLightClusters);
@@ -278,11 +277,11 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI
278277
{
279278
Device * dev = gDevices[endpointIndex];
280279

281-
if (clusterId == ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID)
280+
if (clusterId == BridgedDeviceBasic::Id)
282281
{
283282
return HandleReadBridgedDeviceBasicAttribute(dev, attributeMetadata->attributeId, buffer, maxReadLength);
284283
}
285-
else if (clusterId == ZCL_ON_OFF_CLUSTER_ID)
284+
else if (clusterId == OnOff::Id)
286285
{
287286
return HandleReadOnOffAttribute(dev, attributeMetadata->attributeId, buffer, maxReadLength);
288287
}
@@ -300,7 +299,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster
300299
{
301300
Device * dev = gDevices[endpointIndex];
302301

303-
if ((dev->IsReachable()) && (clusterId == ZCL_ON_OFF_CLUSTER_ID))
302+
if ((dev->IsReachable()) && (clusterId == OnOff::Id))
304303
{
305304
return HandleWriteOnOffAttribute(dev, attributeMetadata->attributeId, buffer);
306305
}

0 commit comments

Comments
 (0)