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 #pragma once
18 #pragma clang diagnostic ignored "-Wweak-vtables"
19 
20 #include <VtsCoreUtil.h>
21 #include <android/hardware/wifi/supplicant/1.2/ISupplicant.h>
22 #include <android/hardware/wifi/supplicant/1.2/ISupplicantP2pIface.h>
23 #include <android/hardware/wifi/supplicant/1.2/ISupplicantStaIface.h>
24 #include <android/hardware/wifi/supplicant/1.2/ISupplicantStaNetwork.h>
25 #include <gtest/gtest.h>
26 
27 android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>
28 getSupplicant_1_2(const std::string& supplicant_instance_name, bool isP2pOn);
29 
30 android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicantStaIface>
31 getSupplicantStaIface_1_2(
32     const android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>&
33         supplicant);
34 
35 android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicantStaNetwork>
36 createSupplicantStaNetwork_1_2(
37     const android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>&
38         supplicant);
39 
40 android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicantP2pIface>
41 getSupplicantP2pIface_1_2(
42     const android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>&
43         supplicant);
44 
45 class SupplicantHidlTestBaseV1_2 : public SupplicantHidlTestBase {
46    public:
SetUp()47     virtual void SetUp() override {
48         SupplicantHidlTestBase::SetUp();
49         supplicant_ = getSupplicant_1_2(supplicant_instance_name_, isP2pOn_);
50         ASSERT_NE(supplicant_.get(), nullptr);
51         EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
52     }
53 
54    protected:
55     android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>
56         supplicant_;
57 };
58