Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / platform / Linux / CHIPDevicePlatformEvent.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *    Unless required by applicable law or agreed to in writing, software
12  *    distributed under the License is distributed on an "AS IS" BASIS,
13  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *    See the License for the specific language governing permissions and
15  *    limitations under the License.
16  */
17
18 /**
19  *    @file
20  *          Defines platform-specific event types and data for the chip
21  *          Device Layer on Linux platforms.
22  */
23
24 #pragma once
25
26 #include <platform/CHIPDeviceEvent.h>
27
28 namespace chip {
29 namespace DeviceLayer {
30
31 namespace DeviceEventType {
32
33 /**
34  * Enumerates Linux platform-specific event types that are visible to the application.
35  */
36 enum PublicPlatformSpecificEventTypes
37 {
38     /* None currently defined */
39 };
40
41 /**
42  * Enumerates Linux platform-specific event types that are internal to the chip Device Layer.
43  */
44 enum InternalPlatformSpecificEventTypes
45 {
46     kPlatformLinuxEvent = kRange_InternalPlatformSpecific,
47     kPlatformLinuxBLECentralConnected,
48     kPlatformLinuxBLECentralConnectFailed,
49     kPlatformLinuxBLEWriteComplete,
50     kPlatformLinuxBLESubscribeOpComplete,
51     kPlatformLinuxBLEIndicationReceived,
52     kPlatformLinuxBLEC1WriteEvent,
53     kPlatformLinuxBLEOutOfBuffersEvent,
54     kPlatformLinuxBLEPeripheralRegisterAppComplete,
55     kPlatformLinuxBLEPeripheralAdvConfiguredComplete,
56     kPlatformLinuxBLEPeripheralAdvStartComplete,
57     kPlatformLinuxBLEPeripheralAdvStopComplete
58 };
59
60 } // namespace DeviceEventType
61
62 /**
63  * Represents platform-specific event information for Linux platforms.
64  */
65 struct ChipDevicePlatformEvent
66 {
67     union
68     {
69         struct
70         {
71             BLE_CONNECTION_OBJECT mConnection;
72         } BLECentralConnected;
73         struct
74         {
75             CHIP_ERROR mError;
76         } BLECentralConnectFailed;
77         struct
78         {
79             BLE_CONNECTION_OBJECT mConnection;
80         } BLEWriteComplete;
81         struct
82         {
83             BLE_CONNECTION_OBJECT mConnection;
84             bool mIsSubscribed;
85         } BLESubscribeOpComplete;
86         struct
87         {
88             BLE_CONNECTION_OBJECT mConnection;
89             chip::System::PacketBuffer * mData;
90         } BLEIndicationReceived;
91         struct
92         {
93             bool mIsSuccess;
94             void * mpAppstate;
95         } BLEPeripheralRegisterAppComplete;
96         struct
97         {
98             bool mIsSuccess;
99             void * mpAppstate;
100         } BLEPeripheralAdvConfiguredComplete;
101         struct
102         {
103             bool mIsSuccess;
104             void * mpAppstate;
105         } BLEPeripheralAdvStartComplete;
106         struct
107         {
108             bool mIsSuccess;
109             void * mpAppstate;
110         } BLEPeripheralAdvStopComplete;
111     };
112 };
113
114 } // namespace DeviceLayer
115 } // namespace chip