Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / platform / ESP32 / CHIPDevicePlatformEvent.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 /**
21  *    @file
22  *          Defines platform-specific event types and data for the
23  *          CHIP Device Layer on the ESP32.
24  */
25
26 #pragma once
27
28 #include <platform/CHIPDeviceEvent.h>
29
30 #include <esp_event.h>
31
32 namespace chip {
33 namespace DeviceLayer {
34
35 namespace DeviceEventType {
36
37 /**
38  * Enumerates platform-specific event types that are visible to the application.
39  */
40 enum
41 {
42     kESPSystemEvent = kRange_PublicPlatformSpecific,
43 };
44
45 } // namespace DeviceEventType
46
47 /**
48  * Represents platform-specific event information for the ESP32 platform.
49  */
50 struct ChipDevicePlatformEvent final
51 {
52     union
53     {
54         struct
55         {
56             esp_event_base_t Base;
57             int32_t Id;
58             union
59             {
60                 ip_event_got_ip_t IpGotIp;
61                 ip_event_got_ip6_t IpGotIp6;
62                 ip_event_ap_staipassigned_t IpApStaIpAssigned;
63                 wifi_event_sta_scan_done_t WifiStaScanDone;
64                 wifi_event_sta_connected_t WifiStaConnected;
65                 wifi_event_sta_disconnected_t WifiStaDisconnected;
66                 wifi_event_sta_authmode_change_t WifiStaAuthModeChange;
67                 wifi_event_sta_wps_er_pin_t WifiStaWpsErPin;
68                 wifi_event_sta_wps_fail_reason_t WifiStaWpsErFailed;
69                 wifi_event_ap_staconnected_t WifiApStaConnected;
70                 wifi_event_ap_stadisconnected_t WifiApStaDisconnected;
71                 wifi_event_ap_probe_req_rx_t WifiApProbeReqRecved;
72             } Data;
73         } ESPSystemEvent;
74     };
75 };
76
77 } // namespace DeviceLayer
78 } // namespace chip