c2bf73b40e3036e5854cabe4017376005503aed5
[platform/upstream/connectedhomeip.git] / src / app / zap-templates / templates / chip / python-ChipDeviceController-ClusterCommands.zapt
1 {{> header}}
2
3 #include <core/CHIPCore.h>
4
5 #include <app/CommandSender.h>
6 #include <app/InteractionModelEngine.h>
7 #include <lib/support/Span.h>
8 #include <support/ReturnMacros.h>
9
10 #include <controller/CHIPClusters.h>
11 #include <controller/CHIPDevice.h>
12
13 using namespace chip;
14 using namespace chip::app;
15
16 extern "C" {
17
18 {{#chip_server_clusters}}
19 // Cluster {{asCamelCased name false}}
20 {{#chip_server_cluster_commands}}
21 CHIP_ERROR chip_ime_AppendCommand_{{asCamelCased clusterName false}}_{{asCamelCased name false}}(chip::Controller::Device * device, chip::EndpointId ZCLendpointId, chip::GroupId ZCLgroupId{{#chip_server_cluster_command_arguments}}, {{#if (isByteString type)}}const uint8_t * {{asCamelCased label}}, uint32_t {{asCamelCased label}}_Len{{else}}{{chipType}} {{asCamelCased label}}{{/if}}{{/chip_server_cluster_command_arguments}})
22 {
23     VerifyOrReturnError(device != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
24     chip::Controller::{{asCamelCased clusterName false}}Cluster cluster{{asCamelCased clusterName false}};
25     (void) ZCLgroupId;
26     cluster{{asCamelCased clusterName false}}.Associate(device, ZCLendpointId);
27     return cluster{{asCamelCased clusterName false}}.{{asCamelCased name false}}(nullptr, nullptr{{#chip_server_cluster_command_arguments}}, {{#if (isByteString type)}}chip::ByteSpan({{asCamelCased label}}, {{asCamelCased label}}_Len){{else}}{{asCamelCased label}}{{/if}}
28     {{/chip_server_cluster_command_arguments}});
29 }
30 {{/chip_server_cluster_commands}}
31 // End of Cluster {{asCamelCased name false}}
32
33 {{/chip_server_clusters}}
34
35 }