Home
last modified time | relevance | path

Searched refs:g_usbInterface (Results 1 - 18 of 18) sorted by relevance

/drivers/peripheral/usb/test/unittest/hal/src/
H A Dusbd_device_test.cpp40 sptr<OHOS::HDI::Usb::V1_1::IUsbInterface> g_usbInterface = nullptr; member
49 g_usbInterface = OHOS::HDI::Usb::V1_1::IUsbInterface::Get(); in SetUpTestCase()
50 if (g_usbInterface == nullptr) { in SetUpTestCase()
54 auto ret = g_usbInterface->SetPortRole(1, 1, 1); in SetUpTestCase()
64 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase()
77 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase()
94 auto ret = g_usbInterface->OpenDevice(dev); in HWTEST_F()
109 auto ret = g_usbInterface->OpenDevice(dev); in HWTEST_F()
124 auto ret = g_usbInterface->OpenDevice(dev); in HWTEST_F()
139 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbd_function_test.cpp41 sptr<IUsbInterface> g_usbInterface = nullptr; member
50 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase()
51 if (g_usbInterface == nullptr) { in SetUpTestCase()
55 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SINK, DATA_ROLE_DEVICE); in SetUpTestCase()
81 auto ret = g_usbInterface->GetCurrentFunctions(func); in HWTEST_F()
95 auto ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_ACM); in HWTEST_F()
99 ret = g_usbInterface->GetCurrentFunctions(func); in HWTEST_F()
115 auto ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_ACM); in HWTEST_F()
129 auto ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_INVALID); in HWTEST_F()
142 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbd_request_test.cpp56 sptr<OHOS::HDI::Usb::V1_1::IUsbInterface> g_usbInterface = nullptr; member
65 g_usbInterface = OHOS::HDI::Usb::V1_1::IUsbInterface::Get(); in SetUpTestCase()
66 if (g_usbInterface == nullptr) { in SetUpTestCase()
70 auto ret = g_usbInterface->SetPortRole(1, 1, 1); in SetUpTestCase()
80 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase()
90 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase()
97 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase()
99 auto ret = g_usbInterface->CloseDevice(dev_); in TearDownTestCase()
119 auto ret = g_usbInterface->SetConfig(dev, configIndex); in HWTEST_F()
135 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbd_device_status_test.cpp43 sptr<OHOS::HDI::Usb::V1_1::IUsbInterface> g_usbInterface = nullptr; member
52 g_usbInterface = OHOS::HDI::Usb::V1_1::IUsbInterface::Get(); in SetUpTestCase()
53 if (g_usbInterface == nullptr) { in SetUpTestCase()
57 auto ret = g_usbInterface->SetPortRole(1, 1, 1); in SetUpTestCase()
67 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase()
77 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase()
84 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase()
86 auto ret = g_usbInterface->CloseDevice(dev_); in TearDownTestCase()
107 ret = g_usbInterface->GetDeviceSpeed(dev, speed); in HWTEST_F()
124 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbd_manage_interface_test.cpp44 sptr<IUsbInterface> g_usbInterface = nullptr; member
53 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase()
54 if (g_usbInterface == nullptr) { in SetUpTestCase()
58 auto ret = g_usbInterface->SetPortRole(1, 1, 1); in SetUpTestCase()
68 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase()
78 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase()
85 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase()
87 auto ret = g_usbInterface->CloseDevice(dev_); in TearDownTestCase()
109 ret = g_usbInterface->ManageInterface(dev, interfaceId, true); in HWTEST_F()
130 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbd_interface_test.cpp53 sptr<IUsbInterface> g_usbInterface = nullptr;
62 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase()
63 if (g_usbInterface == nullptr) { in SetUpTestCase()
67 auto ret = g_usbInterface->SetPortRole(1, 1, 1); in SetUpTestCase()
77 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase()
86 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase()
89 ret = g_usbInterface->ClaimInterface(dev_, 1, 1); in SetUpTestCase()
95 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase()
97 auto ret = g_usbInterface->CloseDevice(dev_); in TearDownTestCase()
114 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbd_transfer_test.cpp57 sptr<OHOS::HDI::Usb::V1_1::IUsbInterface> g_usbInterface = nullptr; member
95 g_usbInterface = OHOS::HDI::Usb::V1_1::IUsbInterface::Get(); in SetUpTestCase()
96 if (g_usbInterface == nullptr) { in SetUpTestCase()
102 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, DEFAULT_ROLE_HOST, DEFAULT_ROLE_HOST); in SetUpTestCase()
116 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase()
126 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase()
133 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase()
135 auto ret = g_usbInterface->CloseDevice(dev_); in TearDownTestCase()
156 auto ret = g_usbInterface->ControlTransferRead(dev, ctrlparmas, bufferData); in HWTEST_F()
173 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbfn_mtp_test.cpp70 sptr<IUsbInterface> g_usbInterface = nullptr; member
183 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase()
184 ASSERT_TRUE(g_usbInterface != nullptr); in SetUpTestCase()
185 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SINK, DATA_ROLE_DEVICE); in SetUpTestCase()
189 ret = g_usbInterface->GetCurrentFunctions(g_currentFunc); in SetUpTestCase()
192 ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_MTP); in SetUpTestCase()
207 ASSERT_TRUE(g_usbInterface != nullptr); in TearDownTestCase()
208 ret = g_usbInterface->SetCurrentFunctions(g_currentFunc); in TearDownTestCase()
/drivers/peripheral/usb/test/benchmarktest/
H A Dusb_benchmark_request_test.cpp34 sptr<OHOS::HDI::Usb::V1_1::IUsbInterface> g_usbInterface = nullptr; member
80 g_usbInterface = OHOS::HDI::Usb::V1_1::IUsbInterface::Get(); in SetUp()
81 ASSERT_TRUE(g_usbInterface != nullptr); in SetUp()
82 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SOURCE, DATA_ROLE_HOST); in SetUp()
92 if (g_usbInterface->BindUsbdSubscriber(subscriber) != HDF_SUCCESS) { in InitPara()
96 auto ret = g_usbInterface->OpenDevice(g_dev); in InitPara()
102 ASSERT_TRUE(g_usbInterface != nullptr); in ReleasePara()
103 auto ret = g_usbInterface->UnbindUsbdSubscriber(subscriber); in ReleasePara()
105 ret = g_usbInterface->CloseDevice(g_dev); in ReleasePara()
117 ASSERT_TRUE(g_usbInterface ! in BENCHMARK_F()
[all...]
H A Dusb_benchmark_device_test.cpp30 sptr<IUsbInterface> g_usbInterface = nullptr; member
49 g_usbInterface = IUsbInterface::Get(); in SetUp()
50 ASSERT_NE(g_usbInterface, nullptr); in SetUp()
51 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SINK, DATA_ROLE_DEVICE); in SetUp()
68 ASSERT_NE(g_usbInterface, nullptr); in BENCHMARK_F()
71 if (g_usbInterface->BindUsbdSubscriber(subscriber) != HDF_SUCCESS) { in BENCHMARK_F()
77 ret = g_usbInterface->OpenDevice(g_dev); in BENCHMARK_F()
80 ret = g_usbInterface->UnbindUsbdSubscriber(subscriber); in BENCHMARK_F()
95 ASSERT_NE(g_usbInterface, nullptr); in BENCHMARK_F()
98 if (g_usbInterface in BENCHMARK_F()
[all...]
H A Dusb_benchmark_transfer_test.cpp37 sptr<OHOS::HDI::Usb::V1_1::IUsbInterface> g_usbInterface = nullptr; member
111 g_usbInterface = OHOS::HDI::Usb::V1_1::IUsbInterface::Get(); in SetUp()
112 ASSERT_NE(g_usbInterface, nullptr); in SetUp()
113 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SOURCE, DATA_ROLE_HOST); in SetUp()
124 if (g_usbInterface->BindUsbdSubscriber(subscriber) != HDF_SUCCESS) { in InitPara()
128 auto ret = g_usbInterface->OpenDevice(g_dev); in InitPara()
134 ASSERT_TRUE(g_usbInterface != nullptr); in ReleasePara()
135 auto ret = g_usbInterface->UnbindUsbdSubscriber(subscriber); in ReleasePara()
137 ret = g_usbInterface->CloseDevice(g_dev); in ReleasePara()
151 ASSERT_TRUE(g_usbInterface ! in BENCHMARK_F()
[all...]
H A Dusb_benchmark_function_test.cpp28 sptr<IUsbInterface> g_usbInterface = nullptr; member
47 g_usbInterface = IUsbInterface::Get(); in SetUp()
48 ASSERT_NE(g_usbInterface, nullptr); in SetUp()
49 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SINK, DATA_ROLE_DEVICE); in SetUp()
66 ASSERT_TRUE(g_usbInterface != nullptr); in BENCHMARK_F()
70 ret = g_usbInterface->GetCurrentFunctions(funcs); in BENCHMARK_F()
87 ASSERT_TRUE(g_usbInterface != nullptr); in BENCHMARK_F()
90 ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_ACM); in BENCHMARK_F()
107 ASSERT_TRUE(g_usbInterface != nullptr); in BENCHMARK_F()
110 ret = g_usbInterface in BENCHMARK_F()
[all...]
/drivers/peripheral/usb/test/unittest/mock/src/
H A Dusbd_request_auto_test.cpp79 sptr<IUsbInterface> g_usbInterface = nullptr; member
85 g_usbInterface = IUsbInterface::Get(true); in SetUpTestCase()
86 if (g_usbInterface == nullptr) { in SetUpTestCase()
90 sptr<UsbImpl> sp = static_cast<UsbImpl *>(g_usbInterface.GetRefPtr()); in SetUpTestCase()
108 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase()
114 g_usbInterface->CloseDevice(dev_); in TearDownTestCase()
115 sptr<UsbImpl> sp = static_cast<UsbImpl *>(g_usbInterface.GetRefPtr()); in TearDownTestCase()
130 auto ret = g_usbInterface->SetConfig(dev, configIndex); in HWTEST_F()
145 auto ret = g_usbInterface->SetConfig(dev, configIndex); in HWTEST_F()
160 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbd_transfer_auto_test.cpp74 sptr<IUsbInterface> g_usbInterface = nullptr; member
109 g_usbInterface = IUsbInterface::Get(true); in SetUpTestCase()
110 if (g_usbInterface == nullptr) { in SetUpTestCase()
114 sptr<UsbImpl> sp = static_cast<UsbImpl *>(g_usbInterface.GetRefPtr()); in SetUpTestCase()
131 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase()
137 g_usbInterface->CloseDevice(dev_); in TearDownTestCase()
138 sptr<UsbImpl> sp = static_cast<UsbImpl *>(g_usbInterface.GetRefPtr()); in TearDownTestCase()
154 auto ret = g_usbInterface->ControlTransferRead(dev, ctrlParmas, bufferData); in HWTEST_F()
170 auto ret = g_usbInterface->ControlTransferRead(dev, ctrlParmas, bufferData); in HWTEST_F()
187 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbd_function_auto_test.cpp37 sptr<IUsbInterface> g_usbInterface = nullptr; member
47 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase()
48 if (g_usbInterface == nullptr) { in SetUpTestCase()
65 auto ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_UNSUPPORTED); in HWTEST_F()
79 auto ret = g_usbInterface->SetPortRole(PORT_ID_INVALID, POWER_ROLE_INVALID, DATA_ROLE_INVALID); in HWTEST_F()
93 auto ret = g_usbInterface->SetPortRole(PORT_ID_INVALID, POWER_ROLE_SOURCE, DATA_ROLE_HOST); in HWTEST_F()
107 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_INVALID, DATA_ROLE_DEVICE); in HWTEST_F()
121 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SOURCE, DATA_ROLE_INVALID); in HWTEST_F()
135 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_INVALID, DATA_ROLE_INVALID); in HWTEST_F()
149 auto ret = g_usbInterface in HWTEST_F()
[all...]
H A Dusbd_device_auto_test.cpp51 sptr<IUsbInterface> g_usbInterface = nullptr; member
57 g_usbInterface = IUsbInterface::Get(true); in SetUpTestCase()
58 ASSERT_NE(nullptr, g_usbInterface); in SetUpTestCase()
59 sptr<UsbImpl> sp = static_cast<UsbImpl *>(g_usbInterface.GetRefPtr()); in SetUpTestCase()
82 g_usbInterface->CloseDevice(dev_); in TearDownTestCase()
83 sptr<UsbImpl> sp = static_cast<UsbImpl *>(g_usbInterface.GetRefPtr()); in TearDownTestCase()
297 int32_t ret = g_usbInterface->OpenDevice(dev_); in HWTEST_F()
311 auto ret = g_usbInterface->OpenDevice(dev); in HWTEST_F()
326 auto ret = g_usbInterface->OpenDevice(dev); in HWTEST_F()
341 auto ret = g_usbInterface in HWTEST_F()
[all...]
/drivers/peripheral/usb/sample/hdi/
H A Dusb_subscriber.cpp29 namespace {sptr<IUsbInterface> g_usbInterface = nullptr;} member
33 g_usbInterface = IUsbInterface::Get(); in main()
34 if (g_usbInterface == nullptr) { in main()
40 if (g_usbInterface->BindUsbdSubscriber(subscriber) != HDF_SUCCESS) { in main()
46 if (g_usbInterface->UnbindUsbdSubscriber(subscriber) != HDF_SUCCESS) { in main()
/drivers/peripheral/usb/test/fuzztest/usbdevice_fuzzer/
H A Dusbdevice_fuzzer.cpp60 sptr<IUsbInterface> g_usbInterface = IUsbInterface::Get(false); in DoSomethingInterestingWithMyAPI() local
61 if (g_usbInterface == nullptr) { in DoSomethingInterestingWithMyAPI()
65 sptr<UsbInterfaceStub> impl = new UsbInterfaceStub(g_usbInterface); in DoSomethingInterestingWithMyAPI()

Completed in 15 milliseconds