Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / examples / lock-app / efr32 / include / AppEvent.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    Copyright (c) 2018 Nest Labs, Inc.
5  *    All rights reserved.
6  *
7  *    Licensed under the Apache License, Version 2.0 (the "License");
8  *    you may not use this file except in compliance with the License.
9  *    You may obtain a copy of the License at
10  *
11  *        http://www.apache.org/licenses/LICENSE-2.0
12  *
13  *    Unless required by applicable law or agreed to in writing, software
14  *    distributed under the License is distributed on an "AS IS" BASIS,
15  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  *    See the License for the specific language governing permissions and
17  *    limitations under the License.
18  */
19
20 #pragma once
21
22 struct AppEvent;
23 typedef void (*EventHandler)(AppEvent *);
24
25 struct AppEvent
26 {
27     enum AppEventTypes
28     {
29         kEventType_Button = 0,
30         kEventType_Timer,
31         kEventType_Lock,
32         kEventType_Install,
33     };
34
35     uint16_t Type;
36
37     union
38     {
39         struct
40         {
41             uint8_t ButtonIdx;
42             uint8_t Action;
43         } ButtonEvent;
44         struct
45         {
46             void * Context;
47         } TimerEvent;
48         struct
49         {
50             uint8_t Action;
51             int32_t Actor;
52         } LockEvent;
53     };
54
55     EventHandler Handler;
56 };