class EndpointList
Defined at line 311 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()) == EndpointDirection::kIn
&
&
usb_ep_type(endpoint.descriptor()) ==
EndpointType::kInterrupt) {
return std::make_optional
<usb
_endpoint_descriptor_t>(*endpoint.descriptor());
}
}
}
Public Methods
iterator begin ()
Defined at line 76 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
const_iterator cbegin ()
Defined at line 85 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
iterator end ()
Defined at line 89 of file ../../src/devices/usb/lib/usb/usb-wrapper.cc
const_iterator cend ()
Defined at line 94 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 319 of file ../../src/devices/usb/lib/usb/include/usb/usb.h
void EndpointList ()
Defined at line 322 of file ../../src/devices/usb/lib/usb/include/usb/usb.h
const usb_interface_descriptor_t * descriptor ()
Defined at line 324 of file ../../src/devices/usb/lib/usb/include/usb/usb.h