|
14 | 14 | #include <commands/clusters/ReportCommandBridge.h>
|
15 | 15 | #include <commands/clusters/WriteAttributeCommandBridge.h>
|
16 | 16 | #include <app-common/zap-generated/cluster-objects.h>
|
| 17 | +#include <app-common/zap-generated/ids/Clusters.h> |
| 18 | +#include <app-common/zap-generated/ids/Commands.h> |
17 | 19 |
|
18 | 20 | {{> clusters_header}}
|
19 | 21 |
|
@@ -52,7 +54,10 @@ public:
|
52 | 54 |
|
53 | 55 | CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
|
54 | 56 | {
|
55 |
| - ChipLogProgress(chipTool, "Sending cluster ({{asHex parent.code 8}}) command ({{asHex code 8}}) on endpoint %u", endpointId); |
| 57 | + constexpr chip::ClusterId clusterId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id; |
| 58 | + constexpr chip::CommandId commandId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Commands::{{asUpperCamelCase name}}::Id; |
| 59 | + |
| 60 | + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); |
56 | 61 |
|
57 | 62 | dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
|
58 | 63 | __auto_type * cluster = [[MTRBaseCluster{{asUpperCamelCase parent.name preserveAcronyms=true}} alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
|
@@ -127,7 +132,10 @@ public:
|
127 | 132 |
|
128 | 133 | CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
|
129 | 134 | {
|
130 |
| - ChipLogProgress(chipTool, "Sending cluster ({{asHex parent.code 8}}) ReadAttribute ({{asHex code 8}}) on endpoint %u", endpointId); |
| 135 | + constexpr chip::ClusterId clusterId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id; |
| 136 | + constexpr chip::AttributeId attributeId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::Id; |
| 137 | + |
| 138 | + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); |
131 | 139 |
|
132 | 140 | dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
|
133 | 141 | __auto_type * cluster = [[MTRBase{{>cluster}} alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
|
@@ -180,7 +188,10 @@ public:
|
180 | 188 |
|
181 | 189 | CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
|
182 | 190 | {
|
183 |
| - ChipLogProgress(chipTool, "Sending cluster ({{asHex parent.code 8}}) WriteAttribute ({{asHex code 8}}) on endpoint %u", endpointId); |
| 191 | + constexpr chip::ClusterId clusterId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id; |
| 192 | + constexpr chip::AttributeId attributeId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::Id; |
| 193 | + |
| 194 | + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); |
184 | 195 | dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
|
185 | 196 | __auto_type * cluster = [[MTRBase{{>cluster}} alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
|
186 | 197 | __auto_type * params = [[MTRWriteParams alloc] init];
|
@@ -234,7 +245,10 @@ public:
|
234 | 245 |
|
235 | 246 | CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override
|
236 | 247 | {
|
237 |
| - ChipLogProgress(chipTool, "Sending cluster ({{asHex parent.code 8}}) ReportAttribute ({{asHex code 8}}) on endpoint %u", endpointId); |
| 248 | + constexpr chip::ClusterId clusterId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Id; |
| 249 | + constexpr chip::CommandId attributeId = chip::app::Clusters::{{asUpperCamelCase parent.name}}::Attributes::{{asUpperCamelCase name}}::Id; |
| 250 | + |
| 251 | + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); |
238 | 252 | dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL);
|
239 | 253 | __auto_type * cluster = [[MTRBase{{>cluster}} alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue];
|
240 | 254 | __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)];
|
|
0 commit comments