1 /* 2 * Copyright (C) 2019 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_2.h" 21 22 using ::android::sp; 23 using ::android::hardware::wifi::supplicant::V1_2::ISupplicant; 24 using ::android::hardware::wifi::supplicant::V1_2::ISupplicantP2pIface; 25 using ::android::hardware::wifi::supplicant::V1_2::ISupplicantStaIface; 26 using ::android::hardware::wifi::supplicant::V1_2::ISupplicantStaNetwork; 27 getSupplicant_1_2(const std::string & supplicant_instance_name,bool isP2pOn)28sp<ISupplicant> getSupplicant_1_2(const std::string& supplicant_instance_name, 29 bool isP2pOn) { 30 return ISupplicant::castFrom( 31 getSupplicant(supplicant_instance_name, isP2pOn)); 32 } 33 getSupplicantStaIface_1_2(const sp<ISupplicant> & supplicant)34sp<ISupplicantStaIface> getSupplicantStaIface_1_2( 35 const sp<ISupplicant>& supplicant) { 36 return ISupplicantStaIface::castFrom(getSupplicantStaIface(supplicant)); 37 } 38 createSupplicantStaNetwork_1_2(const sp<ISupplicant> & supplicant)39sp<ISupplicantStaNetwork> createSupplicantStaNetwork_1_2( 40 const sp<ISupplicant>& supplicant) { 41 return ISupplicantStaNetwork::castFrom( 42 createSupplicantStaNetwork(supplicant)); 43 } 44 getSupplicantP2pIface_1_2(const sp<ISupplicant> & supplicant)45sp<ISupplicantP2pIface> getSupplicantP2pIface_1_2( 46 const sp<ISupplicant>& supplicant) { 47 return ISupplicantP2pIface::castFrom(getSupplicantP2pIface(supplicant)); 48 } 49