Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace legacy cluster id constants with namespaced ones. #23833

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
#include "DeviceCallbacks.h"
#include "CHIPDeviceManager.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/util/af.h>
@@ -91,11 +91,11 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster
{
switch (clusterId)
{
case ZCL_ON_OFF_CLUSTER_ID:
case app::Clusters::OnOff::Id:
OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value);
break;

case ZCL_IDENTIFY_CLUSTER_ID:
case app::Clusters::Identify::Id:
OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value);
break;

Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/CommandHandler.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/util/basic-types.h>
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@
#include "ClusterManager.h"

#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
6 changes: 3 additions & 3 deletions examples/all-clusters-app/esp32/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
#include <lib/dnssd/Advertiser.h>

#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Clusters.h>
#endif

static const char * TAG = "app-devicecallbacks";
@@ -165,13 +165,13 @@ void AppDeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpoi
if (attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID)
{
hue = *value;
emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID,
emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID,
&saturation, sizeof(uint8_t));
}
else
{
saturation = *value;
emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue,
emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue,
sizeof(uint8_t));
}
statusLED1.SetColor(hue, saturation);
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@

#include "DeviceWithDisplay.h"
#include <app-common/zap-generated/cluster-enums.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>

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

Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/clusters/door-lock-server/door-lock-server.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>
4 changes: 2 additions & 2 deletions examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
@@ -409,7 +409,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)

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

