class EndpointList
Defined at line 264 of file ../../src/devices/usb/lib/usb/include/usb/usb.h
EndpointList is used to iterate all of the USB endpoint descriptors of an Interface. It is
created by calling GetEndpointList on an Interface. The returned descriptor pointers are valid
for the lifetime of the InterfaceList used to create the parent Interface. EndpointList
implements a standard C++ iterator interface that returns Endpoint.
Example Usage:
std::optional
<InterfaceList
> interfaces;
status = InterfaceList::Create(my_client, true,
&interfaces
);
if (status != ZX_OK) {
...
}
// Find the first interrupt endpoint and copy it for use by the driver.
for (const auto
&
interface : *interfaces) {
for (auto
&
endpoint : interface.GetEndpointList()) {
if (usb_ep_direction(endpoint.descriptor()) == USB_ENDPOINT_IN
&
&
usb_ep_type(endpoint.descriptor()) == USB_ENDPOINT_INTERRUPT) {
return std::make_optional
<usb
_endpoint_descriptor_t>(*endpoint.descriptor());
}
}
}
Public Methods
iterator begin ()
Defined at line 74 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
const_iterator cbegin ()
Defined at line 83 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
iterator end ()
Defined at line 87 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
const_iterator cend ()
Defined at line 92 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
void EndpointList (const usb_desc_iter_t & iter, const usb_interface_descriptor_t * descriptor)
Defined at line 272 of file ../../src/devices/usb/lib/usb/include/usb/usb.h
void EndpointList ()
Defined at line 275 of file ../../src/devices/usb/lib/usb/include/usb/usb.h
const usb_interface_descriptor_t * descriptor ()
Defined at line 277 of file ../../src/devices/usb/lib/usb/include/usb/usb.h