Apply Upstream code (2021-03-15)
[platform/upstream/connectedhomeip.git] / src / app / zap-templates / templates / app / CHIPClientCallbacks.zapt
1 {{> header}}
2
3 #pragma once
4
5 #include <inttypes.h>
6 #include <lib/support/Span.h>
7
8 // Global Response Callbacks
9 typedef void (*DefaultSuccessCallback)(void * context);
10 typedef void (*DefaultFailureCallback)(void * context, uint8_t status);
11 typedef void (*BooleanAttributeCallback)(void * context, bool value);
12 typedef void (*Int8uAttributeCallback)(void * context, uint8_t value);
13 typedef void (*Int8sAttributeCallback)(void * context, int8_t value);
14 typedef void (*Int16uAttributeCallback)(void * context, uint16_t value);
15 typedef void (*Int16sAttributeCallback)(void * context, int16_t value);
16 typedef void (*Int32uAttributeCallback)(void * context, uint32_t value);
17 typedef void (*Int32sAttributeCallback)(void * context, int32_t value);
18 typedef void (*Int64uAttributeCallback)(void * context, uint64_t value);
19 typedef void (*Int64sAttributeCallback)(void * context, int64_t value);
20 typedef void (*StringAttributeCallback)(void * context, const chip::ByteSpan value);
21 typedef void (*ReadReportingConfigurationReportedCallback)(void* context, uint16_t minInterval, uint16_t maxInterval);
22 typedef void (*ReadReportingConfigurationReceivedCallback)(void* context, uint16_t timeout);
23
24 // Cluster Specific Response Callbacks
25 {{#all_user_clusters}}
26 {{#if (isClient side) }}
27 {{#if (user_cluster_has_enabled_command name side)}}
28 {{#all_user_cluster_commands}}
29 {{#if (isStrEqual clusterName parent.name)}}
30 {{#if (isCommandAvailable parent.side incoming outgoing commandSource name)}}
31 typedef void (*{{asCamelCased parent.name false}}Cluster{{asCamelCased name false}}Callback)(void * context{{#zcl_command_arguments}}{{#unless (isStrEqual label "status")}}, {{asUnderlyingZclType type}} {{asSymbol label}}{{/unless}}{{/zcl_command_arguments}});
32 {{/if}}
33 {{/if}}
34 {{/all_user_cluster_commands}}
35 {{/if}}
36 {{/if}}
37 {{/all_user_clusters}}