if (status != EMBER_ZCL_STATUS_SUCCESS)
{
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@
#include "LEDWidget.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/util/basic-types.h>
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@
#include "ClusterManager.h"

#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/util/af-types.h>
1 change: 0 additions & 1 deletion examples/all-clusters-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@

#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/clusters/ota-requestor/OTATestEventTriggerDelegate.h>
#include <app/util/attribute-storage.h>
20 changes: 10 additions & 10 deletions examples/all-clusters-app/nxp/mw320/main.cpp
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@

//#include <lib/support/RandUtils.h> //==> rm from TE7.5
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/server/Dnssd.h>
#include <app/server/Server.h>
#include <app/util/af-types.h>
@@ -288,7 +288,7 @@ EmberAfStatus emberAfExternalAttributeReadCallback(EndpointId endpoint, ClusterI
{
PRINTF("====> emberAfExternalAttributeReadCallback\r\n");

if(clusterId == ZCL_SWITCH_CLUSTER_ID) {
if(clusterId == Clusters::Switch::Id) {
*buffer = g_ButtonPress;
}
return EMBER_ZCL_STATUS_SUCCESS;
@@ -1144,12 +1144,12 @@ void task_test_main(void * param)
value = (uint16_t) is_on;
// sync-up the switch attribute:
PRINTF("--> update ZCL_CURRENT_POSITION_ATTRIBUTE_ID [%d] \r\n", value);
emAfWriteAttribute(1, ZCL_SWITCH_CLUSTER_ID, ZCL_CURRENT_POSITION_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true,
emAfWriteAttribute(1, Clusters::Switch::Id, ZCL_CURRENT_POSITION_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true,
false);
#ifdef SUPPORT_MANUAL_CTRL
// sync-up the Light attribute (for test event, OO.M.ManuallyControlled)
PRINTF("--> update [ZCL_ON_OFF_CLUSTER_ID]: ZCL_ON_OFF_ATTRIBUTE_ID [%d] \r\n", value);
emAfWriteAttribute(1, ZCL_ON_OFF_CLUSTER_ID, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true, false);
PRINTF("--> update [Clusters::Switch::Id]: ZCL_ON_OFF_ATTRIBUTE_ID [%d] \r\n", value);
emAfWriteAttribute(1, Clusters::Switch::Id, ZCL_ON_OFF_ATTRIBUTE_ID, (uint8_t *) &value, sizeof(value), true, false);
#endif // SUPPORT_MANUAL_CTRL

need2sync_sw_attr = false;
@@ -1529,7 +1529,7 @@ static void OnSwitchAttributeChangeCallback(EndpointId endpointId, AttributeId a
}
}
if (do_sendrpt == true) {
ConcreteEventPath event_path(endpointId, ZCL_SWITCH_CLUSTER_ID, 0);
ConcreteEventPath event_path(endpointId, Clusters::Switch::Id, 0);
pimEngine->GetReportingEngine().ScheduleEventDelivery(event_path, chip::app::EventOptions::Type::kUrgent,
sizeof(uint16_t));
}
@@ -1554,7 +1554,7 @@ void IdentifyTimerHandler(System::Layer * systemLayer, void * appState)
if (pidt->identifyTimerCount)
{
pidt->identifyTimerCount--;
emAfWriteAttribute(pidt->ep, ZCL_IDENTIFY_CLUSTER_ID, ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, (uint8_t *) &pidt->identifyTimerCount,
emAfWriteAttribute(pidt->ep, Clusters::Identify::Id, ZCL_IDENTIFY_TIME_ATTRIBUTE_ID, (uint8_t *) &pidt->identifyTimerCount,
sizeof(identifyTimerCount), true, false);
DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), IdentifyTimerHandler, pidt);
}
@@ -1587,16 +1587,16 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath &
// path.mEndpointId, path.mClusterId, path.mAttributeId, mask, type, size, value
switch (path.mClusterId)
{
case ZCL_ON_OFF_CLUSTER_ID:
case Clusters::OnOff::Id:
OnOnOffPostAttributeChangeCallback(path.mEndpointId, path.mAttributeId, value);
break;
case ZCL_SWITCH_CLUSTER_ID:
case Clusters::Switch::Id:
OnSwitchAttributeChangeCallback(path.mEndpointId, path.mAttributeId, value);
// SwitchToggleOnOff();
// Trigger to send on/off/toggle command to the bound devices
chip::BindingManager::GetInstance().NotifyBoundClusterChanged(1, chip::app::Clusters::OnOff::Id, nullptr);
break;
case ZCL_IDENTIFY_CLUSTER_ID:
case Clusters::Identify::Id:
OnIdentifyPostAttributeChangeCallback(path.mEndpointId, path.mAttributeId, value);
break;
default:
1 change: 0 additions & 1 deletion examples/all-clusters-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -32,7 +32,6 @@

#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/util/attribute-storage.h>

Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@

#include "CHIPDeviceManager.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/util/af.h>
@@ -79,11 +79,11 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster
{
switch (clusterId)
{
case ZCL_ON_OFF_CLUSTER_ID:
case app::Clusters::OnOff::Id:
OnOnOffPostAttributeChangeCallback(endpointId, attributeId, value);
break;

case ZCL_IDENTIFY_CLUSTER_ID:
case app::Clusters::Identify::Id:
OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value);
break;

Original file line number Diff line number Diff line change
@@ -21,7 +21,6 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/CommandHandler.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/util/basic-types.h>
Original file line number Diff line number Diff line change
@@ -28,7 +28,6 @@
#include "ClusterManager.h"

#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/CommandHandler.h>
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
#include <lib/dnssd/Advertiser.h>

#if CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Clusters.h>
#endif

static const char * TAG = "app-devicecallbacks";
@@ -165,13 +165,13 @@ void AppDeviceCallbacks::OnColorControlAttributeChangeCallback(EndpointId endpoi
if (attributeId == ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID)
{
hue = *value;
emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID,
emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_SATURATION_ATTRIBUTE_ID,
&saturation, sizeof(uint8_t));
}
else
{
saturation = *value;
emberAfReadServerAttribute(endpointId, ZCL_COLOR_CONTROL_CLUSTER_ID, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue,
emberAfReadServerAttribute(endpointId, Clusters::ColorControl::Id, ZCL_COLOR_CONTROL_CURRENT_HUE_ATTRIBUTE_ID, &hue,
sizeof(uint8_t));
}
statusLED1.SetColor(hue, saturation);
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
*/

#include "DeviceWithDisplay.h"
#include <app-common/zap-generated/ids/Clusters.h>
#include <setup_payload/QRCodeSetupPayloadGenerator.h>

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

Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/clusters/door-lock-server/door-lock-server.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/server/Dnssd.h>
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
@@ -409,7 +409,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)

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

if (status != EMBER_ZCL_STATUS_SUCCESS)
{
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@
#include "LEDWidget.h"
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/CommandHandler.h>
#include <app/server/Dnssd.h>
#include <app/util/basic-types.h>
Original file line number Diff line number Diff line change
@@ -27,7 +27,6 @@
#include "ClusterManager.h"

#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/util/af-types.h>
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@

#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/util/attribute-storage.h>

#include <credentials/DeviceAttestationCredsProvider.h>
1 change: 0 additions & 1 deletion examples/all-clusters-minimal-app/telink/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -30,7 +30,6 @@

#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/attribute-type.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app/util/attribute-storage.h>

#include <credentials/DeviceAttestationCredsProvider.h>
15 changes: 7 additions & 8 deletions examples/bridge-app/esp32/main/main.cpp
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
#include "nvs_flash.h"
#include <app-common/zap-generated/af-structs.h>
#include <app-common/zap-generated/attribute-id.h>
#include <app-common/zap-generated/cluster-id.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/ConcreteAttributePath.h>
#include <app/clusters/identify-server/identify-server.h>
#include <app/reporting/reporting.h>
@@ -136,10 +136,9 @@ constexpr CommandId onOffIncomingCommands[] = {
};

DECLARE_DYNAMIC_CLUSTER_LIST_BEGIN(bridgedLightClusters)
DECLARE_DYNAMIC_CLUSTER(ZCL_ON_OFF_CLUSTER_ID, onOffAttrs, onOffIncomingCommands, nullptr),
DECLARE_DYNAMIC_CLUSTER(ZCL_DESCRIPTOR_CLUSTER_ID, descriptorAttrs, nullptr, nullptr),
DECLARE_DYNAMIC_CLUSTER(ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID, bridgedDeviceBasicAttrs, nullptr,
nullptr) DECLARE_DYNAMIC_CLUSTER_LIST_END;
DECLARE_DYNAMIC_CLUSTER(OnOff::Id, onOffAttrs, onOffIncomingCommands, nullptr),
DECLARE_DYNAMIC_CLUSTER(Descriptor::Id, descriptorAttrs, nullptr, nullptr),
DECLARE_DYNAMIC_CLUSTER(BridgedDeviceBasic::Id, bridgedDeviceBasicAttrs, nullptr, nullptr) DECLARE_DYNAMIC_CLUSTER_LIST_END;

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

if (clusterId == ZCL_BRIDGED_DEVICE_BASIC_CLUSTER_ID)
if (clusterId == BridgedDeviceBasic::Id)
{
return HandleReadBridgedDeviceBasicAttribute(dev, attributeMetadata->attributeId, buffer, maxReadLength);
}
else if (clusterId == ZCL_ON_OFF_CLUSTER_ID)
else if (clusterId == OnOff::Id)
{
return HandleReadOnOffAttribute(dev, attributeMetadata->attributeId, buffer, maxReadLength);
}
@@ -300,7 +299,7 @@ EmberAfStatus emberAfExternalAttributeWriteCallback(EndpointId endpoint, Cluster
{
Device * dev = gDevices[endpointIndex];

if ((dev->IsReachable()) && (clusterId == ZCL_ON_OFF_CLUSTER_ID))
if ((dev->IsReachable()) && (clusterId == OnOff::Id))
{
return HandleWriteOnOffAttribute(dev, attributeMetadata->attributeId, buffer);
}
Loading