1 /* 2 * Copyright (C) 2022 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 16 #ifndef OHOS_WIFI_COMMON_MSG_H 17 #define OHOS_WIFI_COMMON_MSG_H 18 #include <string> 19 20 namespace OHOS { 21 namespace Wifi { 22 enum class ServiceType { 23 DEFAULT = 0, 24 WIFI_EXT = 1, 25 }; 26 27 constexpr int RANDOM_DEVICE_ADDRESS = 0; 28 constexpr int REAL_DEVICE_ADDRESS = 1; 29 30 struct WifiMacAddrInfo { 31 std::string bssid; /* mac address */ 32 int bssidType; /* mac address type */ 33 bool operator == (const WifiMacAddrInfo& mac) 34 { 35 if ((bssid == mac.bssid) && (bssidType == mac.bssidType)) { 36 return true; 37 } 38 return false; 39 } 40 bool operator != (const WifiMacAddrInfo& mac) 41 { 42 if ((bssid != mac.bssid) || (bssidType != mac.bssidType)) { 43 return true; 44 } 45 return false; 46 } 47 bool operator < (const WifiMacAddrInfo& mac) const 48 { 49 if (bssid == mac.bssid) { 50 return bssidType < mac.bssidType; 51 } 52 return bssid < mac.bssid; 53 } 54 WifiMacAddrInfo& operator = (const WifiMacAddrInfo& mac) 55 { 56 bssid = mac.bssid; 57 bssidType = mac.bssidType; 58 return *this; 59 } 60 }; 61 } // namespace Wifi 62 } // namespace OHOS 63 #endif