Skip to content

Commit 3851016

Browse files
bzbarsky-applepull[bot]
authored andcommitted
Remove non-namespaced command ids. (#24511)
Those fail to compile when two clusters have a command with the same name, which is preventing us from aligning XML to the spec.
1 parent a2bebd1 commit 3851016

File tree

21 files changed

+27
-435
lines changed

21 files changed

+27
-435
lines changed

examples/chef/common/stubs.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include <app-common/zap-generated/attribute-type.h>
33
#include <app-common/zap-generated/attributes/Accessors.h>
44
#include <app-common/zap-generated/callback.h>
5-
#include <app-common/zap-generated/command-id.h>
65

76
// Include door lock callbacks only when the server is enabled
87
#ifdef EMBER_AF_PLUGIN_DOOR_LOCK_SERVER

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/attribute-type.h>
4343
#include <app-common/zap-generated/callback.h>
4444
#include <app-common/zap-generated/cluster-objects.h>
45-
#include <app-common/zap-generated/command-id.h>
4645
#include <app/server/Dnssd.h>
4746
#include <app/util/af-event.h>
4847
#include <app/util/af.h>

examples/lighting-app/ameba/main/CHIPDeviceManager.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
#include <app-common/zap-generated/attribute-id.h>
3737
#include <app-common/zap-generated/attributes/Accessors.h>
38-
#include <app-common/zap-generated/command-id.h>
3938
#include <app-common/zap-generated/ids/Clusters.h>
4039
#include <app/util/af-types.h>
4140
#include <app/util/attribute-storage.h>

examples/thermostat/silabs/efr32/src/AppTask.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#include <app-common/zap-generated/attributes/Accessors.h>
4444
#include <app-common/zap-generated/callback.h>
4545
#include <app-common/zap-generated/cluster-objects.h>
46-
#include <app-common/zap-generated/command-id.h>
4746
#include <app-common/zap-generated/enums.h>
4847
#include <app-common/zap-generated/ids/Attributes.h>
4948
#include <app/server/OnboardingCodesUtil.h>

examples/tv-app/linux/include/level-control/LevelControl.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include <app-common/zap-generated/af-structs.h>
2222
#include <app-common/zap-generated/attribute-id.h>
2323
#include <app-common/zap-generated/attribute-type.h>
24-
#include <app-common/zap-generated/command-id.h>
2524
#include <app-common/zap-generated/ids/Clusters.h>
25+
#include <app-common/zap-generated/ids/Commands.h>
2626

2727
using namespace chip;
2828
using namespace chip::app::Clusters;
@@ -128,7 +128,7 @@ bool emberAfLevelControlClusterStepCallback(uint8_t stepMode, uint8_t stepSize,
128128
BitMask<LevelControl::LevelControlOptions> optionMask,
129129
BitMask<LevelControl::LevelControlOptions> optionOverride)
130130
{
131-
stepHandler(ZCL_STEP_COMMAND_ID, stepMode, stepSize, transitionTime, optionMask, optionOverride);
131+
stepHandler(LevelControl::Commands::Step : Id, stepMode, stepSize, transitionTime, optionMask, optionOverride);
132132
return true;
133133
}
134134

src/app/clusters/door-lock-server/door-lock-server-callback.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "door-lock-server.h"
2525
#include <app-common/zap-generated/attributes/Accessors.h>
2626
#include <app-common/zap-generated/callback.h>
27-
#include <app-common/zap-generated/command-id.h>
2827
#include <app/EventLogging.h>
2928
#include <app/server/Server.h>
3029
#include <app/util/af-event.h>

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

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <app-common/zap-generated/attribute-type.h>
2121
#include <app-common/zap-generated/attributes/Accessors.h>
2222
#include <app-common/zap-generated/cluster-objects.h>
23-
#include <app-common/zap-generated/command-id.h>
2423
#include <app/AttributeAccessInterface.h>
2524
#include <app/CommandHandler.h>
2625
#include <app/server/Server.h>

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

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <app-common/zap-generated/attribute-type.h>
2323
#include <app-common/zap-generated/attributes/Accessors.h>
2424
#include <app-common/zap-generated/cluster-objects.h>
25-
#include <app-common/zap-generated/command-id.h>
2625
#include <app-common/zap-generated/ids/Clusters.h>
2726
#include <app/CommandHandler.h>
2827
#include <app/util/af.h>

src/app/clusters/ias-zone-client/ias-zone-client.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717

1818
#include "ias-zone-client.h"
1919
#include <app-common/zap-generated/ids/Clusters.h>
20+
#include <app-common/zap-generated/ids/Commands.h>
2021
#include <app/CommandHandler.h>
2122
#include <app/util/af.h>
2223

2324
using namespace chip;
25+
using namespace chip::app::Clusters::IasZone::Commands;
2426

2527
//-----------------------------------------------------------------------------
2628
// Globals
@@ -282,7 +284,7 @@ bool emberAfIasZoneClusterZoneEnrollRequestCallback(app::CommandHandler * comman
282284
setServerZoneId(serverIndex, zoneId);
283285
}
284286
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_CLIENT_TO_SERVER), app::Clusters::IasZone::Id,
285-
ZCL_ZONE_ENROLL_RESPONSE_COMMAND_ID, "uu", responseCode, zoneId);
287+
ZoneEnrollResponse::Id, "uu", responseCode, zoneId);
286288
// Need to send this command with our source EUI because the server will
287289
// check our EUI64 against his CIE Address to see if we're his CIE.
288290
emberAfGetCommandApsFrame()->options |= EMBER_APS_OPTION_SOURCE_EUI64;

