Skip to content

Commit 60b896d

Browse files
authored
[im] Add command obj to all cluster callbacks (#5994)
* [im] Add command object to ZCL callbacks * apCommandIbj -> commandObj * Fix new added clusters * Run Codegen * Fix dirty merge
1 parent 7d19916 commit 60b896d

File tree

82 files changed

+1971
-1943
lines changed

Some content is hidden

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

82 files changed

+1971
-1943
lines changed

examples/all-clusters-app/all-clusters-common/gen/IMClusterCommandHandler.cpp

+100-91
Large diffs are not rendered by default.

examples/all-clusters-app/all-clusters-common/gen/call-command-handler.cpp

+109-98
Large diffs are not rendered by default.

examples/all-clusters-app/all-clusters-common/gen/callback.h

+139-113
Large diffs are not rendered by default.

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "esp_log.h"
3333
#include "gen/attribute-id.h"
3434
#include "gen/cluster-id.h"
35+
#include <app/Command.h>
3536
#include <app/server/Mdns.h>
3637
#include <app/util/basic-types.h>
3738
#include <app/util/util.h>
@@ -174,7 +175,7 @@ void DeviceCallbacks::OnIdentifyPostAttributeChangeCallback(EndpointId endpointI
174175
return;
175176
}
176177

177-
bool emberAfBasicClusterMfgSpecificPingCallback(void)
178+
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj)
178179
{
179180
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
180181
return true;

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "af.h"
2323
#include "gen/attribute-id.h"
2424
#include "gen/cluster-id.h"
25+
#include <app/Command.h>
2526
#include <app/chip-zcl-zpro-codec.h>
2627
#include <app/server/Mdns.h>
2728
#include <app/util/af-types.h>
@@ -45,7 +46,7 @@ void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId
4546
uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value)
4647
{}
4748

