template <typename ProtocolType, typename FakeEndpointType = FakeEndpoint>

class FakeUsbFidlProvider

Defined at line 168 of file ../../src/devices/usb/lib/usb-endpoint/testing/fake-usb-endpoint-server.h

FakeUsbFidlProvider is, as its name suggests, a fake USB FIDL server for testing.

ProtocolType must be one of fuchsia_hardware_usb_dci::UsbDci,

fuchsia_usb_hardware_function::UsbFunction, or fuchsia_hardware_usb::Usb. In other words,

ProtocolType is expected to have one function to override--void

ConnectToEndpoint(ConnectToEndpointRequest

&

request, ConnectToEndpointCompleter::Sync

&

completer).

fuchsia_hardware_usb_hci::UsbHci may also use this fake USB FIDL server, but will

have to override the ConnectToEndpoint and write a new ExpectConnectToEndpoint method to

accommodate device_id.

It provides connections to several FakeEndpoints as requested. FakeEndpointType must be

FakeEndpoint or an inherited class of FakeEndpoint, defaulting to FakeEndpoint if not

specified.

Public Methods

void FakeUsbFidlProvider<ProtocolType, FakeEndpointType> (async_dispatcher_t * dispatcher)

Defined at line 170 of file ../../src/devices/usb/lib/usb-endpoint/testing/fake-usb-endpoint-server.h

void ~FakeUsbFidlProvider<ProtocolType, FakeEndpointType> ()

Defined at line 171 of file ../../src/devices/usb/lib/usb-endpoint/testing/fake-usb-endpoint-server.h

void ExpectConnectToEndpoint (uint8_t ep_addr)

Defined at line 173 of file ../../src/devices/usb/lib/usb-endpoint/testing/fake-usb-endpoint-server.h

FakeEndpointType & fake_endpoint (uint8_t ep_addr)

Defined at line 177 of file ../../src/devices/usb/lib/usb-endpoint/testing/fake-usb-endpoint-server.h