src/app/clusters/ias-zone-server/ias-zone-server.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#include <app-common/zap-generated/attribute-type.h>
2222
#include <app-common/zap-generated/callback.h>
2323
#include <app-common/zap-generated/cluster-objects.h>
24-
#include <app-common/zap-generated/command-id.h>
2524
#include <app-common/zap-generated/ids/Clusters.h>
25+
#include <app-common/zap-generated/ids/Commands.h>
2626
#include <app/CommandHandler.h>
2727
#include <app/ConcreteCommandPath.h>
2828
#include <app/util/af-event.h>
@@ -34,6 +34,7 @@
3434
using namespace chip;
3535
using namespace chip::app::Clusters;
3636
using namespace chip::app::Clusters::IasZone;
37+
using namespace chip::app::Clusters::IasZone::Commands;
3738

3839
#define UNDEFINED_ZONE_ID 0xFF
3940
#define DELAY_TIMER_MS (1 * MILLISECOND_TICKS_PER_SECOND)
@@ -171,8 +172,7 @@ static void enrollWithClient(EndpointId endpoint)
171172
{
172173
EmberStatus status;
173174
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), IasZone::Id,
174-
ZCL_ZONE_ENROLL_REQUEST_COMMAND_ID, "vv", EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE,
175-
EMBER_AF_MANUFACTURER_CODE);
175+
ZoneEnrollRequest::Id, "vv", EMBER_AF_PLUGIN_IAS_ZONE_SERVER_ZONE_TYPE, EMBER_AF_MANUFACTURER_CODE);
176176
status = sendToClient(endpoint);
177177
if (status == EMBER_SUCCESS)
178178
{
@@ -354,8 +354,8 @@ static EmberStatus sendZoneUpdate(uint16_t zoneStatus, uint16_t timeSinceStatusO
354354
return EMBER_INVALID_CALL;
355355
}
356356
emberAfFillExternalBuffer((ZCL_CLUSTER_SPECIFIC_COMMAND | ZCL_FRAME_CONTROL_SERVER_TO_CLIENT), IasZone::Id,
357-
ZCL_ZONE_STATUS_CHANGE_NOTIFICATION_COMMAND_ID, "vuuv", zoneStatus,
358-
0 /*extended status, must be zero per spec*/, emberAfPluginIasZoneServerGetZoneId(endpoint),
357+
ZoneStatusChangeNotification::Id, "vuuv", zoneStatus, 0 /*extended status, must be zero per spec*/,
358+
emberAfPluginIasZoneServerGetZoneId(endpoint),
359359
timeSinceStatusOccurredQs /* called "delay" in the spec */);
360360
status = sendToClient(endpoint);
361361

@@ -728,7 +728,7 @@ void emberAfIasZoneClusterServerMessageSentCallback(const MessageSendDestination
728728
}
729729

730730
commandId = message[IAS_ZONE_SERVER_PAYLOAD_COMMAND_IDX];
731-
if (commandId != ZCL_ZONE_STATUS_CHANGE_NOTIFICATION_COMMAND_ID)
731+
if (commandId != ZoneStatusChangeNotification::Id)
732732
{
733733
return;
734734
}

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

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <app-common/zap-generated/attributes/Accessors.h>
2323
#include <app-common/zap-generated/callback.h>
2424
#include <app-common/zap-generated/cluster-objects.h>
25-
#include <app-common/zap-generated/command-id.h>
2625
#include <app-common/zap-generated/ids/Attributes.h>
2726
#include <app-common/zap-generated/ids/Clusters.h>
2827
#include <app-common/zap-generated/ids/Commands.h>

src/app/clusters/scenes-client/scenes-client.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
#include <app/CommandHandler.h>
2020
#include <app/util/af.h>
2121

22-
#include <app-common/zap-generated/command-id.h>
22+
#include <app-common/zap-generated/ids/Commands.h>
2323

2424
using namespace chip;
25+
using namespace chip::app::Clusters::Scenes::Commands;
2526

2627
bool emberAfScenesClusterAddSceneResponseCallback(app::CommandHandler * commandObj, uint8_t status, GroupId groupId,
2728
uint8_t sceneId)
@@ -85,7 +86,7 @@ bool emberAfScenesClusterGetSceneMembershipResponseCallback(app::CommandHandler
8586
bool emberAfPluginScenesClientParseAddSceneResponse(const EmberAfClusterCommand * cmd, uint8_t status, GroupId groupId,
8687
uint8_t sceneId)
8788
{
88-
bool enhanced = (cmd->commandId == ZCL_ENHANCED_ADD_SCENE_COMMAND_ID);
89+
bool enhanced = (cmd->commandId == EnhancedAddScene::Id);
8990
emberAfScenesClusterPrintln("RX: %pAddSceneResponse 0x%x, 0x%2x, 0x%x", (enhanced ? "Enhanced" : ""), status, groupId, sceneId);
9091
emberAfSendDefaultResponse(cmd, EMBER_ZCL_STATUS_SUCCESS);
9192
return true;
@@ -95,7 +96,7 @@ bool emberAfPluginScenesClientParseViewSceneResponse(const EmberAfClusterCommand
9596
uint8_t sceneId, uint16_t transitionTime, const uint8_t * sceneName,
9697
const uint8_t * extensionFieldSets)
9798
{
98-
bool enhanced = (cmd->commandId == ZCL_ENHANCED_VIEW_SCENE_COMMAND_ID);
99+
bool enhanced = (cmd->commandId == EnhancedViewScene::Id);
99100

100101
emberAfScenesClusterPrint("RX: %pViewSceneResponse 0x%x, 0x%2x, 0x%x", (enhanced ? "Enhanced" : ""), status, groupId, sceneId);
101102

src/app/clusters/scenes/scenes.cpp

+12-11
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
#include <app-common/zap-generated/attribute-id.h>
2121
#include <app-common/zap-generated/attribute-type.h>
2222
#include <app-common/zap-generated/cluster-objects.h>
23-
#include <app-common/zap-generated/command-id.h>
2423
#include <app-common/zap-generated/ids/Clusters.h>
24+
#include <app-common/zap-generated/ids/Commands.h>
2525
#include <app/CommandHandler.h>
2626
#include <app/ConcreteCommandPath.h>
2727
#include <app/util/af.h>
@@ -37,6 +37,7 @@
3737
using namespace chip;
3838
using namespace chip::app::Clusters;
3939
using namespace chip::app::Clusters::Scenes;
40+
using namespace chip::app::Clusters::Scenes::Commands;
4041

4142
uint8_t emberAfPluginScenesServerEntriesInUse = 0;
4243
#if !defined(EMBER_AF_PLUGIN_SCENES_USE_TOKENS) || defined(EZSP_HOST)
@@ -260,7 +261,7 @@ bool emberAfScenesClusterRemoveSceneCallback(app::CommandHandler * commandObj, c
260261
if (emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST || emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST_REPLY)
261262
{
262263
{
263-
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_REMOVE_SCENE_RESPONSE_COMMAND_ID };
264+
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, RemoveSceneResponse::Id };
264265
TLV::TLVWriter * writer = nullptr;
265266
SuccessOrExit(err = commandObj->PrepareCommand(path));
266267
VerifyOrExit((writer = commandObj->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE);
@@ -312,7 +313,7 @@ bool emberAfScenesClusterRemoveAllScenesCallback(app::CommandHandler * commandOb
312313
if (emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST || emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST_REPLY)
313314
{
314315
{
315-
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_REMOVE_ALL_SCENES_RESPONSE_COMMAND_ID };
316+
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, RemoveAllScenesResponse::Id };
316317
TLV::TLVWriter * writer = nullptr;
317318
SuccessOrExit(err = commandObj->PrepareCommand(path));
318319
VerifyOrExit((writer = commandObj->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE);
@@ -346,7 +347,7 @@ bool emberAfScenesClusterStoreSceneCallback(app::CommandHandler * commandObj, co
346347
if (emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST || emberAfCurrentCommand()->type == EMBER_INCOMING_UNICAST_REPLY)
347348
{
348349
{
349-
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_STORE_SCENE_RESPONSE_COMMAND_ID };
350+
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, StoreSceneResponse::Id };
350351
TLV::TLVWriter * writer = nullptr;
351352
SuccessOrExit(err = commandObj->PrepareCommand(path));
352353
VerifyOrExit((writer = commandObj->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE);
@@ -441,7 +442,7 @@ bool emberAfScenesClusterGetSceneMembershipCallback(app::CommandHandler * comman
441442
}
442443

443444
{
444-
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_GET_SCENE_MEMBERSHIP_RESPONSE_COMMAND_ID };
445+
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, GetSceneMembershipResponse::Id };
445446
TLV::TLVWriter * writer = nullptr;
446447
SuccessOrExit(err = commandObj->PrepareCommand(path));
447448
VerifyOrExit((writer = commandObj->GetCommandDataIBTLVWriter()) != nullptr, err = CHIP_ERROR_INCORRECT_STATE);
@@ -724,7 +725,7 @@ bool emberAfPluginScenesServerParseAddScene(
724725
CHIP_ERROR err = CHIP_NO_ERROR;
725726
EmberAfSceneTableEntry entry;
726727
EmberAfStatus status;
727-
bool enhanced = (cmd->commandId == ZCL_ENHANCED_ADD_SCENE_COMMAND_ID);
728+
bool enhanced = (cmd->commandId == EnhancedAddScene::Id);
728729
auto fabricIndex = commandObj->GetAccessingFabricIndex();
729730
EndpointId endpoint = cmd->apsFrame->destinationEndpoint;
730731
uint8_t i, index = EMBER_AF_SCENE_TABLE_NULL_INDEX;
@@ -1033,10 +1034,10 @@ bool emberAfPluginScenesServerParseAddScene(
10331034
return true;
10341035
}
10351036
{
1036-
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_ADD_SCENE_RESPONSE_COMMAND_ID };
1037+
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, AddSceneResponse::Id };
10371038
if (enhanced)
10381039
{
1039-
path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_ENHANCED_ADD_SCENE_RESPONSE_COMMAND_ID };
1040+
path = { emberAfCurrentEndpoint(), Scenes::Id, EnhancedAddSceneResponse::Id };
10401041
}
10411042
TLV::TLVWriter * writer = nullptr;
10421043
SuccessOrExit(err = commandObj->PrepareCommand(path));
@@ -1061,7 +1062,7 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c
10611062
CHIP_ERROR err = CHIP_NO_ERROR;
10621063
EmberAfSceneTableEntry entry = {};
10631064
EmberAfStatus status = EMBER_ZCL_STATUS_NOT_FOUND;
1064-
bool enhanced = (cmd->commandId == ZCL_ENHANCED_VIEW_SCENE_COMMAND_ID);
1065+
bool enhanced = (cmd->commandId == EnhancedViewScene::Id);
10651066
FabricIndex fabricIndex = commandObj->GetAccessingFabricIndex();
10661067
EndpointId endpoint = cmd->apsFrame->destinationEndpoint;
10671068

@@ -1089,10 +1090,10 @@ bool emberAfPluginScenesServerParseViewScene(app::CommandHandler * commandObj, c
10891090
// The status, group id, and scene id are always included in the response, but
10901091
// the transition time, name, and extension fields are only included if the
10911092
// scene was found.
1092-
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_VIEW_SCENE_RESPONSE_COMMAND_ID };
1093+
app::ConcreteCommandPath path = { emberAfCurrentEndpoint(), Scenes::Id, ViewSceneResponse::Id };
10931094
if (enhanced)
10941095
{
1095-
path = { emberAfCurrentEndpoint(), Scenes::Id, ZCL_ENHANCED_VIEW_SCENE_RESPONSE_COMMAND_ID };
1096+
path = { emberAfCurrentEndpoint(), Scenes::Id, EnhancedViewSceneResponse::Id };
10961097
}
10971098
TLV::TLVWriter * writer = nullptr;
10981099
SuccessOrExit(err = commandObj->PrepareCommand(path));

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

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <app-common/zap-generated/attributes/Accessors.h>
2626
#include <app-common/zap-generated/callback.h>
2727
#include <app-common/zap-generated/cluster-objects.h>
28-
#include <app-common/zap-generated/command-id.h>
2928
#include <app-common/zap-generated/enums.h>
3029
#include <app-common/zap-generated/ids/Attributes.h>
3130
#include <app/CommandHandler.h>

src/app/clusters/thermostat-user-interface-configuration-server/thermostat-user-interface-configuration-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <app-common/zap-generated/attributes/Accessors.h>
99
#include <app-common/zap-generated/callback.h>
1010
#include <app-common/zap-generated/cluster-objects.h>
11-
#include <app-common/zap-generated/command-id.h>
1211
#include <app-common/zap-generated/enums.h>
1312
#include <app-common/zap-generated/ids/Attributes.h>
1413
#include <app/CommandHandler.h>

src/app/clusters/window-covering-server/window-covering-server.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <app-common/zap-generated/attribute-id.h>
2121
#include <app-common/zap-generated/attributes/Accessors.h>
2222
#include <app-common/zap-generated/cluster-objects.h>
23-
#include <app-common/zap-generated/command-id.h>
2423
#include <app/CommandHandler.h>
2524
#include <app/ConcreteCommandPath.h>
2625
#include <app/reporting/reporting.h>

src/app/common/templates/templates.json

-5
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@
6262
"name": "ZCL callback header",
6363
"output": "callback.h"
6464
},
65-
{
66-
"path": "../../zap-templates/templates/app/command-id.zapt",
67-
"name": "ZCL command-id header",
68-
"output": "command-id.h"
69-
},
7065
{
7166
"path": "../../zap-templates/templates/app/enums.zapt",
7267
"name": "ZCL enums header",

src/app/util/util.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include "app/util/common.h"
1919
#include <app-common/zap-generated/attribute-id.h>
2020
#include <app-common/zap-generated/attribute-type.h>
21-
#include <app-common/zap-generated/command-id.h>
2221
#include <app-common/zap-generated/ids/Clusters.h>
2322
#include <app-common/zap-generated/print-cluster.h>
2423
#include <app/util/af-event.h>

src/app/zap-templates/templates/app/cluster-id.zapt

-13
This file was deleted.

src/app/zap-templates/templates/app/command-id.zapt

-19
This file was deleted.

0 commit comments

Comments
 (0)