• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 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 #include "device_wiphy_capabilities.h"
18 
19 #include <android-base/logging.h>
20 
21 #include "wificond/parcelable_utils.h"
22 
23 using android::status_t;
24 
25 namespace android {
26 namespace net {
27 namespace wifi {
28 namespace nl80211 {
29 
DeviceWiphyCapabilities()30 DeviceWiphyCapabilities::DeviceWiphyCapabilities() {
31   is80211nSupported_ = false;
32   is80211acSupported_ = false;
33   is80211axSupported_ = false;
34   is80211beSupported_ = false;
35   is160MhzSupported_ = false;
36   is80p80MhzSupported_ = false;
37   is320MhzSupported_ = false;
38   maxTxStreams_ = 1;
39   maxRxStreams_ = 1;
40 }
41 
writeToParcel(::android::Parcel * parcel) const42 status_t DeviceWiphyCapabilities::writeToParcel(::android::Parcel* parcel) const {
43   RETURN_IF_FAILED(parcel->writeBool(is80211nSupported_));
44   RETURN_IF_FAILED(parcel->writeBool(is80211acSupported_));
45   RETURN_IF_FAILED(parcel->writeBool(is80211axSupported_));
46   RETURN_IF_FAILED(parcel->writeBool(is80211beSupported_));
47   RETURN_IF_FAILED(parcel->writeBool(is160MhzSupported_ ));
48   RETURN_IF_FAILED(parcel->writeBool(is80p80MhzSupported_));
49   RETURN_IF_FAILED(parcel->writeBool(is320MhzSupported_ ));
50   RETURN_IF_FAILED(parcel->writeUint32(maxTxStreams_));
51   RETURN_IF_FAILED(parcel->writeUint32(maxRxStreams_));
52   return ::android::OK;
53 }
54 
readFromParcel(const::android::Parcel * parcel)55 status_t DeviceWiphyCapabilities::readFromParcel(const ::android::Parcel* parcel) {
56   RETURN_IF_FAILED(parcel->readBool(&is80211nSupported_));
57   RETURN_IF_FAILED(parcel->readBool(&is80211acSupported_));
58   RETURN_IF_FAILED(parcel->readBool(&is80211axSupported_));
59   RETURN_IF_FAILED(parcel->readBool(&is80211beSupported_));
60   RETURN_IF_FAILED(parcel->readBool(&is160MhzSupported_));
61   RETURN_IF_FAILED(parcel->readBool(&is80p80MhzSupported_));
62   RETURN_IF_FAILED(parcel->readBool(&is320MhzSupported_));
63   RETURN_IF_FAILED(parcel->readUint32(&maxTxStreams_));
64   RETURN_IF_FAILED(parcel->readUint32(&maxRxStreams_));
65 
66   return ::android::OK;
67 }
68 
69 }  // namespace nl80211
70 }  // namespace wifi
71 }  // namespace net
72 }  // namespace android
73