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