Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / app / zap-templates / templates / app / af-gen-event.zapt
1 {{> header}}
2
3 // #TODO : This template wasn't tested in any way with CHIP
4 // Might need a zap submodule update and / or other fixes to make it work.
5 // ISSUE : #3637
6
7
8 #pragma once
9
10 #define EMBER_AF_GENERATED_UC_EVENTS_DEF \
11 {{#user_endpoint_types}}
12         {{#user_clusters}}
13                 {{#if (is_enabled enabled)}}
14                         {{#template_options category="tick_events"}}
15                                 {{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
16                                 sl_zigbee_event_t {{optionCode}}Event{{endpoint_type_identifier ../../endpointTypeId}}; \
17                                 {{/if}}
18                         {{/template_options}}
19                 {{/if}}
20         {{/user_clusters}}
21 {{/user_endpoint_types}}
22 {{#all_user_clusters}}
23         {{#template_options category="generic_events"}}
24                 {{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
25                         sl_zigbee_event_t {{optionCode}}EndpointEvents[{{user_endpoint_count_by_cluster ../id ../side}}]; \
26                 {{/if}}
27         {{/template_options}}
28 {{/all_user_clusters}}
29
30
31 #define EMBER_AF_GENERATED_UC_EVENTS_INIT \
32 {{#all_user_clusters}}
33         {{#if (is_enabled enabled)}}
34                 {{#template_options category="tick_events"}}
35                         {{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
36                         extern void {{optionCode}}(uint8_t enpoint); \
37                         {{/if}}
38                 {{/template_options}}
39         {{/if}}
40 {{/all_user_clusters}}
41 {{#user_endpoint_types}}
42         {{#user_clusters}}
43                 {{#if (is_enabled enabled)}}
44                         {{#template_options category="tick_events"}}
45                                 {{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
46                                 sl_zigbee_endpoint_event_init(&{{optionCode}}Event{{endpoint_type_identifier ../../endpointTypeId}}, {{optionCode}}, {{endpoint_type_identifier ../../endpointTypeId}}); \
47                                 {{/if}}
48                         {{/template_options}}
49                 {{/if}}
50         {{/user_clusters}}
51 {{/user_endpoint_types}}
52 {{#all_user_clusters}}
53         {{#if (is_enabled enabled)}}
54                 {{#template_options category="generic_events"}}
55                         {{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
56                         extern void {{optionCode}}EndpointEventHandler(uint8_t enpoint); \
57                         {{/if}}
58                 {{/template_options}}
59         {{/if}}
60 {{/all_user_clusters}}
61 {{#user_endpoint_types}}
62         {{#user_clusters}}
63                 {{#if (is_enabled enabled)}}
64                         {{#template_options category="generic_events"}}
65                                 {{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
66                                 sl_zigbee_endpoint_event_init(&{{optionCode}}EndpointEvents[{{endpoint_type_identifier ../../endpointTypeId}}], {{optionCode}}EndpointEventHandler, {{endpoint_type_identifier ../../endpointTypeId}}); \
67                                 {{/if}}
68                         {{/template_options}}
69                 {{/if}}
70         {{/user_clusters}}
71 {{/user_endpoint_types}}
72
73 // sl_zigbee_event_context_t structs used to populate the sli_zigbee_app_event_context table
74 #define EMBER_AF_GENERATED_UC_EVENT_CONTEXT \
75 {{#user_endpoint_types}}
76         {{#user_clusters}}
77                 {{#if (is_enabled enabled)}}
78                         {{#template_options category="tick_events"}}
79                                 {{#if (is_lowercase_equal (concatenate ../name ../side) optionLabel)~}}
80                                 { {{endpoint_type_identifier ../../endpointTypeId}}, {{asHex ../code}}, {{#if (is_client ../side)}}true{{else}}false{{/if}}, EMBER_AF_LONG_POLL, EMBER_AF_OK_TO_SLEEP, &{{optionCode}}Event{{endpoint_type_identifier ../../endpointTypeId}} },     \
81                                 {{/if}}
82                         {{/template_options}}
83                 {{/if}}
84         {{/user_clusters}}
85 {{/user_endpoint_types}}