• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 com {
31 namespace android {
32 namespace server {
33 namespace wifi {
34 namespace wificond {
35 
36 // This is the class to represent a scan result for wificond internal use.
37 class NativeScanResult : public ::android::Parcelable {
38  public:
39   NativeScanResult() = default;
40   NativeScanResult(std::vector<uint8_t>& ssid,
41                    std::array<uint8_t, ETH_ALEN>& bssid,
42                    std::vector<uint8_t>& info_element,
43                    uint32_t frequency,
44                    int32_t signal_mbm,
45                    uint64_t tsf,
46                    uint16_t capability,
47                    bool associated,
48                    std::vector<RadioChainInfo>& radio_chain_infos);
49   ::android::status_t writeToParcel(::android::Parcel* parcel) const override;
50   ::android::status_t readFromParcel(const ::android::Parcel* parcel) override;
51 
52   void DebugLog();
53 
54   // SSID of the BSS.
55   std::vector<uint8_t> ssid;
56   // BSSID of the BSS.
57   std::array<uint8_t, ETH_ALEN> bssid;
58   // Binary array containing the raw information elements from the probe
59   // response/beacon.
60   std::vector<uint8_t> info_element;
61   // Frequency in MHz.
62   uint32_t frequency;
63   // Signal strength of probe response/beacon in (100 * dBm).
64   int32_t signal_mbm;
65   // TSF of the received probe response/beacon.
66   uint64_t tsf;
67   // This is a bit mask describing the capabilities of a BSS.
68   // See IEEE Std 802.11: 8.4.1.4
69   // Bit 0 - ESS
70   // Bit 1 - IBSS
71   // Bit 2 - CF Pollable
72   // Bit 3 - CF-Poll Request
73   // Bit 4 - Privacy
74   // Bit 5 - Short Preamble
75   // Bit 6 - PBCC
76   // Bit 7 - Channel Agility
77   // Bit 8 - Spectrum Mgmt
78   // Bit 9 - QoS
79   // Bit 10 - Short Slot Time
80   // Bit 11 - APSD
81   // Bit 12 - Radio Measurement
82   // Bit 13 - DSSS-OFDM
83   // Bit 14 - Delayed Block Ack
84   // Bit 15 - Immediate Block Ack
85   uint16_t capability;
86   bool associated;
87   std::vector<RadioChainInfo> radio_chain_infos;
88 };
89 
90 }  // namespace wificond
91 }  // namespace wifi
92 }  // namespace server
93 }  // namespace android
94 }  // namespace com
95 
96 #endif  // WIFICOND_SCANNING_SCAN_RESULT_H_
97