48-
bool emberAfBasicClusterMfgSpecificPingCallback(void)
49+
bool emberAfBasicClusterMfgSpecificPingCallback(chip::app::Command * commandObj)
4950
{
5051
emberAfSendDefaultResponse(emberAfCurrentCommand(), EMBER_ZCL_STATUS_SUCCESS);
5152
return true;

examples/bridge-app/bridge-common/gen/IMClusterCommandHandler.cpp

+22-20
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
149149
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount)
150150
{
151151
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
152-
emberAfLevelControlClusterMoveCallback(moveMode, rate, optionMask, optionOverride);
152+
emberAfLevelControlClusterMoveCallback(apCommandObj, moveMode, rate, optionMask, optionOverride);
153153
}
154154
else
155155
{
@@ -264,7 +264,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
264264
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount)
265265
{
266266
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
267-
emberAfLevelControlClusterMoveToLevelCallback(level, transitionTime, optionMask, optionOverride);
267+
emberAfLevelControlClusterMoveToLevelCallback(apCommandObj, level, transitionTime, optionMask, optionOverride);
268268
}
269269
else
270270
{
@@ -347,7 +347,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
347347
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount)
348348
{
349349
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
350-
emberAfLevelControlClusterMoveToLevelWithOnOffCallback(level, transitionTime);
350+
emberAfLevelControlClusterMoveToLevelWithOnOffCallback(apCommandObj, level, transitionTime);
351351
}
352352
else
353353
{
@@ -430,7 +430,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
430430
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount)
431431
{
432432
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
433-
emberAfLevelControlClusterMoveWithOnOffCallback(moveMode, rate);
433+
emberAfLevelControlClusterMoveWithOnOffCallback(apCommandObj, moveMode, rate);
434434
}
435435
else
436436
{
@@ -561,7 +561,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
561561
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 5 == validArgumentCount)
562562
{
563563
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
564-
emberAfLevelControlClusterStepCallback(stepMode, stepSize, transitionTime, optionMask, optionOverride);
564+
emberAfLevelControlClusterStepCallback(apCommandObj, stepMode, stepSize, transitionTime, optionMask,
565+
optionOverride);
565566
}
566567
else
567568
{
@@ -660,7 +661,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
660661
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount)
661662
{
662663
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
663-
emberAfLevelControlClusterStepWithOnOffCallback(stepMode, stepSize, transitionTime);
664+
emberAfLevelControlClusterStepWithOnOffCallback(apCommandObj, stepMode, stepSize, transitionTime);
664665
}
665666
else
666667
{
@@ -743,7 +744,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
743744
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 2 == validArgumentCount)
744745
{
745746
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
746-
emberAfLevelControlClusterStopCallback(optionMask, optionOverride);
747+
emberAfLevelControlClusterStopCallback(apCommandObj, optionMask, optionOverride);
747748
}
748749
else
749750
{
@@ -758,7 +759,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
758759
case ZCL_STOP_WITH_ON_OFF_COMMAND_ID: {
759760

760761
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
761-
emberAfLevelControlClusterStopWithOnOffCallback();
762+
emberAfLevelControlClusterStopWithOnOffCallback(apCommandObj);
762763
break;
763764
}
764765
default: {
@@ -872,7 +873,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
872873
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount)
873874
{
874875
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
875-
emberAfNetworkCommissioningClusterAddThreadNetworkCallback(operationalDataset, breadcrumb, timeoutMs);
876+
emberAfNetworkCommissioningClusterAddThreadNetworkCallback(apCommandObj, operationalDataset, breadcrumb, timeoutMs);
876877
}
877878
else
878879
{
@@ -995,7 +996,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
995996
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount)
996997
{
997998
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
998-
emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(ssid, credentials, breadcrumb, timeoutMs);
999+
emberAfNetworkCommissioningClusterAddWiFiNetworkCallback(apCommandObj, ssid, credentials, breadcrumb, timeoutMs);
9991000
}
10001001
else
10011002
{
@@ -1098,7 +1099,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
10981099
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount)
10991100
{
11001101
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1101-
emberAfNetworkCommissioningClusterDisableNetworkCallback(networkID, breadcrumb, timeoutMs);
1102+
emberAfNetworkCommissioningClusterDisableNetworkCallback(apCommandObj, networkID, breadcrumb, timeoutMs);
11021103
}
11031104
else
11041105
{
@@ -1201,7 +1202,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
12011202
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount)
12021203
{
12031204
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1204-
emberAfNetworkCommissioningClusterEnableNetworkCallback(networkID, breadcrumb, timeoutMs);
1205+
emberAfNetworkCommissioningClusterEnableNetworkCallback(apCommandObj, networkID, breadcrumb, timeoutMs);
12051206
}
12061207
else
12071208
{
@@ -1268,7 +1269,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
12681269
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 1 == validArgumentCount)
12691270
{
12701271
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1271-
emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(timeoutMs);
1272+
emberAfNetworkCommissioningClusterGetLastNetworkCommissioningResultCallback(apCommandObj, timeoutMs);
12721273
}
12731274
else
12741275
{
@@ -1371,7 +1372,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
13711372
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount)
13721373
{
13731374
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1374-
emberAfNetworkCommissioningClusterRemoveNetworkCallback(NetworkID, Breadcrumb, TimeoutMs);
1375+
emberAfNetworkCommissioningClusterRemoveNetworkCallback(apCommandObj, NetworkID, Breadcrumb, TimeoutMs);
13751376
}
13761377
else
13771378
{
@@ -1474,7 +1475,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
14741475
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount)
14751476
{
14761477
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1477-
emberAfNetworkCommissioningClusterScanNetworksCallback(ssid, breadcrumb, timeoutMs);
1478+
emberAfNetworkCommissioningClusterScanNetworksCallback(apCommandObj, ssid, breadcrumb, timeoutMs);
14781479
}
14791480
else
14801481
{
@@ -1577,7 +1578,8 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
15771578
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 3 == validArgumentCount)
15781579
{
15791580
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1580-
emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(operationalDataset, breadcrumb, timeoutMs);
1581+
emberAfNetworkCommissioningClusterUpdateThreadNetworkCallback(apCommandObj, operationalDataset, breadcrumb,
1582+
timeoutMs);
15811583
}
15821584
else
15831585
{
@@ -1700,7 +1702,7 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
17001702
if (CHIP_NO_ERROR == TLVError && CHIP_NO_ERROR == TLVUnpackError && 4 == validArgumentCount)
17011703
{
17021704
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1703-
emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(ssid, credentials, breadcrumb, timeoutMs);
1705+
emberAfNetworkCommissioningClusterUpdateWiFiNetworkCallback(apCommandObj, ssid, credentials, breadcrumb, timeoutMs);
17041706
}
17051707
else
17061708
{
@@ -1735,19 +1737,19 @@ void DispatchServerCommand(app::Command * apCommandObj, CommandId aCommandId, En
17351737
case ZCL_OFF_COMMAND_ID: {
17361738

17371739
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1738-
emberAfOnOffClusterOffCallback();
1740+
emberAfOnOffClusterOffCallback(apCommandObj);
17391741
break;
17401742
}
17411743
case ZCL_ON_COMMAND_ID: {
17421744

17431745
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1744-
emberAfOnOffClusterOnCallback();
1746+
emberAfOnOffClusterOnCallback(apCommandObj);
17451747
break;
17461748
}
17471749
case ZCL_TOGGLE_COMMAND_ID: {
17481750

17491751
// TODO(#5098) We should pass the Command Object and EndpointId to the cluster callbacks.
1750-
emberAfOnOffClusterToggleCallback();
1752+
emberAfOnOffClusterToggleCallback(apCommandObj);
17511753
break;
17521754
}
17531755
default: {

0 commit comments

Comments
 (0)