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