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;
32 ClientInterfaceBinder::ClientInterfaceBinder(ClientInterfaceImpl* impl)
36 ClientInterfaceBinder::~ClientInterfaceBinder() {
39 Status ClientInterfaceBinder::enableSupplicant(bool* success) {
40 *success = impl_ && impl_->EnableSupplicant();
44 Status ClientInterfaceBinder::disableSupplicant(bool* success) {
45 *success = impl_ && impl_->DisableSupplicant();
49 Status ClientInterfaceBinder::getPacketCounters(
50 vector<int32_t>* out_packet_counters) {
51 if (impl_ == nullptr) {
54 impl_->GetPacketCounters(out_packet_counters);
58 Status ClientInterfaceBinder::signalPoll(
59 vector<int32_t>* out_signal_poll_results) {
60 if (impl_ == nullptr) {
63 impl_->SignalPoll(out_signal_poll_results);
67 Status ClientInterfaceBinder::getMacAddress(vector<uint8_t>* out_mac_address) {
68 if (impl_ == nullptr) {
71 *out_mac_address = impl_->GetMacAddress();
75 Status ClientInterfaceBinder::getInterfaceName(std::string* out_name) {
76 if (impl_ == nullptr) {
79 *out_name = impl_->GetInterfaceName();
83 Status ClientInterfaceBinder::requestANQP(
84 const vector<uint8_t>& bssid,
85 const sp<IANQPDoneCallback>& callback,
87 if (impl_ == nullptr) {
91 *out_success = impl_->requestANQP(bssid, callback);
95 } // namespace wificond
96 } // namespace android