1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 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 */ 15 #ifndef OHOS_WIFI_EVENT_CALLBACK_H 16 #define OHOS_WIFI_EVENT_CALLBACK_H 17 18 #include <string> 19 #include <functional> 20 21 namespace OHOS { 22 namespace Wifi { 23 struct AssocRejectInfo { 24 std::string bssid{""}; 25 int statusCode{0}; 26 int timeOut{0}; 27 }; 28 struct WifiEventCallback { 29 std::function<void(int, int, const std::string &, int)> onConnectChanged; 30 std::function<void(const std::string &, const std::string &)> onBssidChanged; 31 std::function<void(int, const std::string &)> onWpaStateChanged; 32 std::function<void(const std::string &)> onWpaSsidWrongKey; 33 std::function<void(int)> onWpsOverlap; 34 std::function<void(int)> onWpsTimeOut; 35 std::function<void(void)> onWpaAuthTimeout; 36 std::function<void(int)> onWpaConnectionFull; 37 std::function<void(const AssocRejectInfo &)> onWpaConnectionReject; 38 std::function<void(const std::string &)> onEventStaNotify; 39 std::function<void(int, const std::string &)> onReportDisConnectReason; 40 }; 41 42 enum class WpaEventCallback { 43 HILINK_NUM = 1, 44 EAP_SIM_NUM = 2, 45 CSA_CHSWITCH_NUM = 3, 46 CHR_EVENT_NUM = 4, 47 MLO_STATE_NUM = 5, 48 CUSTOMIZED_EAP_AUTH = 6, 49 }; 50 51 } // namespace Wifi 52 } // namespace OHOS 53 54 #endif