Roshan Pius | 3e2d671 | 2016-10-06 13:16:23 -0700 | [diff] [blame^] | 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 | #include "wifi_ap_iface.h" |
| 18 | |
| 19 | #include <android-base/logging.h> |
| 20 | |
| 21 | #include "failure_reason_util.h" |
| 22 | |
| 23 | namespace android { |
| 24 | namespace hardware { |
| 25 | namespace wifi { |
| 26 | namespace V1_0 { |
| 27 | namespace implementation { |
| 28 | |
| 29 | WifiApIface::WifiApIface(const std::string& ifname, |
| 30 | const std::weak_ptr<WifiLegacyHal> legacy_hal) |
| 31 | : ifname_(ifname), legacy_hal_(legacy_hal), is_valid_(true) {} |
| 32 | |
| 33 | void WifiApIface::invalidate() { |
| 34 | legacy_hal_.reset(); |
| 35 | is_valid_ = false; |
| 36 | } |
| 37 | |
| 38 | Return<void> WifiApIface::getName(getName_cb cb) { |
| 39 | hidl_string hidl_ifname; |
| 40 | hidl_ifname.setToExternal(ifname_.c_str(), ifname_.size()); |
| 41 | cb(hidl_ifname); |
| 42 | return Void(); |
| 43 | } |
| 44 | |
| 45 | Return<IfaceType> WifiApIface::getType() { |
| 46 | return IfaceType::AP; |
| 47 | } |
| 48 | |
| 49 | } // namespace implementation |
| 50 | } // namespace V1_0 |
| 51 | } // namespace wifi |
| 52 | } // namespace hardware |
| 53 | } // namespace android |