1 /* 2 * Copyright (C) 2016 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef WIFICOND_SCANNING_SCAN_RESULT_H_ 18 #define WIFICOND_SCANNING_SCAN_RESULT_H_ 19 20 #include <array> 21 #include <vector> 22 23 #include <linux/if_ether.h> 24 25 #include <binder/Parcel.h> 26 #include <binder/Parcelable.h> 27 28 #include "wificond/scanning/radio_chain_info.h" 29 30 namespace android { 31 namespace net { 32 namespace wifi { 33 namespace nl80211 { 34 35 // This is the class to represent a scan result for wificond internal use. 36 class NativeScanResult : public ::android::Parcelable { 37 public: 38 NativeScanResult() = default; 39 NativeScanResult(std::vector<uint8_t>& ssid, 40 std::array<uint8_t, ETH_ALEN>& bssid, 41 std::vector<uint8_t>& info_element, 42 uint32_t frequency, 43 int32_t signal_mbm, 44 uint64_t tsf, 45 uint16_t capability, 46 bool associated, 47 std::vector<RadioChainInfo>& radio_chain_infos); 48 ::android::status_t writeToParcel(::android::Parcel* parcel) const override; 49 ::android::status_t readFromParcel(const ::android::Parcel* parcel) override; 50 51 void DebugLog(); 52 53 // SSID of the BSS. 54 std::vector<uint8_t> ssid; 55 // BSSID of the BSS. 56 std::array<uint8_t, ETH_ALEN> bssid; 57 // Binary array containing the raw information elements from the probe 58 // response/beacon. 59 std::vector<uint8_t> info_element; 60 // Frequency in MHz. 61 uint32_t frequency; 62 // Signal strength of probe response/beacon in (100 * dBm). 63 int32_t signal_mbm; 64 // TSF of the received probe response/beacon. 65 uint64_t tsf; 66 // This is a bit mask describing the capabilities of a BSS. 67 // See IEEE Std 802.11: 8.4.1.4 68 // Bit 0 - ESS 69 // Bit 1 - IBSS 70 // Bit 2 - CF Pollable 71 // Bit 3 - CF-Poll Request 72 // Bit 4 - Privacy 73 // Bit 5 - Short Preamble 74 // Bit 6 - PBCC 75 // Bit 7 - Channel Agility 76 // Bit 8 - Spectrum Mgmt 77 // Bit 9 - QoS 78 // Bit 10 - Short Slot Time 79 // Bit 11 - APSD 80 // Bit 12 - Radio Measurement 81 // Bit 13 - DSSS-OFDM 82 // Bit 14 - Delayed Block Ack 83 // Bit 15 - Immediate Block Ack 84 uint16_t capability; 85 bool associated; 86 std::vector<RadioChainInfo> radio_chain_infos; 87 }; 88 89 } // namespace nl80211 90 } // namespace wifi 91 } // namespace net 92 } // namespace android 93 94 #endif // WIFICOND_SCANNING_SCAN_RESULT_H_ 95