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 <android-base/logging.h>
18 
19 #include "supplicant_hidl_test_utils.h"
20 #include "supplicant_hidl_test_utils_1_1.h"
21 
22 using ::android::hardware::wifi::supplicant::V1_1::ISupplicant;
23 using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIface;
24 using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaNetwork;
25 using ::android::sp;
26 
getSupplicant_1_1(const std::string & supplicant_instance_name,bool isP2pOn)27 sp<ISupplicant> getSupplicant_1_1(const std::string& supplicant_instance_name,
28                                   bool isP2pOn) {
29     return ISupplicant::castFrom(
30         getSupplicant(supplicant_instance_name, isP2pOn));
31 }
32 
getSupplicantStaIface_1_1(const sp<ISupplicant> & supplicant)33 sp<ISupplicantStaIface> getSupplicantStaIface_1_1(
34     const sp<ISupplicant>& supplicant) {
35     return ISupplicantStaIface::castFrom(getSupplicantStaIface(supplicant));
36 }
37 
createSupplicantStaNetwork_1_1(const sp<ISupplicant> & supplicant)38 sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_1(
39     const sp<ISupplicant>& supplicant) {
40     return ISupplicantStaNetwork::castFrom(
41         createSupplicantStaNetwork(supplicant));
42 }
43