1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * Description: wifi_event.h 的头文件 15 */ 16 17 18 #ifndef SERVICE_WIFI_EVENT_C_H 19 #define SERVICE_WIFI_EVENT_C_H 20 21 #include "wifi_linked_info.h" 22 #include "station_info.h" 23 #include "wifi_p2p_config.h" 24 25 #ifdef __cplusplus 26 #if __cplusplus 27 extern "C" { 28 #endif 29 #endif 30 31 /** 32 * @defgroup middleware_service_wifi_evevt WiFi Event 33 * @ingroup middleware_service_wifi 34 * @{ 35 */ 36 37 /** 38 * @if Eng 39 * @brief The pointer to a WiFi event callback for station and hotspot connection, disconnection, or scan. 40 * @else 41 * @brief 指向用于Sta和Hotspot连接、断开连接或扫描的WiFi事件回调的指针。 42 * @endif 43 */ 44 typedef struct { 45 /*!< @if Eng Connection state change. 46 @else 连接状态改变。 @endif */ 47 void (*wifi_event_connection_changed)(int32_t state, const wifi_linked_info_stru *info, int32_t reason_code); 48 /*!< @if Eng Scan state change. 49 @else 扫描状态改变。 @endif */ 50 void (*wifi_event_scan_state_changed)(int32_t state, int32_t size); 51 /*!< @if Eng Hotspot state change. 52 @else Hotspot状态改变。 @endif */ 53 void (*wifi_event_softap_state_changed)(int32_t state); 54 /*!< @if Eng Station connected. 55 @else Station连接。 @endif */ 56 void (*wifi_event_softap_sta_join)(const wifi_sta_info_stru *info); 57 /*!< @if Eng Station disconnected. 58 @else Station断连。 @endif */ 59 void (*wifi_event_softap_sta_leave)(const wifi_sta_info_stru *info); 60 /*!< @if Eng P2P recive connect requset. 61 @else P2P接收连接请求。 @endif */ 62 void (*wifi_event_p2p_receive_connect)(const uint8_t *bssid, int8_t wps_method); 63 /*!< @if Eng P2P go negotiation result. 64 @else P2P GO协商结果。 @endif */ 65 void (*wifi_event_p2p_go_neg_result)(int32_t state, int32_t mode); 66 /*!< @if Eng P2P go start states change. 67 @else P2P GO建立结果。 @endif */ 68 void (*wifi_event_p2p_go_start)(int32_t state); 69 /*!< @if Eng P2P Invitation Result. 70 @else P2P邀请结果。 @endif */ 71 void (*wifi_event_p2p_invitation_result)(int32_t state); 72 /*!< @if Eng P2P gc connection change. 73 @else P2P Gc关联结果。 @endif */ 74 void (*wifi_event_p2p_gc_connection_changed)(int32_t state, const p2p_status_info_stru *status); 75 /*!< @if Eng P2P go connection change. 76 @else P2P GO关联结果。 @endif */ 77 void (*wifi_event_p2p_go_connection_changed)(int32_t state, const p2p_client_info_stru *client); 78 /*!< @if Eng WPS connect result. 79 @else WPS关联结果。 @endif */ 80 void (*wifi_event_wps_result)(int32_t state, wifi_if_type_enum wifi_if_type); 81 } wifi_event_stru; 82 83 /** 84 * @if Eng 85 * @brief States in WiFi events. 86 * @else 87 * @brief WiFi事件状态。 88 * @endif 89 */ 90 typedef enum { 91 WIFI_STATE_NOT_AVALIABLE = 0, /*!< @if Eng Unavailable state. 92 @else 不可用状态。 @endif */ 93 WIFI_STATE_AVALIABLE /*!< @if Eng Available state. 94 @else 可用状态。 @endif */ 95 } wifi_event_state_enum; 96 97 /** 98 * @} 99 */ 100 101 #ifdef __cplusplus 102 #if __cplusplus 103 } 104 #endif 105 #endif 106 107 #endif // SERVICE_WIFI_EVENT_C_H 108