/drivers/peripheral/usb/test/unittest/hal/src/ |
D | usbd_function_test.cpp | 41 sptr<IUsbInterface> g_usbInterface = nullptr; variable 45 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase() 46 if (g_usbInterface == nullptr) { in SetUpTestCase() 50 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SINK, DATA_ROLE_DEVICE); in SetUpTestCase() 75 auto ret = g_usbInterface->GetCurrentFunctions(func); 89 auto ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_ACM); 93 ret = g_usbInterface->GetCurrentFunctions(func); 109 auto ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_ACM); 123 auto ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_INVALID); 136 auto ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_ECM); [all …]
|
D | usbd_device_test.cpp | 39 sptr<IUsbInterface> g_usbInterface = nullptr; variable 43 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase() 44 if (g_usbInterface == nullptr) { in SetUpTestCase() 48 auto ret = g_usbInterface->SetPortRole(1, 1, 1); in SetUpTestCase() 57 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase() 70 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase() 87 auto ret = g_usbInterface->OpenDevice(dev); 102 auto ret = g_usbInterface->OpenDevice(dev); 117 auto ret = g_usbInterface->OpenDevice(dev); 132 auto ret = g_usbInterface->OpenDevice(dev); [all …]
|
D | usbd_request_test.cpp | 55 sptr<IUsbInterface> g_usbInterface = nullptr; variable 59 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase() 60 if (g_usbInterface == nullptr) { in SetUpTestCase() 64 auto ret = g_usbInterface->SetPortRole(1, 1, 1); in SetUpTestCase() 73 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase() 83 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase() 90 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase() 92 auto ret = g_usbInterface->CloseDevice(dev_); in TearDownTestCase() 112 auto ret = g_usbInterface->SetConfig(dev, configIndex); 128 auto ret = g_usbInterface->SetConfig(dev, configIndex); [all …]
|
D | usbd_transfer_test.cpp | 56 sptr<IUsbInterface> g_usbInterface = nullptr; variable 89 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase() 90 if (g_usbInterface == nullptr) { in SetUpTestCase() 96 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, DEFAULT_ROLE_HOST, DEFAULT_ROLE_HOST); in SetUpTestCase() 109 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase() 119 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase() 126 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase() 128 auto ret = g_usbInterface->CloseDevice(dev_); in TearDownTestCase() 149 auto ret = g_usbInterface->ControlTransferRead(dev, ctrlparmas, bufferData); 166 auto ret = g_usbInterface->ControlTransferRead(dev, ctrlparmas, bufferData); [all …]
|
D | usbd_interface_test.cpp | 53 sptr<IUsbInterface> g_usbInterface = nullptr; variable 57 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase() 58 if (g_usbInterface == nullptr) { in SetUpTestCase() 62 auto ret = g_usbInterface->SetPortRole(1, 1, 1); in SetUpTestCase() 71 if (g_usbInterface->BindUsbdSubscriber(subscriber_) != HDF_SUCCESS) { in SetUpTestCase() 80 ret = g_usbInterface->OpenDevice(dev_); in SetUpTestCase() 83 ret = g_usbInterface->ClaimInterface(dev_, 1, 1); in SetUpTestCase() 89 g_usbInterface->UnbindUsbdSubscriber(subscriber_); in TearDownTestCase() 91 auto ret = g_usbInterface->CloseDevice(dev_); in TearDownTestCase() 108 auto ret = g_usbInterface->SetInterface(dev, interfaceId, altIndex); [all …]
|
D | usbfn_mtp_test.cpp | 70 sptr<IUsbInterface> g_usbInterface = nullptr; variable 178 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase() 179 ASSERT_TRUE(g_usbInterface != nullptr); in SetUpTestCase() 180 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SINK, DATA_ROLE_DEVICE); in SetUpTestCase() 183 ret = g_usbInterface->GetCurrentFunctions(g_currentFunc); in SetUpTestCase() 186 ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_MTP); in SetUpTestCase() 201 ASSERT_TRUE(g_usbInterface != nullptr); in TearDownTestCase() 202 ret = g_usbInterface->SetCurrentFunctions(g_currentFunc); in TearDownTestCase()
|
/drivers/peripheral/usb/test/benchmarktest/ |
D | usb_benchmark_device_test.cpp | 30 sptr<IUsbInterface> g_usbInterface = nullptr; variable 44 g_usbInterface = IUsbInterface::Get(); in SetUp() 45 ASSERT_NE(g_usbInterface, nullptr); in SetUp() 46 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SINK, DATA_ROLE_DEVICE); in SetUp() 62 ASSERT_NE(g_usbInterface, nullptr); in BENCHMARK_F() 65 if (g_usbInterface->BindUsbdSubscriber(subscriber) != HDF_SUCCESS) { in BENCHMARK_F() 71 ret = g_usbInterface->OpenDevice(g_dev); in BENCHMARK_F() 74 ret = g_usbInterface->UnbindUsbdSubscriber(subscriber); in BENCHMARK_F() 89 ASSERT_NE(g_usbInterface, nullptr); in BENCHMARK_F() 92 if (g_usbInterface->BindUsbdSubscriber(subscriber) != HDF_SUCCESS) { in BENCHMARK_F() [all …]
|
D | usb_benchmark_request_test.cpp | 33 sptr<IUsbInterface> g_usbInterface = nullptr; variable 74 g_usbInterface = IUsbInterface::Get(); in SetUp() 75 ASSERT_TRUE(g_usbInterface != nullptr); in SetUp() 76 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SOURCE, DATA_ROLE_HOST); in SetUp() 85 if (g_usbInterface->BindUsbdSubscriber(subscriber) != HDF_SUCCESS) { in InitPara() 89 auto ret = g_usbInterface->OpenDevice(g_dev); in InitPara() 95 ASSERT_TRUE(g_usbInterface != nullptr); in ReleasePara() 96 auto ret = g_usbInterface->UnbindUsbdSubscriber(subscriber); in ReleasePara() 98 ret = g_usbInterface->CloseDevice(g_dev); in ReleasePara() 110 ASSERT_TRUE(g_usbInterface != nullptr); in BENCHMARK_F() [all …]
|
D | usb_benchmark_function_test.cpp | 28 sptr<IUsbInterface> g_usbInterface = nullptr; variable 42 g_usbInterface = IUsbInterface::Get(); in SetUp() 43 ASSERT_NE(g_usbInterface, nullptr); in SetUp() 44 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SINK, DATA_ROLE_DEVICE); in SetUp() 60 ASSERT_TRUE(g_usbInterface != nullptr); in BENCHMARK_F() 64 ret = g_usbInterface->GetCurrentFunctions(funcs); in BENCHMARK_F() 81 ASSERT_TRUE(g_usbInterface != nullptr); in BENCHMARK_F() 84 ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_ACM); in BENCHMARK_F() 101 ASSERT_TRUE(g_usbInterface != nullptr); in BENCHMARK_F() 104 ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SOURCE, DATA_ROLE_HOST); in BENCHMARK_F() [all …]
|
D | usb_benchmark_transfer_test.cpp | 36 sptr<IUsbInterface> g_usbInterface = nullptr; variable 105 g_usbInterface = IUsbInterface::Get(); in SetUp() 106 ASSERT_NE(g_usbInterface, nullptr); in SetUp() 107 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SOURCE, DATA_ROLE_HOST); in SetUp() 117 if (g_usbInterface->BindUsbdSubscriber(subscriber) != HDF_SUCCESS) { in InitPara() 121 auto ret = g_usbInterface->OpenDevice(g_dev); in InitPara() 127 ASSERT_TRUE(g_usbInterface != nullptr); in ReleasePara() 128 auto ret = g_usbInterface->UnbindUsbdSubscriber(subscriber); in ReleasePara() 130 ret = g_usbInterface->CloseDevice(g_dev); in ReleasePara() 144 ASSERT_TRUE(g_usbInterface != nullptr); in BENCHMARK_F() [all …]
|
/drivers/peripheral/usb/test/unittest/mock/src/ |
D | usbd_request_auto_test.cpp | 79 sptr<IUsbInterface> g_usbInterface = nullptr; variable 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); 145 auto ret = g_usbInterface->SetConfig(dev, configIndex); 160 auto ret = g_usbInterface->SetConfig(dev, configIndex); [all …]
|
D | usbd_function_auto_test.cpp | 37 sptr<IUsbInterface> g_usbInterface = nullptr; variable 47 g_usbInterface = IUsbInterface::Get(); in SetUpTestCase() 48 if (g_usbInterface == nullptr) { in SetUpTestCase() 65 auto ret = g_usbInterface->SetCurrentFunctions(USB_FUNCTION_UNSUPPORTED); 79 auto ret = g_usbInterface->SetPortRole(PORT_ID_INVALID, POWER_ROLE_INVALID, DATA_ROLE_INVALID); 93 auto ret = g_usbInterface->SetPortRole(PORT_ID_INVALID, POWER_ROLE_SOURCE, DATA_ROLE_HOST); 107 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_INVALID, DATA_ROLE_DEVICE); 121 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_SOURCE, DATA_ROLE_INVALID); 135 auto ret = g_usbInterface->SetPortRole(DEFAULT_PORT_ID, POWER_ROLE_INVALID, DATA_ROLE_INVALID); 149 auto ret = g_usbInterface->SetPortRole(PORT_ID_INVALID, POWER_ROLE_SOURCE, DATA_ROLE_INVALID); [all …]
|
D | usbd_transfer_auto_test.cpp | 74 sptr<IUsbInterface> g_usbInterface = nullptr; variable 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); 170 auto ret = g_usbInterface->ControlTransferRead(dev, ctrlParmas, bufferData); 187 auto ret = g_usbInterface->ControlTransferRead(dev, ctrlParmas, bufferData); [all …]
|
D | usbd_device_auto_test.cpp | 51 sptr<IUsbInterface> g_usbInterface = nullptr; variable 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_); 311 auto ret = g_usbInterface->OpenDevice(dev); 326 auto ret = g_usbInterface->OpenDevice(dev); 341 auto ret = g_usbInterface->OpenDevice(dev); [all …]
|
/drivers/peripheral/usb/sample/hdi/ |
D | usb_subscriber.cpp | 29 namespace {sptr<IUsbInterface> g_usbInterface = nullptr;} variable 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/ |
D | usbdevice_fuzzer.cpp | 60 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()
|