xref: /aosp_15_r20/hardware/interfaces/wifi/supplicant/1.4/vts/functional/supplicant_hidl_test_utils_1_4.h (revision 4d7e907c777eeecc4c5bd7cf640a754fac206ff7)
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 #ifndef SUPPLICANT_HIDL_TEST_UTILS_1_4_H
18 #define SUPPLICANT_HIDL_TEST_UTILS_1_4_H
19 
20 #include <android/hardware/wifi/supplicant/1.4/ISupplicant.h>
21 #include <android/hardware/wifi/supplicant/1.4/ISupplicantP2pIface.h>
22 #include <android/hardware/wifi/supplicant/1.4/ISupplicantStaIface.h>
23 
24 android::sp<android::hardware::wifi::supplicant::V1_4::ISupplicantStaIface>
25 getSupplicantStaIface_1_4(
26     const android::sp<android::hardware::wifi::supplicant::V1_4::ISupplicant>&
27         supplicant);
28 android::sp<android::hardware::wifi::supplicant::V1_4::ISupplicantP2pIface>
29 getSupplicantP2pIface_1_4(
30     const android::sp<android::hardware::wifi::supplicant::V1_4::ISupplicant>&
31         supplicant);
32 android::sp<android::hardware::wifi::supplicant::V1_4::ISupplicant>
33 getSupplicant_1_4(const std::string& supplicant_instance_name, bool isP2pOn);
34 
35 class SupplicantHidlTestBaseV1_4 : public SupplicantHidlTestBase {
36    public:
SetUp()37     virtual void SetUp() override {
38         SupplicantHidlTestBase::SetUp();
39         supplicant_ = getSupplicant_1_4(supplicant_instance_name_, isP2pOn_);
40         ASSERT_NE(supplicant_.get(), nullptr);
41         EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
42     }
43 
44    protected:
45     android::sp<android::hardware::wifi::supplicant::V1_4::ISupplicant>
46         supplicant_;
47 };
48 #endif /* SUPPLICANT_HIDL_TEST_UTILS_1_4_H */
49