Apply Upstream code (2021-03-15)
[platform/upstream/connectedhomeip.git] / src / app / zap-templates / templates / chip / chip-zcl-zpro-codec-api.zapt
1 {{> header}}
2
3 // Prevent multiple inclusion
4 #pragma once
5
6 #include <app/util/basic-types.h>
7 #include <lib/support/Span.h>
8 #include <stdint.h>
9 #include <system/SystemPacketBuffer.h>
10
11 {{> clusters_header}}
12
13 {{#chip_server_clusters}}
14 {{> cluster_header}}
15
16 {{#chip_server_cluster_commands}}
17 /**
18  * @brief
19  *    Encode an {{asType name}} command for {{clusterName}} server into buffer including the APS frame
20  */
21 chip::System::PacketBufferHandle encode{{asCamelCased clusterName false}}Cluster{{asType name}}Command(uint8_t seqNum, chip::EndpointId destinationEndpoint{{#chip_server_cluster_command_arguments}}, {{chipType}} {{asCamelCased label}}{{/chip_server_cluster_command_arguments}});
22
23 {{/chip_server_cluster_commands}}
24 /**
25  * @brief
26  *    Encode a {{name}} server discover command into buffer including the APS frame
27  */
28 chip::System::PacketBufferHandle encode{{asCamelCased name false}}ClusterDiscoverAttributes(uint8_t seqNum, chip::EndpointId destinationEndpoint);
29
30 {{#chip_server_cluster_attributes}}
31 /**
32  * @brief
33  *    Encode a {{parent.name}} server read command for the {{name}} attribute into buffer including the APS frame
34  */
35 chip::System::PacketBufferHandle encode{{asCamelCased parent.name false}}ClusterRead{{asCamelCased name false}}Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint);
36
37 {{#if (isWritableAttribute)}}
38 /**
39  * @brief
40  *    Encode a {{parent.name}} server write command for the {{name}} attribute into buffer including the APS frame
41  */
42 chip::System::PacketBufferHandle encode{{asCamelCased parent.name false}}ClusterWrite{{asCamelCased name false}}Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, {{chipType}} {{asCamelCased name}});
43
44 {{/if}}
45 {{#if (isReportableAttribute)}}
46 /**
47  * @brief
48  *    Encode a {{parent.name}} server configure report command for the {{name}} attribute into buffer including the APS frame
49  */
50 chip::System::PacketBufferHandle encode{{asCamelCased parent.name false}}ClusterConfigure{{asCamelCased name false}}Attribute(uint8_t seqNum, chip::EndpointId destinationEndpoint, uint16_t minInterval, uint16_t maxInterval{{#unless (isDiscreteType)}}, {{chipType}} change{{/unless}});
51
52 {{/if}}
53 {{/chip_server_cluster_attributes}}
54 {{/chip_server_clusters}}