2 * Copyright (C) 2016 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include "wificond/client_interface_binder.h"
21 #include <binder/Status.h>
23 #include "wificond/client_interface_impl.h"
25 using android::binder::Status;
26 using android::net::wifi::IANQPDoneCallback;
27 using android::net::wifi::IWifiScannerImpl;
33 ClientInterfaceBinder::ClientInterfaceBinder(ClientInterfaceImpl* impl)
37 ClientInterfaceBinder::~ClientInterfaceBinder() {
40 Status ClientInterfaceBinder::enableSupplicant(bool* success) {
41 *success = impl_ && impl_->EnableSupplicant();
45 Status ClientInterfaceBinder::disableSupplicant(bool* success) {
46 *success = impl_ && impl_->DisableSupplicant();
50 Status ClientInterfaceBinder::getPacketCounters(
51 vector<int32_t>* out_packet_counters) {
52 if (impl_ == nullptr) {
55 impl_->GetPacketCounters(out_packet_counters);
59 Status ClientInterfaceBinder::signalPoll(
60 vector<int32_t>* out_signal_poll_results) {
61 if (impl_ == nullptr) {
64 impl_->SignalPoll(out_signal_poll_results);
68 Status ClientInterfaceBinder::getMacAddress(vector<uint8_t>* out_mac_address) {
69 if (impl_ == nullptr) {
72 *out_mac_address = impl_->GetMacAddress();
76 Status ClientInterfaceBinder::getInterfaceName(std::string* out_name) {
77 if (impl_ == nullptr) {
80 *out_name = impl_->GetInterfaceName();
84 Status ClientInterfaceBinder::getWifiScannerImpl(
85 sp<IWifiScannerImpl>* out_wifi_scanner_impl) {
86 if (impl_ == nullptr) {
87 *out_wifi_scanner_impl = nullptr;
90 *out_wifi_scanner_impl = impl_->GetScanner();
94 Status ClientInterfaceBinder::requestANQP(
95 const vector<uint8_t>& bssid,
96 const sp<IANQPDoneCallback>& callback,
98 if (impl_ == nullptr) {
102 *out_success = impl_->requestANQP(bssid, callback);
106 } // namespace wificond
107 } // namespace android